mirror of
https://shylinux.com/x/icebergs
synced 2025-04-29 02:29:22 +08:00
opt some
This commit is contained in:
parent
755aaf72b0
commit
7862121a3c
@ -398,6 +398,10 @@ func init() {
|
|||||||
TOKEN: {Hand: func(m *ice.Message, arg ...string) {
|
TOKEN: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Options(m.Cmd(SPIDE, m.Option(mdb.NAME)).AppendSimple()).Cmdy(SPIDE, mdb.DEV_REQUEST)
|
m.Options(m.Cmd(SPIDE, m.Option(mdb.NAME)).AppendSimple()).Cmdy(SPIDE, mdb.DEV_REQUEST)
|
||||||
}},
|
}},
|
||||||
|
"settoken": {Name: "settoken nodename* username*", Help: "令牌", Icon: "bi bi-person-fill-down", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
token := m.Cmdx(TOKEN, mdb.CREATE, mdb.TYPE, SERVER, mdb.NAME, m.Option(aaa.USERNAME), mdb.TEXT, m.Option(tcp.NODENAME))
|
||||||
|
m.Cmd(SPACE, m.Option(mdb.NAME), SPIDE, DEV_CREATE_TOKEN, ice.Maps{CLIENT_NAME: ice.DEV, TOKEN: token})
|
||||||
|
}},
|
||||||
OPEN: {Role: aaa.VOID, Hand: func(m *ice.Message, arg ...string) {
|
OPEN: {Role: aaa.VOID, Hand: func(m *ice.Message, arg ...string) {
|
||||||
if m.Option(mdb.TYPE) == ORIGIN && m.IsLocalhost() {
|
if m.Option(mdb.TYPE) == ORIGIN && m.IsLocalhost() {
|
||||||
m.ProcessOpen(SpideOrigin(m, m.Option(mdb.NAME)))
|
m.ProcessOpen(SpideOrigin(m, m.Option(mdb.NAME)))
|
||||||
@ -428,7 +432,7 @@ func init() {
|
|||||||
case WORKER:
|
case WORKER:
|
||||||
list = append(list, "settings", nfs.COPY, tcp.SEND)
|
list = append(list, "settings", nfs.COPY, tcp.SEND)
|
||||||
case SERVER:
|
case SERVER:
|
||||||
list = append(list, DREAM)
|
list = append(list, "settoken", DREAM)
|
||||||
default:
|
default:
|
||||||
list = append(list, TOKEN, DREAM)
|
list = append(list, TOKEN, DREAM)
|
||||||
}
|
}
|
||||||
|
@ -241,7 +241,7 @@ func init() {
|
|||||||
cli.START: {Name: "start dev proto host port=9020 nodename username usernick", Hand: func(m *ice.Message, arg ...string) {
|
cli.START: {Name: "start dev proto host port=9020 nodename username usernick", Hand: func(m *ice.Message, arg ...string) {
|
||||||
if runtime.GOOS == cli.LINUX {
|
if runtime.GOOS == cli.LINUX {
|
||||||
m.Cmd(nfs.SAVE, nfs.ETC_LOCAL_SH, m.Spawn(ice.Maps{cli.PWD: kit.Path(""), aaa.USER: kit.UserName(), ctx.ARGS: kit.JoinCmds(arg...)}).Template("local.sh")+lex.NL)
|
m.Cmd(nfs.SAVE, nfs.ETC_LOCAL_SH, m.Spawn(ice.Maps{cli.PWD: kit.Path(""), aaa.USER: kit.UserName(), ctx.ARGS: kit.JoinCmds(arg...)}).Template("local.sh")+lex.NL)
|
||||||
m.Cmd("", PROXY_CONF, ice.Info.NodeName)
|
m.GoSleep("3s", func() { m.Cmd("", PROXY_CONF, ice.Info.NodeName) })
|
||||||
} else if runtime.GOOS == cli.WINDOWS {
|
} else if runtime.GOOS == cli.WINDOWS {
|
||||||
m.Cmd(cli.SYSTEM, cli.ECHO, "-ne", kit.Format("\033]0;%s %s serve start %s\007",
|
m.Cmd(cli.SYSTEM, cli.ECHO, "-ne", kit.Format("\033]0;%s %s serve start %s\007",
|
||||||
path.Base(kit.Path("")), strings.TrimPrefix(kit.Path(os.Args[0]), kit.Path("")+nfs.PS), kit.JoinCmdArgs(arg...)))
|
path.Base(kit.Path("")), strings.TrimPrefix(kit.Path(os.Args[0]), kit.Path("")+nfs.PS), kit.JoinCmdArgs(arg...)))
|
||||||
@ -263,7 +263,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
PROXY_CONF: {Name: "proxyConf name* port host path", Hand: func(m *ice.Message, arg ...string) {
|
PROXY_CONF: {Name: "proxyConf name* port host path", Hand: func(m *ice.Message, arg ...string) {
|
||||||
if dir := m.OptionDefault(nfs.PATH, PROXY_PATH, tcp.HOST, "127.0.0.1", tcp.PORT, tcp.PORT_9020); nfs.Exists(m, dir) {
|
if dir := m.OptionDefault(nfs.PATH, PROXY_PATH, tcp.HOST, "127.0.0.1", tcp.PORT, tcp.PORT_9020); true || nfs.Exists(m, dir) {
|
||||||
for _, p := range []string{"server.conf", "location.conf", "upstream.conf"} {
|
for _, p := range []string{"server.conf", "location.conf", "upstream.conf"} {
|
||||||
m.Cmd(nfs.SAVE, kit.Format("%s/conf/portal/%s/%s", dir, m.Option(mdb.NAME), p), m.Template(p)+lex.NL)
|
m.Cmd(nfs.SAVE, kit.Format("%s/conf/portal/%s/%s", dir, m.Option(mdb.NAME), p), m.Template(p)+lex.NL)
|
||||||
}
|
}
|
||||||
|
@ -365,6 +365,7 @@ func init() {
|
|||||||
}},
|
}},
|
||||||
DEV_REQUEST_TEXT: {Hand: func(m *ice.Message, arg ...string) { m.Echo(SpaceName(ice.Info.NodeName)) }},
|
DEV_REQUEST_TEXT: {Hand: func(m *ice.Message, arg ...string) { m.Echo(SpaceName(ice.Info.NodeName)) }},
|
||||||
DEV_CREATE_TOKEN: {Hand: func(m *ice.Message, arg ...string) {
|
DEV_CREATE_TOKEN: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
mdb.HashModify(m, m.OptionSimple(CLIENT_NAME, TOKEN))
|
||||||
m.Cmd(SPACE, tcp.DIAL, ice.DEV, m.Option(CLIENT_NAME), m.OptionSimple(TOKEN)).Sleep300ms()
|
m.Cmd(SPACE, tcp.DIAL, ice.DEV, m.Option(CLIENT_NAME), m.OptionSimple(TOKEN)).Sleep300ms()
|
||||||
}},
|
}},
|
||||||
}, DevTokenAction(CLIENT_NAME, CLIENT_URL), mdb.ImportantHashAction(mdb.SHORT, CLIENT_NAME, mdb.FIELD, "time,icons,client.name,client.url,client.type,token")), Hand: func(m *ice.Message, arg ...string) {
|
}, DevTokenAction(CLIENT_NAME, CLIENT_URL), mdb.ImportantHashAction(mdb.SHORT, CLIENT_NAME, mdb.FIELD, "time,icons,client.name,client.url,client.type,token")), Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
@ -60,7 +60,7 @@ func _publish_contexts(m *ice.Message, arg ...string) {
|
|||||||
m.OptionDefault(nfs.SOURCE, web.AdminCmd(m, web.SPACE, kit.KeyBase(m.Option(ice.MSG_USERPOD)), cli.RUNTIME, "make.remote").Result())
|
m.OptionDefault(nfs.SOURCE, web.AdminCmd(m, web.SPACE, kit.KeyBase(m.Option(ice.MSG_USERPOD)), cli.RUNTIME, "make.remote").Result())
|
||||||
}
|
}
|
||||||
env = append(env, cli.CTX_REPOS, m.Option(nfs.SOURCE))
|
env = append(env, cli.CTX_REPOS, m.Option(nfs.SOURCE))
|
||||||
fallthrough
|
// fallthrough
|
||||||
case nfs.BINARY, ice.APP:
|
case nfs.BINARY, ice.APP:
|
||||||
if host := msg.Append(tcp.HOSTPORT); !strings.HasPrefix(host, m.Option(web.DOMAIN)) {
|
if host := msg.Append(tcp.HOSTPORT); !strings.HasPrefix(host, m.Option(web.DOMAIN)) {
|
||||||
env = append(env, cli.CTX_DEV_IP, strings.Split(host, "?")[0])
|
env = append(env, cli.CTX_DEV_IP, strings.Split(host, "?")[0])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user