2023-03-24 20:41:38 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2024-06-09 10:44:41 +00:00
|
|
|
"github.com/Luzifer/go_helpers/v2/cli"
|
2023-03-24 20:41:38 +00:00
|
|
|
"github.com/pkg/errors"
|
|
|
|
log "github.com/sirupsen/logrus"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
2024-06-09 10:44:41 +00:00
|
|
|
cliTool.Add(cli.RegistryEntry{
|
2023-03-24 20:41:38 +00:00
|
|
|
Name: "reset-secrets",
|
|
|
|
Description: "Remove encrypted data to reset encryption passphrase",
|
2024-02-18 12:42:00 +00:00
|
|
|
Run: func([]string) error {
|
2023-03-24 20:41:38 +00:00
|
|
|
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
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|