diff --git a/base/cli/forever.go b/base/cli/forever.go index 8375ac6b..964b380a 100644 --- a/base/cli/forever.go +++ b/base/cli/forever.go @@ -36,7 +36,7 @@ func init() { } if p := m.Cmdx(nfs.CAT, m.Conf("gdb.signal", kit.Keym(nfs.PATH))); p != "" { - m.Cmd(SYSTEM, "kill", "-n", 3, p) + m.Cmd(SYSTEM, "kill", "-s", "QUIT", p) } m.Cmdy(FOREVER, kit.Select(os.Args[0], nfs.PWD+ice.BIN_ICE_BIN, kit.FileExists(ice.BIN_ICE_BIN)), diff --git a/base/mdb/hash.go b/base/mdb/hash.go index 3dbb55e7..b1c07b58 100644 --- a/base/mdb/hash.go +++ b/base/mdb/hash.go @@ -93,7 +93,9 @@ func _hash_export(m *ice.Message, prefix, chain, file string) { } func _hash_import(m *ice.Message, prefix, chain, file string) { f, e := os.Open(kit.Keys(file, JSON)) - m.Assert(e) + if m.Warn(e) { + return + } defer f.Close() list := map[string]interface{}{} diff --git a/base/mdb/zone.go b/base/mdb/zone.go index a687fe30..ce941ff1 100644 --- a/base/mdb/zone.go +++ b/base/mdb/zone.go @@ -90,7 +90,9 @@ func _zone_export(m *ice.Message, prefix, chain, file string) { } func _zone_import(m *ice.Message, prefix, chain, file string) { f, e := os.Open(kit.Keys(file, CSV)) - m.Assert(e) + if m.Warn(e) { + return + } defer f.Close() r := csv.NewReader(f) diff --git a/base/ssh/scripts.go b/base/ssh/scripts.go index 1af8d5c4..838c4f72 100644 --- a/base/ssh/scripts.go +++ b/base/ssh/scripts.go @@ -133,7 +133,13 @@ func (f *Frame) scan(m *ice.Message, h, line string) *Frame { f.ps2 = kit.Simple(m.Confv(PROMPT, kit.Keym(PS2))) ps := f.ps1 - m.Sleep("100ms") + if h == STDIO { + m.Sleep("800ms") + pwd := ice.Render(m, ice.RENDER_QRCODE, m.Cmdx("space", "domain")) + m.Sleep("100ms") + f.printf(m, pwd+ice.NL) + } + m.I, m.O = f.stdin, f.stdout bio := bufio.NewScanner(f.stdin) for f.prompt(m, ps...); bio.Scan() && f.stdin != nil; f.prompt(m, ps...) { diff --git a/base/tcp/client.go b/base/tcp/client.go index 3802b222..fde8cbc9 100644 --- a/base/tcp/client.go +++ b/base/tcp/client.go @@ -46,8 +46,9 @@ func _client_dial(m *ice.Message, arg ...string) { case func(net.Conn, error): cb(c, e) case func(net.Conn): - m.Assert(e) - cb(c) + if !m.Warn(e) { + cb(c) + } case func(net.Conn, []byte, error): b := make([]byte, ice.MOD_BUFS) for { diff --git a/base/web/serve.go b/base/web/serve.go index c4db71cd..b62b5d1c 100644 --- a/base/web/serve.go +++ b/base/web/serve.go @@ -293,7 +293,7 @@ func init() { repos := kit.Select(ice.INTSHELL, ice.VOLCANOS, strings.Contains(r.Header.Get("User-Agent"), "Mozilla/5.0")) if repos == ice.VOLCANOS { - if s := m.Cmdx("web.chat.website", "show", "index.iml", "Header", "", "River", "", "Action", "", "Footer", ""); s != "" { + if s := msg.Cmdx("web.chat.website", "show", "index.iml", "Header", "", "River", "", "Action", "", "Footer", ""); s != "" { Render(msg, ice.RENDER_RESULT, s) return true } diff --git a/base/web/share.go b/base/web/share.go index f1d4a7eb..2f7da20e 100644 --- a/base/web/share.go +++ b/base/web/share.go @@ -81,6 +81,10 @@ func _share_local(m *ice.Message, arg ...string) { size = s.Size() } + if p == "bin/ice.bin" { + aaa.UserRoot(m) + } + // 上传文件 m.Cmd(SPACE, m.Option(ice.POD), SPIDE, ice.DEV, SPIDE_RAW, m.MergeURL2(SHARE_PROXY, nfs.PATH, ""), SPIDE_PART, m.OptionSimple(ice.POD), nfs.PATH, p, nfs.SIZE, size, CACHE, cache.Format(ice.MOD_TIME), UPLOAD, "@"+p) diff --git a/base/web/space.go b/base/web/space.go index a38c6d41..75781f27 100644 --- a/base/web/space.go +++ b/base/web/space.go @@ -17,6 +17,9 @@ import ( func _space_domain(m *ice.Message) (link string) { if link = m.Config(DOMAIN); link == "" { + link = m.Cmd(SPACE, ice.OPS, cli.PWD).Append(mdb.LINK) + } + if link == "" { link = m.Cmd(SPACE, ice.DEV, cli.PWD).Append(mdb.LINK) } if link == "" { @@ -284,6 +287,9 @@ func init() { ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) { m.Conf(SPACE, mdb.HASH, "") }}, + "domain": {Name: "domain", Help: "域名", Hand: func(m *ice.Message, arg ...string) { + m.Echo(_space_domain(m)) + }}, mdb.SEARCH: {Name: "search type name text", Help: "搜索", Hand: func(m *ice.Message, arg ...string) { _space_search(m, arg[0], arg[1], kit.Select("", arg, 2)) _broad_search(m, arg[0], arg[1], kit.Select("", arg, 2)) diff --git a/core/chat/pod.go b/core/chat/pod.go index c0ec6c2e..4d1964bb 100644 --- a/core/chat/pod.go +++ b/core/chat/pod.go @@ -4,6 +4,7 @@ import ( "path" ice "shylinux.com/x/icebergs" + "shylinux.com/x/icebergs/base/aaa" "shylinux.com/x/icebergs/base/ctx" "shylinux.com/x/icebergs/base/web" kit "shylinux.com/x/toolkits" @@ -31,6 +32,7 @@ func init() { m.RenderCmd(web.ROUTE) } else if len(arg) == 1 { // 节点首页 + aaa.UserRoot(m) if m.RenderWebsite(arg[0], "index.iml", "Header", "", "River", "", "Action", "", "Footer", ""); m.Result() == "" { m.RenderIndex(web.SERVE, ice.VOLCANOS) } diff --git a/core/code/publish.go b/core/code/publish.go index 87037739..91bbd5b5 100644 --- a/core/code/publish.go +++ b/core/code/publish.go @@ -73,6 +73,11 @@ func init() { web.SERVE_START: {Name: "serve.start", Help: "服务启动", Hand: func(m *ice.Message, arg ...string) { _publish_file(m, ice.ICE_BIN) }}, + mdb.SEARCH: {Name: "search type name text", Help: "搜索", Hand: func(m *ice.Message, arg ...string) { + if arg[0] == mdb.FOREACH && arg[1] == "" { + m.PushSearch(mdb.TYPE, ice.CONTEXTS, mdb.NAME, ice.CORE, mdb.TEXT, m.Cmdx(m.PrefixKey(), ice.CONTEXTS, ice.CORE)) + } + }}, ice.VOLCANOS: {Name: "volcanos", Help: "火山架", Hand: func(m *ice.Message, arg ...string) { defer func() { m.EchoQRCode(m.Option(ice.MSG_USERWEB)) }() @@ -147,7 +152,7 @@ var _contexts = kit.Dict( export ctx_dev={{.Option "httphost"}}; ctx_temp=$(mktemp); curl -fsSL $ctx_dev -o $ctx_temp; source $ctx_temp dev `, ice.CORE, `# 标准版 -export ctx_dev={{.Option "httphost"}}; ctx_temp=$(mktemp); wget -O $ctx_temp $ctx_dev; source $ctx_temp app +export ctx_dev={{.Option "httphost"}} ctx_pod={{.Option "user.pod"}}; ctx_temp=$(mktemp); wget -O $ctx_temp $ctx_dev; source $ctx_temp app `, ice.BASE, `# 官方版 ctx_temp=$(mktemp); curl -o $ctx_temp -fsSL {{.Cmdx "spide" "shy" "url"}}; source $ctx_temp binary diff --git a/misc/git/repos.go b/misc/git/repos.go index 569a8e6f..ab63bd1b 100644 --- a/misc/git/repos.go +++ b/misc/git/repos.go @@ -30,8 +30,6 @@ func _repos_insert(m *ice.Message, name string, dir string) { BRANCH, strings.TrimSpace(m.Cmdx(cli.SYSTEM, GIT, BRANCH)), REMOTE, strings.TrimSpace(m.Cmdx(cli.SYSTEM, GIT, REMOTE, "-v")), )) - } else { - m.Debug("what %v %v", s, e) } } diff --git a/misc/tmux/buffer.go b/misc/tmux/buffer.go index e458a2ad..7f928339 100644 --- a/misc/tmux/buffer.go +++ b/misc/tmux/buffer.go @@ -75,6 +75,16 @@ func init() { } m.Cmdy(TEXT) }}, + mdb.SEARCH: {Name: "search type name text", Help: "搜索", Hand: func(m *ice.Message, arg ...string) { + if arg[0] == mdb.FOREACH && arg[1] == "" { + text := m.Cmdx(cli.SYSTEM, TMUX, "show-buffer") + if strings.HasPrefix(text, "http") { + m.PushSearch(mdb.TEXT, text) + } else { + m.PushSearch(mdb.TEXT, ice.Render(m, ice.RENDER_SCRIPT, text)) + } + } + }}, }, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { text := m.Cmdx(cli.SYSTEM, TMUX, "show-buffer") m.EchoQRCode(text)