joao/main.go

54 lines
1.6 KiB
Go
Raw Normal View History

// Copyright © 2022 Roberto Hidalgo <joao@un.rob.mx>
2022-12-31 06:14:08 +00:00
// SPDX-License-Identifier: Apache-2.0
package main
import (
2022-12-19 03:09:05 +00:00
"os"
"git.rob.mx/nidito/chinampa"
"git.rob.mx/nidito/chinampa/pkg/runtime"
2023-01-10 07:02:10 +00:00
"git.rob.mx/nidito/joao/cmd"
2022-12-20 05:49:37 +00:00
"git.rob.mx/nidito/joao/pkg/version"
"github.com/sirupsen/logrus"
)
func main() {
logrus.SetFormatter(&logrus.TextFormatter{
DisableLevelTruncation: true,
DisableTimestamp: true,
ForceColors: runtime.ColorEnabled(),
})
2022-12-19 03:09:05 +00:00
if runtime.DebugEnabled() {
logrus.SetLevel(logrus.DebugLevel)
logrus.Debug("Debugging enabled")
}
2023-01-11 06:57:58 +00:00
chinampa.Register(
cmd.Get,
cmd.Set,
cmd.Diff,
cmd.Fetch,
cmd.Flush,
cmd.Plugin,
)
chinampa.Register(cmd.GitFilters...)
2023-01-10 07:02:10 +00:00
2022-12-31 06:14:08 +00:00
if err := chinampa.Execute(chinampa.Config{
2023-01-10 07:02:10 +00:00
Name: "joao",
Summary: "A very WIP configuration manager",
Description: `joao makes yaml, json, 1Password and Hashicorp Vault play along nicely.
Keeps config entries encoded as YAML in the filesystem, backs it up to 1Password, and syncs scrubbed copies to git. Robots consume entries via 1Password Connect + Vault.
Schema for configuration and non-secret values live along the code, and are pushed to remote origins. Secrets can optionally and temporally be flushed to disk for editing or other sorts of operations. Git filters are available to prevent secrets from being pushed to remotes. Secrets are grouped into files, and every file gets its own 1Password item.
Secret values are specified using the !!secret YAML tag.
`,
Version: version.Version,
2022-12-31 06:14:08 +00:00
}); err != nil {
2022-12-20 05:49:37 +00:00
logrus.Errorf("total failure: %s", err)
2022-12-19 03:09:05 +00:00
os.Exit(2)
}
}