Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ jobs:
- os: ubuntu-24.04
arch: arm64
target: linux
- os: macos-13
- os: macos-15
arch: amd64
target: darwin
- os: macos-14
- os: macos-15
arch: arm64
target: darwin

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ jobs:
- os: ubuntu-24.04
arch: arm64
target: linux
- os: macos-13
- os: macos-15
arch: amd64
target: darwin
- os: macos-14
- os: macos-15
arch: arm64
target: darwin

Expand Down
12 changes: 11 additions & 1 deletion plugin/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,23 @@ tasks:
cmds:
- cmd: ./build/deweb-plugin

build:
build-frontend:
dir: home
cmds:
- cmd: npm run build

build-backend:
cmds:
- task: build:internal
vars:
APP_NAME: plugin
BIN_DIR: build

build:
cmds:
- task: build-frontend
- task: build-backend

build:internal:
build:
desc: Internal build task
Expand Down
117 changes: 117 additions & 0 deletions plugin/api/models/network_info_item.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 15 additions & 49 deletions plugin/api/models/server_status.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions plugin/api/models/settings.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 17 additions & 8 deletions plugin/api/pluginAPI-V0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,22 @@ definitions:
required:
- code
- message

NetworkInfoItem:
type: object
description: Detailed network information
properties:
name:
type: string
url:
type: string
chainId:
type: integer
version:
type: string
status:
type: string
enum: [up, down]

ServerStatus:
type: object
Expand All @@ -114,14 +130,7 @@ definitions:
description: Error message if server failed to start or is in error state
network:
type: object
properties:
network:
type: string
version:
type: string
chainID:
type: integer
format: uint64
$ref: "#/definitions/NetworkInfoItem"

Settings:
type: object
Expand Down
4 changes: 3 additions & 1 deletion plugin/api/restapi/configure_deweb_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/massalabs/deweb-plugin/api/restapi/operations"
dewebmiddleware "github.com/massalabs/deweb-plugin/int/api/middleware"
)

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