diff --git a/src/contexts/cli/cli.go b/src/contexts/cli/cli.go index 31a1db1c..720b929a 100644 --- a/src/contexts/cli/cli.go +++ b/src/contexts/cli/cli.go @@ -1088,7 +1088,7 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心", "cmd_env", "ctx_box", fmt.Sprintf("http://127.0.0.1%s", m.Conf("runtime", "boot.web_port")), "cmd_daemon", "true", } - if m.Assert(os.MkdirAll(p, 0666)); m.Conf("runtime", "host.GOOS") == "windows" { + if m.Assert(os.MkdirAll(p, 0777)); m.Conf("runtime", "host.GOOS") == "windows" { m.Cmdy("cli.system", path.Join(m.Conf("runtime", "boot.ctx_home"), "bin/node.sh"), "start", args) } else { m.Cmdy("cli.system", m.Conf("runtime", "boot.ctx_bin"), args) diff --git a/src/contexts/cli/version.go b/src/contexts/cli/version.go index 787626bf..61cfa1bb 100644 --- a/src/contexts/cli/version.go +++ b/src/contexts/cli/version.go @@ -4,5 +4,5 @@ var version = struct { host string self int }{ - "2019-08-23 14:51:01", "ZYB-20190522USI", 443, + "2019-08-24 17:10:37", "ZYB-20190522USI.centos", 402, } diff --git a/src/contexts/ctx/core.go b/src/contexts/ctx/core.go index 55e2dd76..6593f3ec 100644 --- a/src/contexts/ctx/core.go +++ b/src/contexts/ctx/core.go @@ -34,9 +34,10 @@ func (c *Context) Register(s *Context, x Server, args ...interface{}) *Context { } func (c *Context) Plugin(s *Context, args []string) string { c.Register(s, nil) - m := &Message{code: 0, time: time.Now(), source: s, target: s, Meta: map[string][]string{}} - kit.DisableLog = true - m.Option("log.disable", true) + m := Pulse.Spawn(s) + // m := &Message{code: 0, time: time.Now(), source: s, target: s, Meta: map[string][]string{}} + // kit.DisableLog = true + // m.Option("log.disable", true) m.Option("bio.modal", "action") if len(args) == 0 { diff --git a/src/contexts/ctx/type.go b/src/contexts/ctx/type.go index e75ef053..d9c4f442 100644 --- a/src/contexts/ctx/type.go +++ b/src/contexts/ctx/type.go @@ -118,6 +118,9 @@ func (m *Message) Target() *Context { } func (m *Message) Insert(meta string, index int, arg ...interface{}) string { + if m == nil { + return "" + } if m.Meta == nil { m.Meta = make(map[string][]string) } @@ -498,8 +501,9 @@ func (m *Message) Cmd(args ...interface{}) *Message { } else if strings.Contains(key, ".") { arg := strings.Split(key, ".") - msg, key = msg.Sess(arg[0]), arg[1] - msg.Option("remote_code", "") + if msg, key = msg.Sess(arg[0]), arg[1]; msg != nil { + msg.Option("remote_code", "") + } } if msg == nil { return msg diff --git a/src/contexts/ssh/ssh.go b/src/contexts/ssh/ssh.go index 768f8bff..f23b21d3 100644 --- a/src/contexts/ssh/ssh.go +++ b/src/contexts/ssh/ssh.go @@ -435,6 +435,8 @@ var Index = &ctx.Context{Name: "ssh", Help: "集群中心", if m.Confs("runtime", "boot.ctx_ups") { m.Cmd("ssh.remote", "dial", m.Conf("runtime", "boot.ctx_ups")) + m.Cmd("ssh.remote", "listen", m.Conf("runtime", "boot.ssh_port")) + m.Cmd("web.serve", "usr", m.Conf("runtime", "boot.web_port")) } else if m.Cmd("ssh.remote", "dial", "dev", "/shadow"); !m.Confs("runtime", "boot.ctx_box") { m.Cmd("ssh.remote", "listen", m.Conf("runtime", "boot.ssh_port"))