diff --git a/go.mod b/go.mod index 6a5f4d53..36ae1bda 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/rs/cors v1.8.2 github.com/sirupsen/logrus v1.9.3 github.com/skycoin/dmsg v1.3.26-0.20240910062314-dc25f3d9ea6c - github.com/skycoin/skywire v1.3.25-beta + github.com/skycoin/skywire v1.3.26-0.20240922162315-789cef41c9a1 github.com/skycoin/skywire-utilities v1.3.25 github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8 github.com/spf13/cobra v1.7.0 diff --git a/go.sum b/go.sum index 58b6dad9..a634fa6b 100644 --- a/go.sum +++ b/go.sum @@ -397,8 +397,8 @@ github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6 h1:1Nc5EBY6pjfw1kwW0 github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:UXghlricA7J3aRD/k7p/zBObQfmBawwCxIVPVjz2Q3o= github.com/skycoin/skycoin v0.27.1 h1:HatxsRwVSPaV4qxH6290xPBmkH/HgiuAoY2qC+e8C9I= github.com/skycoin/skycoin v0.27.1/go.mod h1:78nHjQzd8KG0jJJVL/j0xMmrihXi70ti63fh8vXScJw= -github.com/skycoin/skywire v1.3.25-beta h1:F3oDF36CaK3YAFogl2/jNkAqJWHaJP4HVBVFRpP72BU= -github.com/skycoin/skywire v1.3.25-beta/go.mod h1:TAUZX3dAcvsJhblLMuwZ1MjmIJL85He73MZdKT95Qv4= +github.com/skycoin/skywire v1.3.26-0.20240922162315-789cef41c9a1 h1:3OFs/rnlDZYmhRGOEZq0wZk1LC45/UZTRpFXVDJ2lSA= +github.com/skycoin/skywire v1.3.26-0.20240922162315-789cef41c9a1/go.mod h1:jsyaaHXEIEDcbTcceUTIi23BZAYXqBDhk/tjRnfCUs4= github.com/skycoin/skywire-utilities v1.3.25 h1:mk8dUonFdhVopFF3d9wbOyXXoiuAO+mN1y+ve6SzgX4= github.com/skycoin/skywire-utilities v1.3.25/go.mod h1:yFKWpL1bDRPKU3uK+cTF4PnYUMe+eyIj5N2bk4sF5Cw= github.com/skycoin/systray v1.10.0 h1:fQZJHMylpVvfmOOTLvUssfyHVDoC8Idx6Ba2BlLEuGg= diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsg/const.go b/vendor/github.com/skycoin/dmsg/pkg/dmsg/const.go index acb3d8c9..2718c8c2 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsg/const.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsg/const.go @@ -3,13 +3,13 @@ package dmsg import ( "time" - "encoding/json" - "github.com/skycoin/skywire" + + "github.com/skycoin/skywire-utilities/pkg/skyenv" ) // Constants. const ( - + DefaultDiscAddr = skyenv.DmsgDiscAddr DefaultMinSessions = 1 @@ -23,20 +23,3 @@ const ( DefaultCommunityDmsgServerType = "community" ) - -func DmsgDiscAddr(testenv bool) string { - var envServices skywire.EnvServices - var services skywire.Services - if err := json.Unmarshal([]byte(skywire.ServicesJSON), &envServices); err == nil { - if testenv { - if err := json.Unmarshal(envServices.Prod, &services); err == nil { - return services.DmsgDiscovery - } - } else { - if err := json.Unmarshal(envServices.Test, &services); err == nil { - return services.DmsgDiscovery - } - } - } - return "" -} diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsgcurl/flags.go b/vendor/github.com/skycoin/dmsg/pkg/dmsgcurl/flags.go index 7ae14a91..4f07c228 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsgcurl/flags.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsgcurl/flags.go @@ -3,12 +3,9 @@ package dmsgcurl import ( "flag" - "encoding/json" - - - "github.com/skycoin/skywire" "github.com/skycoin/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire-utilities/pkg/skyenv" ) // ExecName contains the execution name. @@ -42,14 +39,7 @@ type dmsgFlags struct { func (f *dmsgFlags) Name() string { return "Dmsg" } func (f *dmsgFlags) Init(fs *flag.FlagSet) { - var envServices skywire.EnvServices - var services skywire.Services - if err := json.Unmarshal([]byte(skywire.ServicesJSON), &envServices); err == nil { - if err := json.Unmarshal(envServices.Prod, &services); err == nil { - f.Disc = services.DmsgDiscovery - } - } - fs.StringVar(&f.Disc, "dmsg-disc", f.Disc, "dmsg discovery `URL`") + fs.StringVar(&f.Disc, "dmsg-disc", skyenv.DmsgDiscAddr, "dmsg discovery `URL`") fs.IntVar(&f.Sessions, "dmsg-sessions", 1, "connect to `NUMBER` of dmsg servers") } diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/conf.go b/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/conf.go index 1c9d7809..1fda2d47 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/conf.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/conf.go @@ -26,7 +26,7 @@ type Config struct { // DefaultConfig is used to populate the config struct with its default values func DefaultConfig() Config { return Config{ - DmsgDisc: dmsg.DmsgDiscAddr(false), + DmsgDisc: dmsg.DefaultDiscAddr, DmsgSessions: dmsg.DefaultMinSessions, DmsgPort: DefaultPort, CLINet: DefaultCLINet, diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsgserver/config.go b/vendor/github.com/skycoin/dmsg/pkg/dmsgserver/config.go index 970ca3ff..27c3fb2e 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsgserver/config.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsgserver/config.go @@ -8,19 +8,19 @@ import ( "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/dmsg/pkg/dmsg" + "github.com/skycoin/skywire-utilities/pkg/skyenv" ) const ( + defaultDiscoveryURL = skyenv.DmsgDiscAddr defaultPublicAddress = "127.0.0.1:8081" defaultLocalAddress = ":8081" defaultHTTPAddress = ":8082" // DefaultConfigPath default path of config file DefaultConfigPath = "config.json" // DefaultDiscoverURLTest default URL for discovery in test env + DefaultDiscoverURLTest = skyenv.TestDmsgDiscAddr ) -var defaultDiscoveryURL = dmsg.DmsgDiscAddr(false) -var DefaultDiscoverURLTest = dmsg.DmsgDiscAddr(true) // Config is structure of config file type Config struct { diff --git a/vendor/github.com/skycoin/skywire/pkg/app/appdisc/factory.go b/vendor/github.com/skycoin/skywire/pkg/app/appdisc/factory.go index f698347a..9ac8548f 100644 --- a/vendor/github.com/skycoin/skywire/pkg/app/appdisc/factory.go +++ b/vendor/github.com/skycoin/skywire/pkg/app/appdisc/factory.go @@ -2,14 +2,13 @@ package appdisc import ( - "encoding/json" "net/http" "github.com/sirupsen/logrus" "github.com/skycoin/skywire-utilities/pkg/cipher" "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire" + utilenv "github.com/skycoin/skywire-utilities/pkg/skyenv" "github.com/skycoin/skywire/pkg/app/appcommon" "github.com/skycoin/skywire/pkg/servicedisc" "github.com/skycoin/skywire/pkg/skyenv" @@ -32,15 +31,7 @@ func (f *Factory) setDefaults() { f.Log = logging.MustGetLogger("appdisc") } if f.ServiceDisc == "" { - var envServices skywire.EnvServices - var services skywire.Services - var sdURL string - if err := json.Unmarshal([]byte(skywire.ServicesJSON), &envServices); err == nil { - if err := json.Unmarshal(envServices.Prod, &services); err == nil { - sdURL = services.ServiceDiscovery - } - } - f.ServiceDisc = sdURL + f.ServiceDisc = utilenv.ServiceDiscAddr } } diff --git a/vendor/github.com/skycoin/skywire/pkg/visor/init.go b/vendor/github.com/skycoin/skywire/pkg/visor/init.go index 3eb1dee5..4f341c1b 100644 --- a/vendor/github.com/skycoin/skywire/pkg/visor/init.go +++ b/vendor/github.com/skycoin/skywire/pkg/visor/init.go @@ -33,7 +33,7 @@ import ( "github.com/skycoin/skywire-utilities/pkg/cipher" "github.com/skycoin/skywire-utilities/pkg/logging" "github.com/skycoin/skywire-utilities/pkg/netutil" - "github.com/skycoin/skywire" + utilenv "github.com/skycoin/skywire-utilities/pkg/skyenv" "github.com/skycoin/skywire/internal/vpn" "github.com/skycoin/skywire/pkg/app/appdisc" "github.com/skycoin/skywire/pkg/app/appevent" @@ -1516,15 +1516,8 @@ func initPublicAutoconnect(ctx context.Context, v *Visor, log *logging.Logger) e return nil } serviceDisc := v.conf.Launcher.ServiceDisc - if serviceDisc == "" { //it might be intentionally blank ; consider revising. - var envServices skywire.EnvServices - var services skywire.Services - var sdURL string - if err := json.Unmarshal([]byte(skywire.ServicesJSON), &envServices); err == nil { - if err := json.Unmarshal(envServices.Prod, &services); err == nil { - serviceDisc = services.ServiceDiscovery - } - } + if serviceDisc == "" { + serviceDisc = utilenv.ServiceDiscAddr } // todo: refactor updatedisc: split connecting to services in updatedisc and diff --git a/vendor/github.com/skycoin/skywire/pkg/visor/visorconfig/config.go b/vendor/github.com/skycoin/skywire/pkg/visor/visorconfig/config.go index e52238c5..d4565960 100644 --- a/vendor/github.com/skycoin/skywire/pkg/visor/visorconfig/config.go +++ b/vendor/github.com/skycoin/skywire/pkg/visor/visorconfig/config.go @@ -13,8 +13,8 @@ import ( "github.com/skycoin/skywire-utilities/pkg/cipher" "github.com/skycoin/skywire-utilities/pkg/logging" + utilenv "github.com/skycoin/skywire-utilities/pkg/skyenv" "github.com/skycoin/skywire/pkg/app/appserver" - "github.com/skycoin/skywire" "github.com/skycoin/skywire/pkg/dmsgc" "github.com/skycoin/skywire/pkg/routing" "github.com/skycoin/skywire/pkg/skyenv" @@ -25,20 +25,34 @@ import ( // This is used as default values if no config is given, or for missing *required* fields. // This function always returns the latest config version. func MakeBaseConfig(common *Common, testEnv bool, dmsgHTTP bool, services *Services, dmsgHTTPServersList *DmsgHTTPServers) *V1 { - //check if any services were passed if services == nil { - var envServices skywire.EnvServices - if err := json.Unmarshal([]byte(skywire.ServicesJSON), &envServices); err != nil { - return nil - } + //fall back on defaults if !testEnv { - if err := json.Unmarshal(envServices.Prod, &services); err != nil { - return nil + services = &Services{ + DmsgDiscovery: utilenv.DmsgDiscAddr, + TransportDiscovery: utilenv.TpDiscAddr, + AddressResolver: utilenv.AddressResolverAddr, + RouteFinder: utilenv.RouteFinderAddr, + RouteSetupNodes: MustPKs(utilenv.RouteSetupPKs), + TransportSetupPKs: MustPKs(utilenv.TPSetupPKs), + UptimeTracker: utilenv.UptimeTrackerAddr, + ServiceDiscovery: utilenv.ServiceDiscAddr, + StunServers: utilenv.GetStunServers(), + DNSServer: utilenv.DNSServer, } } else { - if err := json.Unmarshal(envServices.Test, &services); err != nil { - return nil + services = &Services{ + DmsgDiscovery: utilenv.TestDmsgDiscAddr, + TransportDiscovery: utilenv.TestTpDiscAddr, + AddressResolver: utilenv.TestAddressResolverAddr, + RouteFinder: utilenv.TestRouteFinderAddr, + RouteSetupNodes: MustPKs(utilenv.TestRouteSetupPKs), + TransportSetupPKs: MustPKs(utilenv.TestTPSetupPKs), + UptimeTracker: utilenv.TestUptimeTrackerAddr, + ServiceDiscovery: utilenv.TestServiceDiscAddr, + StunServers: utilenv.GetStunServers(), + DNSServer: utilenv.DNSServer, } } } @@ -47,14 +61,14 @@ func MakeBaseConfig(common *Common, testEnv bool, dmsgHTTP bool, services *Servi conf.Common = common } conf.Dmsg = &dmsgc.DmsgConfig{ - Discovery: services.DmsgDiscovery, + Discovery: services.DmsgDiscovery, //utilenv.DmsgDiscAddr, SessionsCount: 1, Servers: []*disc.Entry{}, ConnectedServersType: "all", } conf.Transport = &Transport{ - Discovery: services.TransportDiscovery, - AddressResolver: services.AddressResolver, + Discovery: services.TransportDiscovery, //utilenv.TpDiscAddr, + AddressResolver: services.AddressResolver, //utilenv.AddressResolverAddr, PublicAutoconnect: PublicAutoconnect, LogStore: &LogStore{ Type: FileLogStore, @@ -65,25 +79,25 @@ func MakeBaseConfig(common *Common, testEnv bool, dmsgHTTP bool, services *Servi StcprPort: 0, } conf.Routing = &Routing{ - RouteFinder: services.RouteFinder, - RouteSetupNodes: services.RouteSetupNodes, + RouteFinder: services.RouteFinder, //utilenv.RouteFinderAddr, + RouteSetupNodes: services.RouteSetupNodes, //[]cipher.PubKey{utilenv.MustPK(utilenv.SetupPK)}, RouteFinderTimeout: DefaultTimeout, } conf.Launcher = &Launcher{ - ServiceDisc: services.ServiceDiscovery, + ServiceDisc: services.ServiceDiscovery, //utilenv.ServiceDiscAddr, Apps: nil, ServerAddr: AppSrvAddr, BinPath: AppBinPath, DisplayNodeIP: false, } conf.UptimeTracker = &UptimeTracker{ - Addr: services.UptimeTracker, + Addr: services.UptimeTracker, //utilenv.UptimeTrackerAddr, } conf.CLIAddr = RPCAddr conf.LogLevel = LogLevel conf.LocalPath = LocalPath conf.DmsgHTTPServerPath = LocalPath + "/" + Custom - conf.StunServers = services.StunServers + conf.StunServers = services.StunServers //utilenv.GetStunServers() conf.ShutdownTimeout = DefaultTimeout conf.Dmsgpty = &Dmsgpty{ @@ -134,22 +148,9 @@ func MakeDefaultConfig(log *logging.MasterLogger, sk *cipher.SecKey, usrEnv bool if err != nil { return nil, err } - dnsServer := "" var dmsgHTTPServersList *DmsgHTTPServers - var envServices skywire.EnvServices - var svcs skywire.Services - if err := json.Unmarshal([]byte(skywire.ServicesJSON), &envServices); err != nil { - return nil, nil - } - if !testEnv { - if err := json.Unmarshal(envServices.Prod, &svcs); err != nil { - dnsServer = svcs.DNSServer - } - } else { - if err := json.Unmarshal(envServices.Test, &svcs); err != nil { - dnsServer = svcs.DNSServer - } - } + + dnsServer := utilenv.DNSServer if services != nil { if services.DNSServer != "" { dnsServer = services.DNSServer diff --git a/vendor/github.com/skycoin/skywire/pkg/visor/visorconfig/hypervisorconfig.go b/vendor/github.com/skycoin/skywire/pkg/visor/visorconfig/hypervisorconfig.go index 952491a9..99b284ea 100644 --- a/vendor/github.com/skycoin/skywire/pkg/visor/visorconfig/hypervisorconfig.go +++ b/vendor/github.com/skycoin/skywire/pkg/visor/visorconfig/hypervisorconfig.go @@ -12,7 +12,7 @@ import ( "time" "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire" + utilenv "github.com/skycoin/skywire-utilities/pkg/skyenv" "github.com/skycoin/skywire/pkg/util/pathutil" ) @@ -112,20 +112,11 @@ func (c *HypervisorConfig) FillDefaults(testEnv bool) { } if c.DmsgDiscovery == "" { - var envServices EnvServices - var services Services - if err := json.Unmarshal([]byte(skywire.ServicesJSON), &envServices); err == nil { - if testEnv { - if err := json.Unmarshal(envServices.Test, &services); err != nil { - return - } + if testEnv { + c.DmsgDiscovery = utilenv.TestDmsgDiscAddr } else { - if err := json.Unmarshal(envServices.Prod, &services); err != nil { - return - } - } - - c.DmsgDiscovery = services.DmsgDiscovery + c.DmsgDiscovery = utilenv.DmsgDiscAddr + } } if c.DmsgPort == 0 { c.DmsgPort = DmsgHypervisorPort @@ -140,7 +131,7 @@ func (c *HypervisorConfig) FillDefaults(testEnv bool) { c.TLSKeyFile = TLSKey } -} + // Parse parses the file in path, and decodes to the config. func (c *HypervisorConfig) Parse(path string) error { var err error diff --git a/vendor/github.com/skycoin/skywire/pkg/visor/visorconfig/services.go b/vendor/github.com/skycoin/skywire/pkg/visor/visorconfig/services.go index e448fe44..44ff133a 100644 --- a/vendor/github.com/skycoin/skywire/pkg/visor/visorconfig/services.go +++ b/vendor/github.com/skycoin/skywire/pkg/visor/visorconfig/services.go @@ -52,12 +52,6 @@ func Fetch(mLog *logging.MasterLogger, serviceConf string, stdout bool) (service return services } -// Wrapper struct for the outer JSON -type EnvServices struct { - Test json.RawMessage `json:"test"` - Prod json.RawMessage `json:"prod"` -} - // Services are subdomains and IP addresses of the skywire services type Services struct { DmsgDiscovery string `json:"dmsg_discovery,omitempty"` diff --git a/vendor/github.com/skycoin/skywire/services-config.json b/vendor/github.com/skycoin/skywire/services-config.json index e8ae80f4..7dea1122 100644 --- a/vendor/github.com/skycoin/skywire/services-config.json +++ b/vendor/github.com/skycoin/skywire/services-config.json @@ -1,5 +1,6 @@ { "test": { + "conf": "http://conf.skywire.dev", "dmsg_discovery": "http://dmsgd.skywire.dev", "transport_discovery": "http://tpd.skywire.dev", "address_resolver": "http://ar.skywire.dev", @@ -43,6 +44,7 @@ ] }, "prod": { + "conf": "http://conf.skywire.skycoin.com", "dmsg_discovery": "http://dmsgd.skywire.skycoin.com", "transport_discovery": "http://tpd.skywire.skycoin.com", "address_resolver": "http://ar.skywire.skycoin.com", diff --git a/vendor/github.com/skycoin/skywire/skywire-config.json b/vendor/github.com/skycoin/skywire/skywire-config.json deleted file mode 100644 index f5b248c0..00000000 --- a/vendor/github.com/skycoin/skywire/skywire-config.json +++ /dev/null @@ -1,149 +0,0 @@ -{ - "version": "v1.3.20", - "sk": "78611408c461b1be8ac0f068493bc88e6087b96f944e341fc855fea4d3331660", - "pk": "02c38ff895f5ed713c8694e8ee49c2c183263017e77bf3bbe5e46b7d14a215511a", - "dmsg": { - "discovery": "http://dmsgd.skywire.skycoin.com", - "sessions_count": 2, - "servers": [], - "servers_type": "all" - }, - "dmsgpty": { - "dmsg_port": 22, - "cli_network": "unix", - "cli_address": "/tmp/dmsgpty.sock", - "whitelist": [] - }, - "skywire-tcp": { - "pk_table": null, - "listening_address": ":7777" - }, - "transport": { - "discovery": "http://tpd.skywire.skycoin.com", - "address_resolver": "http://ar.skywire.skycoin.com", - "public_autoconnect": true, - "transport_setup": [ - "03530b786c670fc7f5ab9021478c7ec9cd06a03f3ea1416c50c4a8889ef5bba80e", - "03271c0de223b80400d9bd4b7722b536a245eb6c9c3176781ee41e7bac8f9bad21", - "03a792e6d960c88c6fb2184ee4f16714c58b55f0746840617a19f7dd6e021699d9", - "0313efedc579f57f05d4f5bc3fbf0261f31e51cdcfde7e568169acf92c78868926", - "025c7bbf23e3441a36d7e8a1e9d717921e2a49a2ce035680fec4808a048d244c8a", - "030eb6967f6e23e81db0d214f925fc5ce3371e1b059fb8379ae3eb1edfc95e0b46", - "02e582c0a5e5563aad47f561b272e4c3a9f7ac716258b58e58eb50afd83c286a7f", - "02ddc6c749d6ed067bb68df19c9bcb1a58b7587464043b1707398ffa26a9746b26", - "03aa0b1c4e23616872058c11c6efba777c130a85eaf909945d697399a1eb08426d", - "03adb2c924987d8deef04d02bd95236c5ae172fe5dfe7273e0461d96bf4bc220be" - ], - "log_store": { - "type": "file", - "location": "./local/transport_logs", - "rotation_interval": "168h0m0s" - }, - "stcpr_port": 0, - "sudph_port": 0 - }, - "routing": { - "route_setup_nodes": [ - "0324579f003e6b4048bae2def4365e634d8e0e3054a20fc7af49daf2a179658557", - "024fbd3997d4260f731b01abcfce60b8967a6d4c6a11d1008812810ea1437ce438", - "03b87c282f6e9f70d97aeea90b07cf09864a235ef718725632d067873431dd1015" - ], - "route_finder": "http://rf.skywire.skycoin.com", - "route_finder_timeout": "10s", - "min_hops": 0 - }, - "uptime_tracker": { - "addr": "http://ut.skywire.skycoin.com" - }, - "launcher": { - "service_discovery": "http://sd.skycoin.com", - "apps": [ - { - "name": "vpn-client", - "binary": "skywire", - "args": [ - "app", - "vpn-client", - "--dns", - "1.1.1.1" - ], - "auto_start": false, - "port": 43 - }, - { - "name": "skychat", - "binary": "skywire", - "args": [ - "app", - "skychat", - "--addr", - ":8001" - ], - "auto_start": true, - "port": 1 - }, - { - "name": "skysocks", - "binary": "skywire", - "args": [ - "app", - "skysocks" - ], - "auto_start": true, - "port": 3 - }, - { - "name": "skysocks-client", - "binary": "skywire", - "args": [ - "app", - "skysocks-client", - "--addr", - ":1080" - ], - "auto_start": false, - "port": 13 - }, - { - "name": "vpn-server", - "binary": "skywire", - "args": [ - "app", - "vpn-server" - ], - "auto_start": false, - "port": 44 - } - ], - "server_addr": "localhost:5505", - "bin_path": "./", - "display_node_ip": false - }, - "survey_whitelist": [ - "02b5ee5333aa6b7f5fc623b7d5f35f505cb7f974e98a70751cf41962f84c8c4637", - "03714c8bdaee0fb48f47babbc47c33e1880752b6620317c9d56b30f3b0ff58a9c3", - "020d35bbaf0a5abc8ec0ba33cde219fde734c63e7202098e1f9a6cf9daaeee55a9", - "027f7dec979482f418f01dfabddbd750ad036c579a16422125dd9a313eaa59c8e1", - "031d4cf1b7ab4c789b56c769f2888e4a61c778dfa5fe7e5cd0217fc41660b2eb65", - "0327e2cf1d2e516ecbfdbd616a87489cc92a73af97335d5c8c29eafb5d8882264a", - "03abbb3eff140cf3dce468b3fa5a28c80fa02c6703d7b952be6faaf2050990ebf4" - ], - "hypervisors": [], - "cli_addr": "localhost:3435", - "log_level": "", - "local_path": "./local", - "dmsghttp_server_path": "./local/custom", - "stun_servers": [ - "192.53.117.238:3478", - "170.187.228.44:3478", - "192.53.117.237:3478", - "192.53.117.146:3478", - "192.53.117.60:3478", - "192.53.117.124:3478", - "170.187.228.178:3478", - "170.187.225.246:3478" - ], - "shutdown_timeout": "10s", - "is_public": false, - "persistent_transports": null -} \ No newline at end of file diff --git a/vendor/github.com/skycoin/skywire/skywire.go b/vendor/github.com/skycoin/skywire/skywire.go index b4fe4d08..ac53ec55 100644 --- a/vendor/github.com/skycoin/skywire/skywire.go +++ b/vendor/github.com/skycoin/skywire/skywire.go @@ -4,30 +4,34 @@ package skywire import ( _ "embed" "encoding/json" + "log" + "github.com/skycoin/skywire-utilities/pkg/cipher" ) /* Embedded Deployment Defaults -Change the contents of the files to embed updated values - -Vendor the commit of the change in any repo which depends on them +Change the contents of services-config.json and / or dmsghttp-config.json to embed updated values */ +// ServicesJSON is the embedded services-config.json file +// //go:embed services-config.json var ServicesJSON []byte +// DmsghttpJSON is the embedded dmsghttp-config.json file +// //go:embed dmsghttp-config.json var DmsghttpJSON []byte -// Wrapper struct for the outer JSON +// EnvServices is the wrapper struct for the outer JSON - i.e. 'prod' or 'test' deployment config type EnvServices struct { Test json.RawMessage `json:"test"` Prod json.RawMessage `json:"prod"` } -// Services are subdomains and IP addresses of the skywire services +// Services are URLs, IP addresses, and public keys of the skywire services as deployed type Services struct { DmsgDiscovery string `json:"dmsg_discovery,omitempty"` TransportDiscovery string `json:"transport_discovery,omitempty"` @@ -41,3 +45,54 @@ type Services struct { DNSServer string `json:"dns_server,omitempty"` SurveyWhitelist []cipher.PubKey `json:"survey_whitelist,omitempty"` } + +// Conf is the configuration URL for the deployment which may be fetched on `skywire cli config gen` +type Conf struct { + Conf string `json:"conf,omitempty"` +} + +// Prod is the production deployment services +var Prod Services + +// ProdConf is the service configuration address / URL for the skywire production deployment +var ProdConf Conf + +// Test is the test deployment services +var Test Services + +// TestConf is the service configuration address / URL for the skywire test deployment +var TestConf Conf + +// initialize the embedded files into variables +func init() { + var js interface{} + err := json.Unmarshal([]byte(ServicesJSON), &js) + if err != nil { + log.Panic("services-config.json ", err) + } + err = json.Unmarshal([]byte(DmsghttpJSON), &js) + if err != nil { + log.Panic("dmsghttp-config.json ", err) + } + var envServices EnvServices + err = json.Unmarshal(ServicesJSON, &envServices) + if err != nil { + log.Panic(err) + } + err = json.Unmarshal(envServices.Prod, &Prod) + if err != nil { + log.Panic(err) + } + err = json.Unmarshal(envServices.Prod, &ProdConf) + if err != nil { + log.Panic(err) + } + err = json.Unmarshal(envServices.Test, &Test) + if err != nil { + log.Panic(err) + } + err = json.Unmarshal(envServices.Test, &TestConf) + if err != nil { + log.Panic(err) + } +} diff --git a/vendor/github.com/skycoin/skywire/survey-test.key b/vendor/github.com/skycoin/skywire/survey-test.key deleted file mode 100644 index c2f37ee4..00000000 --- a/vendor/github.com/skycoin/skywire/survey-test.key +++ /dev/null @@ -1,2 +0,0 @@ -0242b3fbf28ecbe560a81a0fa83906c200457bdd7fbfa3f63bddbfedde56fa9c39 -81e86ff740b85802be6f5ef6087b040a4830634ffc540dba4a36369316b572ba diff --git a/vendor/modules.txt b/vendor/modules.txt index 3a241174..4fbdb877 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -457,7 +457,7 @@ github.com/rs/cors ## explicit; go 1.13 github.com/sirupsen/logrus github.com/sirupsen/logrus/hooks/syslog -# github.com/skycoin/dmsg v1.3.26-0.20240910062314-dc25f3d9ea6c => ../dmsg +# github.com/skycoin/dmsg v1.3.26-0.20240910062314-dc25f3d9ea6c ## explicit; go 1.21 github.com/skycoin/dmsg/internal/servermetrics github.com/skycoin/dmsg/pkg/direct @@ -481,7 +481,7 @@ github.com/skycoin/skycoin/src/cipher/ripemd160 github.com/skycoin/skycoin/src/cipher/secp256k1-go github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2 github.com/skycoin/skycoin/src/util/logging -# github.com/skycoin/skywire v1.3.25-beta => ../skywire +# github.com/skycoin/skywire v1.3.26-0.20240922162315-789cef41c9a1 ## explicit; go 1.21 github.com/skycoin/skywire github.com/skycoin/skywire/cmd/setup-node/commands @@ -832,5 +832,3 @@ nhooyr.io/websocket/internal/bpool nhooyr.io/websocket/internal/errd nhooyr.io/websocket/internal/wsjs nhooyr.io/websocket/internal/xsync -# github.com/skycoin/skywire => ../skywire -# github.com/skycoin/dmsg => ../dmsg