diff --git a/frontend/pages/MetadataBackupPage.tsx b/frontend/pages/MetadataBackupPage.tsx index 9764c7b..4f9ea87 100644 --- a/frontend/pages/MetadataBackupPage.tsx +++ b/frontend/pages/MetadataBackupPage.tsx @@ -6,6 +6,7 @@ import { Panel, tableClassStripedHover } from 'f61ui/component/bootstrap'; import { bytesToHumanReadable } from 'f61ui/component/bytesformatter'; import { CommandButton, CommandIcon } from 'f61ui/component/CommandButton'; import { Dropdown } from 'f61ui/component/dropdown'; +import { Info } from 'f61ui/component/info'; import { MonospaceContent } from 'f61ui/component/monospacecontent'; import { SecretReveal } from 'f61ui/component/secretreveal'; import { Timestamp } from 'f61ui/component/timestamp'; @@ -108,7 +109,8 @@ export default class MetadataBackupPage extends React.Component< accessKeySecret, encryptionPublicKey, alertmanagerBaseUrl, - ] = backupConfig.Value ? JSON.parse(backupConfig.Value) : ['', '', '', '', '', '']; + encryptionPrivateKeyStorageLocationDescription, + ] = backupConfig.Value ? JSON.parse(backupConfig.Value) : ['', '', '', '', '', '', '']; return ( - EncryptionPublicKey + + EncryptionPublicKey + {encryptionPrivateKeyStorageLocationDescription ? ( + + ) : null} + {encryptionPublicKey} diff --git a/pkg/stoserver/backupcommandhandler.go b/pkg/stoserver/backupcommandhandler.go index 2e83d6e..1c7cd6f 100644 --- a/pkg/stoserver/backupcommandhandler.go +++ b/pkg/stoserver/backupcommandhandler.go @@ -36,6 +36,7 @@ func (c *cHandlers) DatabaseBackupConfigure(cmd *stoservertypes.DatabaseBackupCo cmd.AccessKeySecret, cmd.EncryptionPublicKey, cmd.AlertmanagerBaseUrl, + cmd.EncryptionPrivateKeyStorageLocationDescription, }) if err != nil { return err @@ -107,8 +108,9 @@ func parseSerializedUbConfig(serializedUbConfig []byte) (*ubconfig.Config, error return nil, err } - if len(parts) != 6 { - return nil, fmt.Errorf("unexpected number of parts: %d", len(parts)) + // encryptionPrivateKeyStorageLocationDescription was added later (though not used in backend so it's not read here) + if partCount := len(parts); partCount != 6 && partCount != 7 { + return nil, fmt.Errorf("unexpected number of parts: %d", partCount) } return &ubconfig.Config{ diff --git a/pkg/stoserver/stoservertypes/commands.json b/pkg/stoserver/stoservertypes/commands.json index a8e972f..032bdcf 100644 --- a/pkg/stoserver/stoservertypes/commands.json +++ b/pkg/stoserver/stoservertypes/commands.json @@ -703,6 +703,7 @@ { "key": "AccessKeyId", "title": "Access Key ID", "placeholder": "AKIAIOSFODNN7EXAMPLE" }, { "key": "AccessKeySecret", "title": "Secret Access Key", "placeholder": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" }, { "key": "EncryptionPublicKey", "title": "µbackup encryption public key", "type": "multiline", "placeholder": "-----BEGIN RSA PUBLIC KEY-----\nMIIBCgKCAQEA+xGZ/wcz9ugFpP07Nspo6U17l0YhFiFpxxU4pTk3Lifz9R3zsIsu\n..." }, + { "key": "EncryptionPrivateKeyStorageLocationDescription", "title": "µbackup encryption private key storage location description", "placeholder": "In password manager with title ...", "help": "In case you forget where this is stored (the backups are useless without the key).", "optional": true }, { "key": "AlertmanagerBaseUrl", "title": "AlertManager API URL", "placeholder": "https://abcdefghij.execute-api.us-east-1.amazonaws.com/prod", "help": "Only used if you're using lambda-alertmanager", "optional": true }, { "key": "ConnectivityCheck", "title": "Perform connectivity check", "type": "checkbox", "help": "Try to connect to S3 to validate connection details" } ]