Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize skywire directories #478

Merged
merged 12 commits into from
Sep 25, 2020
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
}