Skip to content
This repository has been archived by the owner on Feb 26, 2023. It is now read-only.

Commit

Permalink
refactor: Adapt to merged repos
Browse files Browse the repository at this point in the history
  • Loading branch information
pojntfx committed Mar 12, 2021
1 parent e0ef6fd commit a3b59f8
Show file tree
Hide file tree
Showing 13 changed files with 292 additions and 73 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
all: build

backend:
go build -o out/liwasc cmd/liwasc-backend/main.go
go build -o out/backend/liwasc cmd/liwasc-backend/main.go

wasm:
GOARCH=wasm GOOS=js go build -o web/app.wasm cmd/liwasc-frontend/main.go

site: wasm
rm -rf out
rm -rf out/frontend
go run cmd/liwasc-frontend-builder/main.go -build
cp -r web/* out/web
cp -r web/* out/frontend

build: wasm site backend

run-backend:
sudo out/liwasc -oidcIssuer=${OIDCISSUER} -oidcClientID=${OIDCCLIENTID} -deviceName=${DEVICENAME}
sudo out/backend/liwasc -oidcIssuer=${OIDCISSUER} -oidcClientID=${OIDCCLIENTID} -deviceName=${DEVICENAME}

serve: wasm
run-frontend: wasm
go run cmd/liwasc-frontend-builder/main.go -serve

generate:
Expand All @@ -37,5 +37,5 @@ deps:
sudo curl -L -o /etc/liwasc/service-names-port-numbers.csv https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.csv
sudo curl -L -o /etc/liwasc/ports2packets.csv https://github.com/pojntfx/ports2packets/releases/download/weekly-csv/ports2packets.csv
sudo mkdir -p /var/liwasc
sudo sqlite3 -batch /var/liwasc/node_and_port_scan.sqlite ".read ./pkg/sql/node_and_port_scan.sql"
sudo sqlite3 -batch /var/liwasc/node_wake.sqlite ".read ./pkg/sql/node_wake.sql"
sudo sqlite3 -batch /var/liwasc/node_and_port_scan.sqlite ".read pkg/sql/node_and_port_scan.sql"
sudo sqlite3 -batch /var/liwasc/node_wake.sqlite ".read pkg/sql/node_wake.sql"
2 changes: 1 addition & 1 deletion cmd/liwasc-frontend-builder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
func main() {
// Parse the flags
build := flag.Bool("build", false, "Create static build")
out := flag.String("out", "out", "Out directory for static build")
out := flag.String("out", "out/frontend", "Out directory for static build")
path := flag.String("path", "", "Base path for static build")
serve := flag.Bool("serve", false, "Build and serve the frontend")
laddr := flag.String("laddr", "localhost:15125", "Address to serve the frontend on")
Expand Down
4 changes: 2 additions & 2 deletions cmd/liwasc-frontend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (

"github.com/maxence-charriere/go-app/v7/pkg/app"
"github.com/pojntfx/go-app-grpc-chat-frontend-web/pkg/websocketproxy"
components "github.com/pojntfx/liwasc-frontend/pkg/components"
proto "github.com/pojntfx/liwasc-frontend/pkg/proto/generated"
components "github.com/pojntfx/liwasc/pkg/components"
proto "github.com/pojntfx/liwasc/pkg/proto/generated"
"google.golang.org/grpc"
"google.golang.org/grpc/metadata"
)
Expand Down
17 changes: 5 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,26 @@ module github.com/pojntfx/liwasc
go 1.16

require (
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/coreos/go-oidc/v3 v3.0.0
github.com/friendsofgo/errors v0.9.2
github.com/golang/protobuf v1.4.3
github.com/google/gopacket v1.1.19
github.com/j-keck/arping v1.0.1
github.com/jszwec/csvutil v1.5.0
github.com/kataras/compress v0.0.6
github.com/mattn/go-sqlite3 v1.14.6
github.com/maxence-charriere/go-app/v7 v7.3.0
github.com/mdlayher/wol v0.0.0-20200423173749-bc23029f94e1
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2
github.com/pojntfx/go-app-grpc-chat-backend v0.0.0-20200914214506-117c1d64fa06
github.com/pquerna/cachecontrol v0.0.0-20201205024021-ac21108117ac // indirect
github.com/pojntfx/go-app-grpc-chat-frontend-web v0.0.0-20200914214440-b28bb959fef9
github.com/robfig/cron/v3 v3.0.1
github.com/tevino/tcp-shaker v0.0.0-20191112104505-00eab0aefc80
github.com/ugjka/messenger v1.1.3
github.com/volatiletech/null/v8 v8.1.2
github.com/volatiletech/sqlboiler/v4 v4.4.0
github.com/volatiletech/strmangle v0.0.1
google.golang.org/grpc v1.36.0
google.golang.org/protobuf v1.25.0
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
github.com/coreos/go-oidc/v3 v3.0.0
github.com/golang/protobuf v1.4.3
github.com/kataras/compress v0.0.6
github.com/maxence-charriere/go-app/v7 v7.3.0
github.com/pojntfx/go-app-grpc-chat-frontend-web v0.0.0-20200914214440-b28bb959fef9
github.com/pquerna/cachecontrol v0.0.0-20201205024021-ac21108117ac // indirect
golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93
golang.org/x/oauth2 v0.0.0-20210311163135-5366d9dc1934
google.golang.org/grpc v1.36.0
google.golang.org/protobuf v1.25.0
)
310 changes: 268 additions & 42 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/components/data_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"

"github.com/maxence-charriere/go-app/v7/pkg/app"
proto "github.com/pojntfx/liwasc-frontend/pkg/proto/generated"
proto "github.com/pojntfx/liwasc/pkg/proto/generated"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/emptypb"
Expand Down
2 changes: 1 addition & 1 deletion pkg/legacy/components/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

"github.com/maxence-charriere/go-app/v7/pkg/app"
"github.com/pojntfx/liwasc-frontend/pkg/legacy/models"
"github.com/pojntfx/liwasc/pkg/legacy/models"
)

type AppComponent struct {
Expand Down
4 changes: 2 additions & 2 deletions pkg/legacy/components/data_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"sync"

"github.com/maxence-charriere/go-app/v7/pkg/app"
"github.com/pojntfx/liwasc-frontend/pkg/legacy/models"
proto "github.com/pojntfx/liwasc-frontend/pkg/proto/generated"
"github.com/pojntfx/liwasc/pkg/legacy/models"
proto "github.com/pojntfx/liwasc/pkg/proto/generated"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
Expand Down
2 changes: 1 addition & 1 deletion pkg/legacy/components/node_inspector.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

"github.com/maxence-charriere/go-app/v7/pkg/app"
"github.com/pojntfx/liwasc-frontend/pkg/legacy/models"
"github.com/pojntfx/liwasc/pkg/legacy/models"
)

type NodeInspectorComponent struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/legacy/components/oidc_login_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"log"
"time"

"github.com/coreos/go-oidc"
"github.com/coreos/go-oidc/v3/oidc"
"github.com/maxence-charriere/go-app/v7/pkg/app"
"golang.org/x/oauth2"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/legacy/components/service_inspector.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

"github.com/maxence-charriere/go-app/v7/pkg/app"
"github.com/pojntfx/liwasc-frontend/pkg/legacy/models"
"github.com/pojntfx/liwasc/pkg/legacy/models"
)

type ServiceInspectorComponent struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/legacy/components/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

"github.com/maxence-charriere/go-app/v7/pkg/app"
"github.com/pojntfx/liwasc-frontend/pkg/legacy/models"
"github.com/pojntfx/liwasc/pkg/legacy/models"
)

type TableComponent struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/validators/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package validators
import (
"context"

"github.com/coreos/go-oidc"
"github.com/coreos/go-oidc/v3/oidc"
)

type OIDCValidator struct {
Expand Down

0 comments on commit a3b59f8

Please sign in to comment.