Multiple HTTPS certificate support

This commit is contained in:
刘河
2019-03-30 12:03:17 +08:00
parent 5fd335f330
commit 2b841adb1b
16 changed files with 560 additions and 111 deletions

View File

@@ -43,6 +43,7 @@ func (s *BaseController) Prepare() {
} else {
s.Data["isAdmin"] = true
}
s.Data["https_just_proxy"], _ = beego.AppConfig.Bool("https_just_proxy")
}
//加载模板

View File

@@ -251,10 +251,12 @@ func (s *IndexController) AddHost() {
Location: s.GetString("location"),
Flow: &file.Flow{},
Scheme: s.GetString("scheme"),
KeyFilePath: s.GetString("key_file_path"),
CertFilePath: s.GetString("cert_file_path"),
}
var err error
if h.Client, err = file.GetDb().GetClient(s.GetIntNoErr("client_id")); err != nil {
s.AjaxErr("add error")
s.AjaxErr("add error the client can not be found")
}
if err := file.GetDb().NewHost(h); err != nil {
s.AjaxErr("add fail" + err.Error())
@@ -300,6 +302,8 @@ func (s *IndexController) EditHost() {
h.Remark = s.GetString("remark")
h.Location = s.GetString("location")
h.Scheme = s.GetString("scheme")
h.KeyFilePath = s.GetString("key_file_path")
h.CertFilePath = s.GetString("cert_file_path")
file.GetDb().JsonDb.StoreHostToJsonFile()
}
s.AjaxOk("modified success")