Skip to content

slice-soft/ss-keel-devpanel

Repository files navigation

ss-keel-devpanel

Observability dev panel for Keel applications. Provides a real-time UI to inspect requests, logs, addon events, routes, and configuration — all embedded in your Go binary.

CI Release Go Go Report Card Go Reference License Made in Colombia


Features

  • Requests — ring buffer (256 entries) with method, path, status, latency, request ID
  • Logs — ring buffer (512 entries) with level filter, search, and live SSE stream
  • Addon events — per-addon SSE stream from any contracts.Debuggable addon
  • Routes — registered Fiber routes at a glance
  • Config — env vars (secrets auto-redacted), Go runtime stats, addon manifests
  • GuardEnabled flag + optional Bearer token; returns 404 when disabled
  • Rate limiting — 120 req/min per IP on all panel endpoints
  • Header — every panel response includes X-Keel-Panel: true
  • Zero external deps — htmx and CSS embedded via //go:embed

🚀 Installation

keel add devpanel

The CLI will:

  • Add ss-keel-devpanel to your Go module
  • Create cmd/setup_devpanel.go with the initialization function
  • Inject one line into cmd/main.go before your modules are registered
  • Add KEEL_PANEL_ENABLED, KEEL_PANEL_SECRET, and KEEL_PANEL_PATH to .env

Or manually:

go get github.com/slice-soft/ss-keel-devpanel

Quick start

import (
    "github.com/gofiber/fiber/v2"
    "github.com/slice-soft/ss-keel-devpanel/devpanel"
)

func main() {
    panel := devpanel.New(devpanel.Config{
        Enabled: true,                   // set false in production
        Secret:  os.Getenv("PANEL_SECRET"), // optional Bearer token
        Path:    "/keel/panel",          // default path
    })
    defer panel.Shutdown()

    app := fiber.New()

    // Capture incoming requests (place before your routes).
    app.Use(panel.RequestMiddleware())

    // Optional: defence-in-depth guard at app level.
    app.Use(panel.GlobalGuard())

    // Mount the panel UI.
    panel.Mount(app)

    // Your application routes.
    app.Get("/api/users", handleUsers)

    app.Listen(":3000")
}

Open http://localhost:3000/keel/panel in your browser.


Logger

Use PanelLogger to associate logs with requests in the panel:

logger := panel.Logger()

app.Use(func(c *fiber.Ctx) error {
    reqLogger := logger.WithRequestID(c.Get("X-Request-ID"))
    c.Locals("logger", reqLogger)
    return c.Next()
})

// In a handler:
log := c.Locals("logger").(*devpanel.PanelLogger)
log.Info("user fetched: %s", userID)

Addon integration

Any addon implementing contracts.Debuggable can self-register:

func (a *MyAddon) Register(app *keel.App) error {
    if panel, ok := app.GetAddon("devpanel").(contracts.PanelRegistry); ok {
        panel.RegisterAddon(a)
    }
    return nil
}

Addons that also implement contracts.Manifestable expose version, capabilities, resources, and env vars on the Config page.


Configuration

Field Type Default Description
Enabled bool true Enable the panel. Set false in prod.
Secret string "" Bearer token. Empty = no auth required.
Path string /keel/panel URL prefix for all panel routes.

Env vars declared in the panel's own manifest:

Key Secret Default
KEEL_PANEL_ENABLED no true
KEEL_PANEL_SECRET yes (empty)
KEEL_PANEL_PATH no /keel/panel

Security

  • Always set Enabled: false in production unless you intend to expose the panel.
  • Use Secret with a strong random token and HTTPS when exposing the panel.
  • GlobalGuard() provides an extra layer at the app middleware level (defence in depth).
  • Secret env var values are automatically redacted (••••••••) on the Config page.
  • Addon event Detail fields are displayed as-is — addons must not put sensitive data in events.

🤚 CI/CD and releases

Every PR runs go test -race ./... and go vet ./... via the reusable pipeline in ss-pipeline. Releases are created automatically by release-please on every merge to main.


💡 Recommendations

  • Disable in production — set KEEL_PANEL_ENABLED=false or Enabled: false in all production environments.
  • Protect with a secret — set KEEL_PANEL_SECRET to a strong random token and serve the app over HTTPS whenever the panel is enabled.
  • Register your addons — any addon implementing contracts.Debuggable can self-register with the panel to stream live events; addons implementing contracts.Manifestable also appear in the Config tab.

Contributing

See CONTRIBUTING.md for local setup. The base workflow, commit conventions, and community standards live in ss-community.

Community

Document
CONTRIBUTING.md Workflow, commit conventions, and PR guidelines
GOVERNANCE.md Decision-making, roles, and release process
CODE_OF_CONDUCT.md Community standards
VERSIONING.md SemVer policy and breaking changes
SECURITY.md How to report vulnerabilities

License

MIT License — see LICENSE for details.

Links


Made by SliceSoft — Colombia

About

Official dev panel addon for Keel — real-time observability UI for development

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors