Appearance
Keel
Keel is a set of small shared Go libraries for self-hosted tools. It holds the plumbing and no product logic.
Ballast is built on these packages. Each one can be used on its own.
Packages
Each package name links to its API documentation on pkg.go.dev.
| Package | Purpose |
|---|---|
secret | Keeps a set of secret values and removes them from logs, errors and API responses. |
runner | Runs external commands with pipefail behaviour, SIGPIPE handling, cancellation and redacted error output. It never starts a shell. |
dockerhost | Describes local, SSH and TLS Docker hosts and builds docker commands with each host's connection flags. Lists Compose projects and volumes. |
sshkey | Checks that an SSH private key is complete and has no passphrase, so a program can use it unattended. |
proxmox | Talks to one Proxmox VE host's API with an API token. Lists VMs and LXC containers and reads or changes the Proxmox firewall. |
notify | Sends notifications through ntfy, a webhook, Discord, Slack or email. Channel secrets are never logged. |
Install
sh
go get github.com/springledev/keel@latestImport only the packages you need. Pin a tagged version in go.mod rather than tracking the latest commit.
To work on Keel and a program that uses it at the same time, run go work init . ../keel in that program's checkout and keep go.work out of git. Do not add a replace directive: a fresh clone should build without Keel checked out next to it.
Example
This runs echo and removes a secret from a line of text. The secret is a placeholder value.
go
package main
import (
"context"
"fmt"
"github.com/springledev/keel/runner"
"github.com/springledev/keel/secret"
)
func main() {
secrets := secret.NewSet("example-password")
r := &runner.Runner{Redact: secrets}
res, err := r.Run(context.Background(), nil, nil, runner.Command{
Name: "echo",
Args: []string{"hello"},
})
if err != nil {
fmt.Println("command failed:", err)
return
}
fmt.Print(string(res.Stdout))
fmt.Println(secrets.Redact("password: example-password"))
}It prints hello, then password: [redacted].
Stability
Keel is pre-1.0. The API may change between tags. Each release lists its changes, including breaking ones, in the CHANGELOG.
Source and licence
Source and issues are on GitHub. Keel is licensed under Apache-2.0. If it is useful to you, you can sponsor the work on GitHub.