-
Notifications
You must be signed in to change notification settings - Fork 2
Pin panel versions, report runtime status, fix log preconditions #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
adbb428
5271b37
0bb21c8
63ddb42
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to this project are documented here. Versions follow the | ||
| `vMAJOR.MINOR.PATCH` git tags that drive the release pipeline. | ||
|
|
||
| ## v0.1.0 | ||
|
|
||
| Supported Easypanel versions: **2.32.0 .. 2.33.1** (verified against the pinned | ||
| route surfaces in `internal/easypanel/testdata/`). | ||
|
|
||
| ### Breaking | ||
|
|
||
| - `GetServiceStatus` no longer returns environment variable values by default. | ||
| Keys are kept and values become `<redacted>`. Set `include_env: true` on the | ||
| request to get clear text. Easypanel stores secrets in the same env blob its | ||
| inspect routes return, and a `GRPC_AUTH_TOKENS` entry can read every project. | ||
|
|
||
| ### Features | ||
|
|
||
| - `GetServiceStatus` now reports runtime state alongside stored configuration: | ||
| `status` (`running` / `stopped` / `unknown`), `running_containers`, | ||
| `containers[]` (id, name, image, state, status, created) and, for compose | ||
| services, `compose_services[]`. Compose services fall back to the running | ||
| container's image, which the panel's inspect route never provides. | ||
| - `GetLogs` gained the panel's remaining Loki filters: `stream`, `levels`, | ||
| `search`, `start` and `end`. `limit` is clamped to the panel's maximum of 1000 | ||
| instead of being rejected as a validation error. | ||
| - Panel version support window is now explicit (`MinSupportedVersion`, | ||
| `MaxTestedVersion`). The gRPC server probes the live panel at startup and logs | ||
| whether it is inside that window. Skip with `EASYPANEL_SKIP_VERSION_CHECK=1`. | ||
| - New CLI commands: `settings panel-version` (panel version + supported range) | ||
| and `settings logs` (log aggregation status). | ||
| - `scripts/panel-surface.sh` + `scripts/extract-panel-surface.py` re-pin the panel | ||
| route surface from the official `easypanel/easypanel` images. | ||
|
|
||
| ### Fixes | ||
|
|
||
| - `GetLogs` no longer surfaces the panel's opaque `[BAD_REQUEST] fetch failed`. | ||
| Easypanel serves logs only from its own Loki deployment, which exists only when | ||
| log aggregation is enabled (Settings -> Logs, licensed feature). The RPC now | ||
| prechecks `logs.getSettings` and returns `FailedPrecondition` naming the cause | ||
| and the fix; an unreachable-but-enabled log store is reported separately. | ||
| - Invalid `stream` values are rejected locally with `InvalidArgument` rather than | ||
| producing a panel validation error. | ||
| - A failed container query no longer fails the whole `GetServiceStatus` call; it | ||
| degrades to `status: "unknown"` with configuration intact. | ||
|
|
||
| ### Internal | ||
|
|
||
| - Every panel route is declared in `internal/easypanel/routes.go` instead of being | ||
| spread across string literals. | ||
| - Pinned panel route surfaces for 2.32.2, 2.33.0 and 2.33.1 with tests asserting | ||
| every route used still exists, and that its input shape is unchanged across the | ||
| supported range. All three releases expose the same 375 procedures. | ||
| - New unit tests cover log filter forwarding, limit clamping, precondition | ||
| mapping, runtime status assembly, env redaction, version parsing and the panel | ||
| version probe. New live test `TestGRPC_RuntimeStatusAndLogs`. | ||
|
|
||
| ## v0.0.2 | ||
|
|
||
| - Apply Easypanel config changes via redeploy. | ||
| - Full resource limits (CPU/memory reservation) plus `UpdateDeploy` RPC. | ||
| - Docker images and release pipeline with `dev` / release tagging. | ||
| - Deployment guide. | ||
|
|
||
| ## v0.0.1 | ||
|
|
||
| - Initial release: Easypanel tRPC CLI and gRPC PaaS adapter with bearer token | ||
| auth, container and compose deployments, domain management. |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,11 +1,13 @@ | ||||||||||||||||||||||||||
| package main | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| import ( | ||||||||||||||||||||||||||
| "context" | ||||||||||||||||||||||||||
| "fmt" | ||||||||||||||||||||||||||
| "log" | ||||||||||||||||||||||||||
| "net" | ||||||||||||||||||||||||||
| "os" | ||||||||||||||||||||||||||
| "strings" | ||||||||||||||||||||||||||
| "time" | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| "github.com/igun997/deploy-everything/internal/auth" | ||||||||||||||||||||||||||
| "github.com/igun997/deploy-everything/internal/easypanel" | ||||||||||||||||||||||||||
|
|
@@ -36,6 +38,13 @@ func main() { | |||||||||||||||||||||||||
| // Easypanel client | ||||||||||||||||||||||||||
| ep := easypanel.NewClient(endpoint, token) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| // Probe the panel version so route drift shows up at boot instead of on the | ||||||||||||||||||||||||||
| // first failing RPC. Never fatal: a slow or briefly unreachable panel should | ||||||||||||||||||||||||||
| // not stop the server from serving. | ||||||||||||||||||||||||||
| if os.Getenv("EASYPANEL_SKIP_VERSION_CHECK") == "" { | ||||||||||||||||||||||||||
| reportPanelVersion(ep, endpoint) | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
Comment on lines
+42
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Only skip the version probe when the value is
Proposed fix- if os.Getenv("EASYPANEL_SKIP_VERSION_CHECK") == "" {
+ if os.Getenv("EASYPANEL_SKIP_VERSION_CHECK") != "1" {
reportPanelVersion(ep, endpoint)
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| // Auth tokens | ||||||||||||||||||||||||||
| tokens := strings.Split(grpcTokens, ",") | ||||||||||||||||||||||||||
| for i := range tokens { | ||||||||||||||||||||||||||
|
|
@@ -68,6 +77,31 @@ func main() { | |||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| // reportPanelVersion logs the panel version and whether it falls inside the | ||||||||||||||||||||||||||
| // verified support window. Set EASYPANEL_SKIP_VERSION_CHECK to skip the probe. | ||||||||||||||||||||||||||
| func reportPanelVersion(ep *easypanel.Client, endpoint string) { | ||||||||||||||||||||||||||
| ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) | ||||||||||||||||||||||||||
| defer cancel() | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ver, err := ep.PanelVersion(ctx) | ||||||||||||||||||||||||||
| if err != nil { | ||||||||||||||||||||||||||
| log.Printf("warning: could not read Easypanel version from %s: %v", endpoint, err) | ||||||||||||||||||||||||||
| return | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| tooOld, untested := easypanel.SupportRange(ver) | ||||||||||||||||||||||||||
| switch { | ||||||||||||||||||||||||||
| case tooOld: | ||||||||||||||||||||||||||
| log.Printf("warning: Easypanel %s is older than the supported minimum %s; routes may be missing", | ||||||||||||||||||||||||||
| ver, easypanel.MinSupportedVersion) | ||||||||||||||||||||||||||
| case untested: | ||||||||||||||||||||||||||
| log.Printf("warning: Easypanel %s is newer than the newest tested release %s; run scripts/panel-surface.sh to refresh the pinned route surface", | ||||||||||||||||||||||||||
| ver, easypanel.MaxTestedVersion) | ||||||||||||||||||||||||||
| default: | ||||||||||||||||||||||||||
| log.Printf("Easypanel %s (supported range %s..%s)", ver, easypanel.MinSupportedVersion, easypanel.MaxTestedVersion) | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| func mustEnv(key string) string { | ||||||||||||||||||||||||||
| v := os.Getenv(key) | ||||||||||||||||||||||||||
| if v == "" { | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.