Other: Report corrupt and/or insecure vaults to sentry

This commit is contained in:
James Houlahan
2023-01-19 18:02:07 +01:00
parent d26a8319b6
commit 87abbe9396

View File

@ -206,6 +206,16 @@ func run(c *cli.Context) error { //nolint:funlen
return withSingleInstance(locations, version, func() error {
// Unlock the encrypted vault.
return WithVault(locations, func(vault *vault.Vault, insecure, corrupt bool) error {
// Report insecure vault.
if insecure {
_ = reporter.ReportMessageWithContext("Vault is insecure", map[string]interface{}{})
}
// Report corrupt vault.
if corrupt {
_ = reporter.ReportMessageWithContext("Vault is corrupt", map[string]interface{}{})
}
if !vault.Migrated() {
// Migrate old settings into the vault.
if err := migrateOldSettings(vault); err != nil {