From 71f81174150b720fce89dea83dc69accdd585a79 Mon Sep 17 00:00:00 2001 From: shy Date: Sat, 20 Jan 2024 22:01:21 +0800 Subject: [PATCH] add ice.port --- base/web/admin.go | 2 ++ base/web/serve.go | 1 + conf.go | 1 + 3 files changed, 4 insertions(+) diff --git a/base/web/admin.go b/base/web/admin.go index b4890f03..7e207b6f 100644 --- a/base/web/admin.go +++ b/base/web/admin.go @@ -8,6 +8,7 @@ import ( "shylinux.com/x/icebergs/base/aaa" "shylinux.com/x/icebergs/base/ctx" "shylinux.com/x/icebergs/base/mdb" + "shylinux.com/x/icebergs/base/nfs" kit "shylinux.com/x/toolkits" ) @@ -35,6 +36,7 @@ func init() { RenderMain(m) } else { kit.If(len(arg) == 0, func() { arg = append(arg, SPACE, DOMAIN) }) + m.Cmd(SPIDE, mdb.CREATE, ice.OPS, kit.Format("http://localhost:%s", kit.Select("9020", m.Cmdx(nfs.CAT, ice.VAR_LOG_ICE_PORT)))) m.Cmdy(SPIDE, ice.OPS, SPIDE_RAW, http.MethodPost, C(path.Join(arg...)), "pwd", kit.Path("")) } }}, diff --git a/base/web/serve.go b/base/web/serve.go index b45d3ba6..3c411d1c 100644 --- a/base/web/serve.go +++ b/base/web/serve.go @@ -33,6 +33,7 @@ func _serve_start(m *ice.Message) { }) cli.NodeInfo(m, kit.Select(ice.Info.Hostname, m.Option(tcp.NODENAME)), SERVER) m.Start("", m.OptionSimple(tcp.HOST, tcp.PORT)...) + m.Cmd(nfs.SAVE, ice.VAR_LOG_ICE_PORT, m.Option(tcp.PORT)) kit.For(kit.Split(m.Option(ice.DEV)), func(dev string) { m.Sleep30ms(SPACE, tcp.DIAL, ice.DEV, dev, mdb.NAME, ice.Info.NodeName, m.OptionSimple(TOKEN)) }) diff --git a/conf.go b/conf.go index 6627c75a..a5956246 100644 --- a/conf.go +++ b/conf.go @@ -141,6 +141,7 @@ const ( // DIR USR_LOCAL_DAEMON = "usr/local/daemon/" VAR_DATA_IMPORTANT = "var/data/.important" VAR_LOG_BOOT_LOG = "var/log/boot.log" + VAR_LOG_ICE_PORT = "var/log/ice.port" VAR_LOG_ICE_PID = "var/log/ice.pid" VAR_LOG = "var/log/"