Skip to content

Commit

Permalink
Merge pull request #478 from Darkren/feature/standartize-directories
Browse files Browse the repository at this point in the history
Standardize skywire directories
  • Loading branch information
jdknives authored Sep 25, 2020
2 parents cd07ed4 + 590c8d6 commit 391e516
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/skywire-visor/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func initConfig(mLog *logging.MasterLogger, args []string, confPath string) *vis
}

if confPath == "" {
confPath = defaultConfigName
confPath = "/opt/skywire/" + defaultConfigName
}

fallthrough
Expand Down
18 changes: 14 additions & 4 deletions pkg/skyenv/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ import (
"github.com/skycoin/dmsg/cipher"
)

// Constants for skywire root directories.
const (
DefaultSkywirePath = "/opt/skywire"
TestSkywirePath = "."
)

// Constants for default services.
const (
DefaultTpDiscAddr = "http://transport.discovery.skywire.skycoin.com"
Expand Down Expand Up @@ -44,7 +50,8 @@ const (

DefaultDmsgPtyCLINet = "unix"
DefaultDmsgPtyCLIAddr = "/tmp/dmsgpty.sock"
DefaultDmsgPtyWhitelist = "./dmsgpty/whitelist.json"
DefaultDmsgPtyWhitelist = DefaultSkywirePath + "/dmsgpty/whitelist.json"
TestDmsgPtyWhiteList = TestSkywirePath + "/dmsgpty/whitelist.json"
)

// Default STCP constants.
Expand Down Expand Up @@ -85,14 +92,17 @@ const (
const (
DefaultAppSrvAddr = "localhost:5505"
AppDiscUpdateInterval = 30 * time.Second
DefaultAppLocalPath = "./local"
DefaultAppBinPath = "./apps"
DefaultAppLocalPath = DefaultSkywirePath + "/local"
TestAppLocalPath = TestSkywirePath + "/local"
TestAppBinPath = TestSkywirePath + "/apps"
DefaultAppBinPath = DefaultSkywirePath + "/apps"
DefaultLogLevel = "info"
)

// Default routing constants
const (
DefaultTpLogStore = "./transport_logs"
DefaultTpLogStore = DefaultSkywirePath + "/transport_logs"
TestTpLogStore = TestSkywirePath + "/transport_logs"
)

// Default hypervisor constants
Expand Down
5 changes: 5 additions & 0 deletions pkg/visor/visorconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,10 @@ func MakeTestConfig(log *logging.MasterLogger, confPath string, sk *cipher.SecKe
conf.Hypervisor.DmsgDiscovery = conf.Transport.Discovery
}

conf.Dmsgpty.AuthFile = skyenv.TestDmsgPtyWhiteList
conf.Transport.LogStore.Location = skyenv.TestTpLogStore
conf.Launcher.LocalPath = skyenv.TestAppLocalPath
conf.Launcher.BinPath = skyenv.TestAppBinPath

return conf, nil
}

0 comments on commit 391e516

Please sign in to comment.