diff --git a/cmd/skywire-visor/commands/root.go b/cmd/skywire-visor/commands/root.go index 68ac9de15b..739f510175 100644 --- a/cmd/skywire-visor/commands/root.go +++ b/cmd/skywire-visor/commands/root.go @@ -207,7 +207,7 @@ func initConfig(mLog *logging.MasterLogger, args []string, confPath string) *vis } if confPath == "" { - confPath = defaultConfigName + confPath = "/opt/skywire/" + defaultConfigName } fallthrough diff --git a/pkg/skyenv/values.go b/pkg/skyenv/values.go index 7ab0d361d8..77c16bd20e 100644 --- a/pkg/skyenv/values.go +++ b/pkg/skyenv/values.go @@ -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" @@ -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. @@ -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 diff --git a/pkg/visor/visorconfig/config.go b/pkg/visor/visorconfig/config.go index 33778c5c16..4f08bca047 100644 --- a/pkg/visor/visorconfig/config.go +++ b/pkg/visor/visorconfig/config.go @@ -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 }