forked from x/icebergs
opt some
This commit is contained in:
parent
4e8b1cf68d
commit
0441fad5e4
@ -120,6 +120,8 @@ const (
|
|||||||
USER = "USER"
|
USER = "USER"
|
||||||
TERM = "TERM"
|
TERM = "TERM"
|
||||||
SHELL = "SHELL"
|
SHELL = "SHELL"
|
||||||
|
LANG = "LANG"
|
||||||
|
TZ = "TZ"
|
||||||
)
|
)
|
||||||
const (
|
const (
|
||||||
CTX_SHY = "ctx_shy"
|
CTX_SHY = "ctx_shy"
|
||||||
@ -135,7 +137,7 @@ const (
|
|||||||
CTX_DAEMON = "ctx_daemon"
|
CTX_DAEMON = "ctx_daemon"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ENV_LIST = []string{TERM, SHELL, CTX_SHY, CTX_COM, CTX_DEV, CTX_OPS, CTX_ARG, CTX_PID, CTX_DAEMON}
|
var ENV_LIST = []string{TZ, LANG, TERM, SHELL, CTX_SHY, CTX_COM, CTX_DEV, CTX_OPS, CTX_ARG, CTX_PID, CTX_DAEMON}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
HOSTNAME = "hostname"
|
HOSTNAME = "hostname"
|
||||||
|
@ -99,7 +99,7 @@ func init() {
|
|||||||
case "md5":
|
case "md5":
|
||||||
m.Push(key, ice.Info.Hash)
|
m.Push(key, ice.Info.Hash)
|
||||||
case nfs.SIZE:
|
case nfs.SIZE:
|
||||||
m.Push(key, kit.Format("%s/%s", ice.Info.Size, kit.Split(m.Cmdx(cli.SYSTEM, "du", "-sh"))[0]))
|
m.Push(key, kit.Format("%s/%s", ice.Info.Size, kit.Select("", kit.Split(m.Cmdx(cli.SYSTEM, "du", "-sh")), 0)))
|
||||||
case mdb.TYPE:
|
case mdb.TYPE:
|
||||||
m.Push(key, ice.Info.NodeType)
|
m.Push(key, ice.Info.NodeType)
|
||||||
case nfs.PATH:
|
case nfs.PATH:
|
||||||
|
@ -104,9 +104,6 @@ func _serve_handle(key string, cmd *ice.Command, m *ice.Message, w http.Response
|
|||||||
m.OptionDefault(ice.MSG_HEIGHT, "480", ice.MSG_WIDTH, "320")
|
m.OptionDefault(ice.MSG_HEIGHT, "480", ice.MSG_WIDTH, "320")
|
||||||
m.Options(ice.MSG_USERWEB, _serve_domain(m), ice.MSG_USERPOD, m.Option(ice.POD))
|
m.Options(ice.MSG_USERWEB, _serve_domain(m), ice.MSG_USERPOD, m.Option(ice.POD))
|
||||||
m.Options(ice.MSG_USERUA, r.Header.Get(UserAgent), ice.MSG_USERIP, r.Header.Get(ice.MSG_USERIP))
|
m.Options(ice.MSG_USERUA, r.Header.Get(UserAgent), ice.MSG_USERIP, r.Header.Get(ice.MSG_USERIP))
|
||||||
m.Debug("what %v", m.Option(ice.MSG_USERWEB))
|
|
||||||
m.Debug("what %v", CookieName(m.Option(ice.MSG_USERWEB)))
|
|
||||||
|
|
||||||
m.Options(ice.MSG_SESSID, kit.Select(m.Option(ice.MSG_SESSID), m.Option(CookieName(m.Option(ice.MSG_USERWEB)))))
|
m.Options(ice.MSG_SESSID, kit.Select(m.Option(ice.MSG_SESSID), m.Option(CookieName(m.Option(ice.MSG_USERWEB)))))
|
||||||
kit.If(m.Optionv(ice.MSG_CMDS) == nil, func() {
|
kit.If(m.Optionv(ice.MSG_CMDS) == nil, func() {
|
||||||
kit.If(strings.TrimPrefix(r.URL.Path, key), func(p string) { m.Optionv(ice.MSG_CMDS, strings.Split(p, nfs.PS)) })
|
kit.If(strings.TrimPrefix(r.URL.Path, key), func(p string) { m.Optionv(ice.MSG_CMDS, strings.Split(p, nfs.PS)) })
|
||||||
|
@ -522,7 +522,7 @@ func init() {
|
|||||||
if cfg, err := config.LoadConfig(config.GlobalScope); err == nil {
|
if cfg, err := config.LoadConfig(config.GlobalScope); err == nil {
|
||||||
if cfg.Author.Email == "" || cfg.Author.Name == "" {
|
if cfg.Author.Email == "" || cfg.Author.Name == "" {
|
||||||
opt.Author = &object.Signature{
|
opt.Author = &object.Signature{
|
||||||
Email: kit.Select(m.Option(ice.MSG_USERNAME)+"@163.com", mdb.Config(m, aaa.EMAIL)),
|
Email: kit.Select(m.Option(ice.MSG_USERNAME)+"@shylinux.com", mdb.Config(m, aaa.EMAIL)),
|
||||||
Name: kit.Select(m.Option(ice.MSG_USERNAME), mdb.Config(m, aaa.USERNAME)),
|
Name: kit.Select(m.Option(ice.MSG_USERNAME), mdb.Config(m, aaa.USERNAME)),
|
||||||
When: time.Now(),
|
When: time.Now(),
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user