Skip to content

Commit e98f207

Browse files
authored
fix: only show vss info in alby account settings if vss is supported (#900)
1 parent 0325ad5 commit e98f207

File tree

5 files changed

+21
-12
lines changed

5 files changed

+21
-12
lines changed

alby/alby_oauth_service.go

+2
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,7 @@ func (svc *albyOAuthService) ConsumeEvent(ctx context.Context, event *events.Eve
794794
type channelsBackup struct {
795795
Description string `json:"description"`
796796
Data string `json:"data"`
797+
NodePubkey string `json:"node_pubkey"`
797798
}
798799

799800
func (svc *albyOAuthService) createEncryptedChannelBackup(event *events.StaticChannelsBackupEvent) (*channelsBackup, error) {
@@ -818,6 +819,7 @@ func (svc *albyOAuthService) createEncryptedChannelBackup(event *events.StaticCh
818819
backup := &channelsBackup{
819820
Description: "channels_v2",
820821
Data: encrypted,
822+
NodePubkey: event.NodeID,
821823
}
822824
return backup, nil
823825
}

api/api.go

+5
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,7 @@ func (api *api) GetInfo(ctx context.Context) (*InfoResponse, error) {
691691
info.Version = version.Tag
692692
info.EnableAdvancedSetup = api.cfg.GetEnv().EnableAdvancedSetup
693693
info.LdkVssEnabled = ldkVssEnabled == "true"
694+
info.VssSupported = backendType == config.LDKBackendType && api.cfg.GetEnv().LDKVssUrl != ""
694695
albyUserIdentifier, err := api.albyOAuthSvc.GetUserIdentifier()
695696
if err != nil {
696697
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 {
921922
return errors.New("VSS already enabled")
922923
}
923924

925+
if api.cfg.GetEnv().LDKVssUrl == "" {
926+
return errors.New("No VSS URL set")
927+
}
928+
924929
api.cfg.SetUpdate("LdkVssEnabled", "true", "")
925930
api.cfg.SetUpdate("LdkMigrateStorage", "VSS", "")
926931
return api.Stop()

api/models.go

+1
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ type InfoResponse struct {
172172
Network string `json:"network"`
173173
EnableAdvancedSetup bool `json:"enableAdvancedSetup"`
174174
LdkVssEnabled bool `json:"ldkVssEnabled"`
175+
VssSupported bool `json:"vssSupported"`
175176
StartupError string `json:"startupError"`
176177
StartupErrorTime time.Time `json:"startupErrorTime"`
177178
}

frontend/src/screens/settings/AlbyAccount.tsx

+12-12
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,19 @@ export function AlbyAccount() {
8181
</CardHeader>
8282
</Card>
8383
</UnlinkAlbyAccount>
84-
<div /* spacing */ />
85-
<SettingsHeader title="VSS" description="Versioned Storage Service" />
86-
<p>
87-
Versioned Storage Service (VSS) provides a secure, encrypted server-side
88-
storage of essential lightning and onchain data.
89-
</p>
90-
<p>
91-
This service is enabled by your Alby account and provides additional
92-
backup security which allows you to recover your lightning data with
93-
your recovery phrase alone, without having to close your channels.
94-
</p>
95-
{info && (
84+
{info?.vssSupported && (
9685
<>
86+
<div /* spacing */ />
87+
<SettingsHeader title="VSS" description="Versioned Storage Service" />
88+
<p>
89+
Versioned Storage Service (VSS) provides a secure, encrypted
90+
server-side storage of essential lightning and onchain data.
91+
</p>
92+
<p>
93+
This service is enabled by your Alby account and provides additional
94+
backup security which allows you to recover your lightning data with
95+
your recovery phrase alone, without having to close your channels.
96+
</p>
9797
{info.ldkVssEnabled && (
9898
<p>
9999
✅ VSS <b>enabled</b>.{" "}

frontend/src/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ export interface InfoResponse {
142142
oauthRedirect: boolean;
143143
albyAccountConnected: boolean;
144144
ldkVssEnabled: boolean;
145+
vssSupported: boolean;
145146
running: boolean;
146147
albyAuthUrl: string;
147148
nextBackupReminder: string;

0 commit comments

Comments
 (0)