twitch-bot/cli_resetSecrets.go
Knut Ahlers d8c6f8d221
[core] Split out cli commands
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2023-03-24 21:41:38 +01:00

26 lines
653 B
Go

package main
import (
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
)
func init() {
cli.Add(cliRegistryEntry{
Name: "reset-secrets",
Description: "Remove encrypted data to reset encryption passphrase",
Run: func(args []string) error {
if err := accessService.RemoveAllExtendedTwitchCredentials(); err != nil {
return errors.Wrap(err, "resetting Twitch credentials")
}
log.Info("removed stored Twitch credentials")
if err := db.ResetEncryptedCoreMeta(); err != nil {
return errors.Wrap(err, "resetting encrypted meta entries")
}
log.Info("removed encrypted meta entries")
return nil
},
})
}