mirror of
https://ghproxy.com/https://github.com/truecharts/charts.git
synced 2026-02-11 03:44:59 +08:00
32 lines
847 B
Go
32 lines
847 B
Go
package cmd
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/rs/zerolog/log"
|
|
"github.com/spf13/cobra"
|
|
"github.com/truecharts/public/clustertool/pkg/sops"
|
|
)
|
|
|
|
var decryptLongHelp = strings.TrimSpace(`
|
|
The decryption feature of ClusterTool goes over all config files and, if encrypted, checks if ".sops.yaml" specifies that they should be decrypted.
|
|
If so, they are decrypted using your "age.agekey" file as specified in ".sops.yaml".
|
|
|
|
`)
|
|
|
|
var decrypt = &cobra.Command{
|
|
Use: "decrypt",
|
|
Short: "Decrypt all high-risk data using sops",
|
|
Example: "clustertool decrypt",
|
|
Long: decryptLongHelp,
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
if err := sops.DecryptFiles(); err != nil {
|
|
log.Info().Msgf("Error decrypting files: %v\n", err)
|
|
}
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
RootCmd.AddCommand(decrypt)
|
|
}
|