diff --git a/alby/alby_oauth_service.go b/alby/alby_oauth_service.go index 747221de..c8543c76 100644 --- a/alby/alby_oauth_service.go +++ b/alby/alby_oauth_service.go @@ -794,6 +794,7 @@ func (svc *albyOAuthService) ConsumeEvent(ctx context.Context, event *events.Eve type channelsBackup struct { Description string `json:"description"` Data string `json:"data"` + NodePubkey string `json:"node_pubkey"` } func (svc *albyOAuthService) createEncryptedChannelBackup(event *events.StaticChannelsBackupEvent) (*channelsBackup, error) { @@ -818,6 +819,7 @@ func (svc *albyOAuthService) createEncryptedChannelBackup(event *events.StaticCh backup := &channelsBackup{ Description: "channels_v2", Data: encrypted, + NodePubkey: event.NodeID, } return backup, nil } diff --git a/api/api.go b/api/api.go index 329e9de4..b79deb3d 100644 --- a/api/api.go +++ b/api/api.go @@ -691,6 +691,7 @@ func (api *api) GetInfo(ctx context.Context) (*InfoResponse, error) { info.Version = version.Tag info.EnableAdvancedSetup = api.cfg.GetEnv().EnableAdvancedSetup info.LdkVssEnabled = ldkVssEnabled == "true" + info.VssSupported = backendType == config.LDKBackendType && api.cfg.GetEnv().LDKVssUrl != "" albyUserIdentifier, err := api.albyOAuthSvc.GetUserIdentifier() if err != nil { logger.Logger.WithError(err).Error("Failed to get alby user identifier") @@ -921,6 +922,10 @@ func (api *api) MigrateNodeStorage(ctx context.Context, to string) error { return errors.New("VSS already enabled") } + if api.cfg.GetEnv().LDKVssUrl == "" { + return errors.New("No VSS URL set") + } + api.cfg.SetUpdate("LdkVssEnabled", "true", "") api.cfg.SetUpdate("LdkMigrateStorage", "VSS", "") return api.Stop() diff --git a/api/models.go b/api/models.go index 21104165..401d360b 100644 --- a/api/models.go +++ b/api/models.go @@ -172,6 +172,7 @@ type InfoResponse struct { Network string `json:"network"` EnableAdvancedSetup bool `json:"enableAdvancedSetup"` LdkVssEnabled bool `json:"ldkVssEnabled"` + VssSupported bool `json:"vssSupported"` StartupError string `json:"startupError"` StartupErrorTime time.Time `json:"startupErrorTime"` } diff --git a/frontend/src/screens/settings/AlbyAccount.tsx b/frontend/src/screens/settings/AlbyAccount.tsx index faeeedc8..17c330ee 100644 --- a/frontend/src/screens/settings/AlbyAccount.tsx +++ b/frontend/src/screens/settings/AlbyAccount.tsx @@ -81,19 +81,19 @@ export function AlbyAccount() { -
- -

- Versioned Storage Service (VSS) provides a secure, encrypted server-side - storage of essential lightning and onchain data. -

-

- This service is enabled by your Alby account and provides additional - backup security which allows you to recover your lightning data with - your recovery phrase alone, without having to close your channels. -

- {info && ( + {info?.vssSupported && ( <> +
+ +

+ Versioned Storage Service (VSS) provides a secure, encrypted + server-side storage of essential lightning and onchain data. +

+

+ This service is enabled by your Alby account and provides additional + backup security which allows you to recover your lightning data with + your recovery phrase alone, without having to close your channels. +

{info.ldkVssEnabled && (

✅ VSS enabled.{" "} diff --git a/frontend/src/types.ts b/frontend/src/types.ts index 6c32822b..3a5f19f1 100644 --- a/frontend/src/types.ts +++ b/frontend/src/types.ts @@ -142,6 +142,7 @@ export interface InfoResponse { oauthRedirect: boolean; albyAccountConnected: boolean; ldkVssEnabled: boolean; + vssSupported: boolean; running: boolean; albyAuthUrl: string; nextBackupReminder: string;