feat: allow setting LDK node alias (#1398)

* feat: add node alias customization for LDK nodes with public channels

- Add new NodeAlias field to InfoResponse in API
- Add SetNodeAlias method to API with config storage
- Add HTTP endpoint POST /node/alias for setting node alias
- Add corresponding Wails endpoint support
- Create new Node settings page in frontend
- Add conditional navigation item for LDK nodes with public channels
- Include upgrade dialog and paid subscription check
- Display success message prompting node restart after alias change
- Show error toast for non-paid users attempting to change alias

* chore: use node alias from config in LDK init

* fix: make upgrade button non-absolute, remove disabled attribute

* chore: move node alias page to be consistent with other node management pages

* chore: remove redundant comment

* chore: show upgrade dialog when clicking node alias option, show also for private channels

---------

Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
This commit is contained in:
Freepilot 2025-06-18 13:33:14 +07:00 committed by GitHub
parent 4619781eaa
commit 8a0a432985
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 194 additions and 1 deletions

View file

@ -164,6 +164,7 @@ func (httpSvc *HttpService) RegisterSharedRoutes(e *echo.Echo) {
restrictedApiGroup.GET("/settings/swaps", httpSvc.getAutoSwapsConfigHandler)
restrictedApiGroup.POST("/settings/swaps", httpSvc.enableAutoSwapsHandler)
restrictedApiGroup.DELETE("/settings/swaps", httpSvc.disableAutoSwapsHandler)
restrictedApiGroup.POST("/node/alias", httpSvc.setNodeAliasHandler)
httpSvc.albyHttpSvc.RegisterSharedRoutes(restrictedApiGroup, e)
}
@ -1236,3 +1237,21 @@ func (httpSvc *HttpService) disableAutoSwapsHandler(c echo.Context) error {
return c.NoContent(http.StatusNoContent)
}
func (httpSvc *HttpService) setNodeAliasHandler(c echo.Context) error {
var setNodeAliasRequest api.SetNodeAliasRequest
if err := c.Bind(&setNodeAliasRequest); err != nil {
return c.JSON(http.StatusBadRequest, ErrorResponse{
Message: fmt.Sprintf("Bad request: %s", err.Error()),
})
}
err := httpSvc.api.SetNodeAlias(setNodeAliasRequest.NodeAlias)
if err != nil {
return c.JSON(http.StatusInternalServerError, ErrorResponse{
Message: fmt.Sprintf("Failed to set node alias: %s", err.Error()),
})
}
return c.NoContent(http.StatusNoContent)
}