Skip to content

Commit e8d8276

Browse files
fleandreiCopilot
andauthored
deweb plugin use the node used by station (#342)
* deweb plugin use the node used by station * update pipeline macos-13 to macos-15 * copilote review * copilote review 2 * massa node name is now stored in cache because there is no node name in deweb server config * fix review and fix the issue when node not updated by station when initial config node is down * fix lint issue * Update plugin/api/restapi/configure_deweb_plugin.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 30a9774 commit e8d8276

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+883
-323
lines changed

.github/workflows/plugin.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ jobs:
6161
- os: ubuntu-24.04
6262
arch: arm64
6363
target: linux
64-
- os: macos-13
64+
- os: macos-15
6565
arch: amd64
6666
target: darwin
67-
- os: macos-14
67+
- os: macos-15
6868
arch: arm64
6969
target: darwin
7070

.github/workflows/server.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ jobs:
7575
- os: ubuntu-24.04
7676
arch: arm64
7777
target: linux
78-
- os: macos-13
78+
- os: macos-15
7979
arch: amd64
8080
target: darwin
81-
- os: macos-14
81+
- os: macos-15
8282
arch: arm64
8383
target: darwin
8484

plugin/Taskfile.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,23 @@ tasks:
2222
cmds:
2323
- cmd: ./build/deweb-plugin
2424

25-
build:
25+
build-frontend:
26+
dir: home
27+
cmds:
28+
- cmd: npm run build
29+
30+
build-backend:
2631
cmds:
2732
- task: build:internal
2833
vars:
2934
APP_NAME: plugin
3035
BIN_DIR: build
3136

37+
build:
38+
cmds:
39+
- task: build-frontend
40+
- task: build-backend
41+
3242
build:internal:
3343
build:
3444
desc: Internal build task

plugin/api/models/network_info_item.go

Lines changed: 117 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugin/api/models/server_status.go

Lines changed: 15 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugin/api/models/settings.go

Lines changed: 13 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugin/api/pluginAPI-V0.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,22 @@ definitions:
9898
required:
9999
- code
100100
- message
101+
102+
NetworkInfoItem:
103+
type: object
104+
description: Detailed network information
105+
properties:
106+
name:
107+
type: string
108+
url:
109+
type: string
110+
chainId:
111+
type: integer
112+
version:
113+
type: string
114+
status:
115+
type: string
116+
enum: [up, down]
101117

102118
ServerStatus:
103119
type: object
@@ -114,14 +130,7 @@ definitions:
114130
description: Error message if server failed to start or is in error state
115131
network:
116132
type: object
117-
properties:
118-
network:
119-
type: string
120-
version:
121-
type: string
122-
chainID:
123-
type: integer
124-
format: uint64
133+
$ref: "#/definitions/NetworkInfoItem"
125134

126135
Settings:
127136
type: object

plugin/api/restapi/configure_deweb_plugin.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/go-openapi/runtime"
1212
"github.com/go-openapi/runtime/middleware"
1313
"github.com/massalabs/deweb-plugin/api/restapi/operations"
14+
dewebmiddleware "github.com/massalabs/deweb-plugin/int/api/middleware"
1415
)
1516

1617
//go:generate swagger generate server --target ../../api --name DewebPlugin --spec ../pluginAPI-V0.yml --principal interface{} --exclude-main
@@ -104,5 +105,6 @@ func setupMiddlewares(handler http.Handler) http.Handler {
104105
// The middleware configuration happens before anything, this middleware also applies to serving the swagger.json document.
105106
// So this is a good place to plug in a panic handling middleware, logging and metrics.
106107
func setupGlobalMiddleware(handler http.Handler) http.Handler {
107-
return handler
108+
// Middleware chain: DomainRestrictionMiddleware → WebAppMiddleware → API handlers
109+
return dewebmiddleware.DomainRestrictionMiddleware(dewebmiddleware.WebAppMiddleware(handler))
108110
}

0 commit comments

Comments
 (0)