From 38d49f43c9c9402b4f92411dd14ad879c969bd43 Mon Sep 17 00:00:00 2001 From: Natanael Rodriguez Ramos Date: Thu, 10 Apr 2025 17:12:06 +0100 Subject: [PATCH] Fixed SPN HUB using wrong instance --- base/config/get_test.go | 2 +- cmds/hub/build | 6 ++++++ cmds/hub/main.go | 3 ++- cmds/winkext-test/main.go | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/base/config/get_test.go b/base/config/get_test.go index d16b6c51..448983d7 100644 --- a/base/config/get_test.go +++ b/base/config/get_test.go @@ -55,7 +55,7 @@ func TestGet(t *testing.T) { //nolint:paralleltest // reset options = make(map[string]*Option) - err := log.Start() + err := log.Start("info", true, "") if err != nil { t.Fatal(err) } diff --git a/cmds/hub/build b/cmds/hub/build index c95f6e73..fbffc928 100755 --- a/cmds/hub/build +++ b/cmds/hub/build @@ -51,6 +51,12 @@ if [[ $1 == "dev" ]]; then DEV="-race" fi +# Set GOOS and GOARCH for Darwin to use Linux architecture +if [[ "$(uname)" == "Darwin" ]]; then + export GOOS=linux + export GOARCH=amd64 +fi + echo "Please notice, that this build script includes metadata into the build." echo "This information is useful for debugging and license compliance." echo "Run the compiled binary with the -version flag to see the information included." diff --git a/cmds/hub/main.go b/cmds/hub/main.go index 807d9290..3316b046 100644 --- a/cmds/hub/main.go +++ b/cmds/hub/main.go @@ -14,6 +14,7 @@ import ( "github.com/safing/portmaster/service" "github.com/safing/portmaster/service/configure" "github.com/safing/portmaster/service/updates" + "github.com/safing/portmaster/spn" "github.com/safing/portmaster/spn/conf" ) @@ -75,7 +76,7 @@ func initializeGlobals(cmd *cobra.Command, args []string) { // Configure service. cmdbase.SvcFactory = func(svcCfg *service.ServiceConfig) (cmdbase.ServiceInstance, error) { - svc, err := service.New(svcCfg) + svc, err := spn.New(svcCfg) return svc, err } diff --git a/cmds/winkext-test/main.go b/cmds/winkext-test/main.go index f67382b5..dd6c60f4 100644 --- a/cmds/winkext-test/main.go +++ b/cmds/winkext-test/main.go @@ -45,7 +45,7 @@ func main() { } // logging - err := log.Start() + err := log.Start("info", true, "") if err != nil { fmt.Printf("failed to start logging: %s\n", err) os.Exit(1)