forked from x/icebergs
add some
This commit is contained in:
parent
d8ad68c2ba
commit
290936eaff
@ -337,6 +337,7 @@ func init() {
|
||||
cli.BUILD: {Name: "build name", Hand: func(m *ice.Message, arg ...string) {
|
||||
compile := cli.SystemFindGo(m)
|
||||
m.Option(ice.MSG_TITLE, kit.Keys(m.Option(ice.MSG_USERPOD0), m.Option(ice.MSG_USERPOD), m.CommandKey(), m.ActionKey()))
|
||||
m.Option("dream.simple", ice.TRUE)
|
||||
m.Cmd("", FOR_FLOW, m.Option(mdb.NAME), kit.JoinWord(cli.SH, ice.ETC_MISS_SH), func(p string) bool {
|
||||
if compile && nfs.Exists(m, path.Join(p, ice.SRC_MAIN_GO)) {
|
||||
return false
|
||||
@ -345,9 +346,7 @@ func init() {
|
||||
return true
|
||||
}
|
||||
})
|
||||
kit.If(m.Option(mdb.NAME) == "", func() {
|
||||
m.Sleep("5s").Cmdy(ROUTE, cli.BUILD).ProcessInner()
|
||||
})
|
||||
kit.If(m.Option(mdb.NAME) == "", func() { m.Sleep("5s").Cmdy(ROUTE, cli.BUILD).ProcessInner() })
|
||||
}},
|
||||
PUBLISH: {Name: "publish name", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Option(ice.MSG_TITLE, kit.Keys(m.Option(ice.MSG_USERPOD0), m.Option(ice.MSG_USERPOD), m.CommandKey(), m.ActionKey()))
|
||||
|
@ -254,7 +254,7 @@ func init() {
|
||||
}
|
||||
}},
|
||||
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"); nfs.Exists(m, dir) {
|
||||
if dir := m.OptionDefault(nfs.PATH, PROXY_PATH, tcp.HOST, "127.0.0.1", tcp.PORT, "9020"); nfs.Exists(m, dir) {
|
||||
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)
|
||||
}
|
||||
@ -309,6 +309,13 @@ func ParseUA(m *ice.Message) (res []string) {
|
||||
}
|
||||
return append(res, aaa.IP, m.Option(ice.MSG_USERIP), aaa.UA, m.Option(ice.MSG_USERUA))
|
||||
}
|
||||
func ProxyDomain(m *ice.Message, name string) string {
|
||||
domain := ""
|
||||
m.Cmd(nfs.CAT, path.Join(PROXY_PATH, "conf/portal", name, "server.conf"), func(ls []string) {
|
||||
kit.If(ls[0] == "server_name", func() { domain = ls[1] })
|
||||
})
|
||||
return "https://" + domain
|
||||
}
|
||||
func Script(m *ice.Message, str string, arg ...ice.Any) string {
|
||||
return ice.Render(m, ice.RENDER_SCRIPT, kit.Format(str, arg...))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user