Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
01012fa8
Commit
01012fa8
authored
Jan 07, 2016
by
astaxie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
admin configure
parent
91675879
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
4 deletions
+57
-4
admin.go
admin.go
+53
-1
beego.go
beego.go
+1
-1
config.go
config.go
+3
-2
No files found.
admin.go
View file @
01012fa8
...
...
@@ -89,11 +89,63 @@ func listConf(rw http.ResponseWriter, r *http.Request) {
data
:=
make
(
map
[
interface
{}]
interface
{})
switch
command
{
case
"conf"
:
m
:=
make
(
map
[
string
]
interface
{})
m
[
"AppConfigPath"
]
=
AppConfigPath
m
[
"AppConfigProvider"
]
=
AppConfigProvider
m
[
"BConfig.AppName"
]
=
BConfig
.
AppName
m
[
"BConfig.RunMode"
]
=
BConfig
.
RunMode
m
[
"BConfig.RouterCaseSensitive"
]
=
BConfig
.
RouterCaseSensitive
m
[
"BConfig.ServerName"
]
=
BConfig
.
ServerName
m
[
"BConfig.RecoverPanic"
]
=
BConfig
.
RecoverPanic
m
[
"BConfig.CopyRequestBody"
]
=
BConfig
.
CopyRequestBody
m
[
"BConfig.EnableGzip"
]
=
BConfig
.
EnableGzip
m
[
"BConfig.MaxMemory"
]
=
BConfig
.
MaxMemory
m
[
"BConfig.EnableErrorsShow"
]
=
BConfig
.
EnableErrorsShow
m
[
"BConfig.Listen.Graceful"
]
=
BConfig
.
Listen
.
Graceful
m
[
"BConfig.Listen.ServerTimeOut"
]
=
BConfig
.
Listen
.
ServerTimeOut
m
[
"BConfig.Listen.ListenTCP4"
]
=
BConfig
.
Listen
.
ListenTCP4
m
[
"BConfig.Listen.HTTPEnable"
]
=
BConfig
.
Listen
.
HTTPEnable
m
[
"BConfig.Listen.HTTPAddr"
]
=
BConfig
.
Listen
.
HTTPAddr
m
[
"BConfig.Listen.HTTPPort"
]
=
BConfig
.
Listen
.
HTTPPort
m
[
"BConfig.Listen.HTTPSEnable"
]
=
BConfig
.
Listen
.
HTTPSEnable
m
[
"BConfig.Listen.HTTPSAddr"
]
=
BConfig
.
Listen
.
HTTPSAddr
m
[
"BConfig.Listen.HTTPSPort"
]
=
BConfig
.
Listen
.
HTTPSPort
m
[
"BConfig.Listen.HTTPSCertFile"
]
=
BConfig
.
Listen
.
HTTPSCertFile
m
[
"BConfig.Listen.HTTPSKeyFile"
]
=
BConfig
.
Listen
.
HTTPSKeyFile
m
[
"BConfig.Listen.AdminEnable"
]
=
BConfig
.
Listen
.
AdminEnable
m
[
"BConfig.Listen.AdminAddr"
]
=
BConfig
.
Listen
.
AdminAddr
m
[
"BConfig.Listen.AdminPort"
]
=
BConfig
.
Listen
.
AdminPort
m
[
"BConfig.Listen.EnableFcgi"
]
=
BConfig
.
Listen
.
EnableFcgi
m
[
"BConfig.Listen.EnableStdIo"
]
=
BConfig
.
Listen
.
EnableStdIo
m
[
"BConfig.WebConfig.AutoRender"
]
=
BConfig
.
WebConfig
.
AutoRender
m
[
"BConfig.WebConfig.EnableDocs"
]
=
BConfig
.
WebConfig
.
EnableDocs
m
[
"BConfig.WebConfig.FlashName"
]
=
BConfig
.
WebConfig
.
FlashName
m
[
"BConfig.WebConfig.FlashSeperator"
]
=
BConfig
.
WebConfig
.
FlashSeperator
m
[
"BConfig.WebConfig.DirectoryIndex"
]
=
BConfig
.
WebConfig
.
DirectoryIndex
m
[
"BConfig.WebConfig.StaticDir"
]
=
BConfig
.
WebConfig
.
StaticDir
m
[
"BConfig.WebConfig.StaticExtensionsToGzip"
]
=
BConfig
.
WebConfig
.
StaticExtensionsToGzip
m
[
"BConfig.WebConfig.TemplateLeft"
]
=
BConfig
.
WebConfig
.
TemplateLeft
m
[
"BConfig.WebConfig.TemplateRight"
]
=
BConfig
.
WebConfig
.
TemplateRight
m
[
"BConfig.WebConfig.ViewsPath"
]
=
BConfig
.
WebConfig
.
ViewsPath
m
[
"BConfig.WebConfig.EnableXSRF"
]
=
BConfig
.
WebConfig
.
EnableXSRF
m
[
"BConfig.WebConfig.XSRFKEY"
]
=
BConfig
.
WebConfig
.
XSRFKEY
m
[
"BConfig.WebConfig.XSRFExpire"
]
=
BConfig
.
WebConfig
.
XSRFExpire
m
[
"BConfig.WebConfig.Session.SessionOn"
]
=
BConfig
.
WebConfig
.
Session
.
SessionOn
m
[
"BConfig.WebConfig.Session.SessionProvider"
]
=
BConfig
.
WebConfig
.
Session
.
SessionProvider
m
[
"BConfig.WebConfig.Session.SessionName"
]
=
BConfig
.
WebConfig
.
Session
.
SessionName
m
[
"BConfig.WebConfig.Session.SessionGCMaxLifetime"
]
=
BConfig
.
WebConfig
.
Session
.
SessionGCMaxLifetime
m
[
"BConfig.WebConfig.Session.SessionProviderConfig"
]
=
BConfig
.
WebConfig
.
Session
.
SessionProviderConfig
m
[
"BConfig.WebConfig.Session.SessionCookieLifeTime"
]
=
BConfig
.
WebConfig
.
Session
.
SessionCookieLifeTime
m
[
"BConfig.WebConfig.Session.SessionAutoSetCookie"
]
=
BConfig
.
WebConfig
.
Session
.
SessionAutoSetCookie
m
[
"BConfig.WebConfig.Session.SessionDomain"
]
=
BConfig
.
WebConfig
.
Session
.
SessionDomain
m
[
"BConfig.Log.AccessLogs"
]
=
BConfig
.
Log
.
AccessLogs
m
[
"BConfig.Log.FileLineNum"
]
=
BConfig
.
Log
.
FileLineNum
m
[
"BConfig.Log.Outputs"
]
=
BConfig
.
Log
.
Outputs
tmpl
:=
template
.
Must
(
template
.
New
(
"dashboard"
)
.
Parse
(
dashboardTpl
))
tmpl
=
template
.
Must
(
tmpl
.
Parse
(
configTpl
))
tmpl
=
template
.
Must
(
tmpl
.
Parse
(
defaultScriptsTpl
))
data
[
"Content"
]
=
BConfig
data
[
"Content"
]
=
m
tmpl
.
Execute
(
rw
,
data
)
...
...
beego.go
View file @
01012fa8
...
...
@@ -74,7 +74,7 @@ func initBeforeHTTPRun() {
panic
(
err
)
}
//init log
for
adaptor
,
config
:=
range
BConfig
.
Log
.
Output
{
for
adaptor
,
config
:=
range
BConfig
.
Log
.
Output
s
{
err
=
BeeLogger
.
SetLogger
(
adaptor
,
config
)
if
err
!=
nil
{
fmt
.
Printf
(
"%s with the config `%s` got err:%s
\n
"
,
adaptor
,
config
,
err
)
...
...
config.go
View file @
01012fa8
...
...
@@ -90,7 +90,7 @@ type SessionConfig struct {
type
LogConfig
struct
{
AccessLogs
bool
FileLineNum
bool
Output
map
[
string
]
string
// Store Adaptor : config
Output
s
map
[
string
]
string
// Store Adaptor : config
}
var
(
...
...
@@ -165,7 +165,7 @@ func init() {
Log
:
LogConfig
{
AccessLogs
:
false
,
FileLineNum
:
true
,
Output
:
map
[
string
]
string
{
"console"
:
""
},
Output
s
:
map
[
string
]
string
{
"console"
:
""
},
},
}
ParseConfig
()
...
...
@@ -215,6 +215,7 @@ func ParseConfig() (err error) {
BConfig
.
Listen
.
AdminAddr
=
AppConfig
.
DefaultString
(
"AdminHTTPAddr"
,
BConfig
.
Listen
.
AdminAddr
)
BConfig
.
Listen
.
AdminPort
=
AppConfig
.
DefaultInt
(
"AdminHTTPPort"
,
BConfig
.
Listen
.
AdminPort
)
BConfig
.
Listen
.
EnableFcgi
=
AppConfig
.
DefaultBool
(
"EnableFcgi"
,
BConfig
.
Listen
.
EnableFcgi
)
BConfig
.
Listen
.
EnableStdIo
=
AppConfig
.
DefaultBool
(
"EnableStdIo"
,
BConfig
.
Listen
.
EnableStdIo
)
BConfig
.
Listen
.
ServerTimeOut
=
AppConfig
.
DefaultInt64
(
"HTTPServerTimeOut"
,
BConfig
.
Listen
.
ServerTimeOut
)
BConfig
.
WebConfig
.
AutoRender
=
AppConfig
.
DefaultBool
(
"AutoRender"
,
BConfig
.
WebConfig
.
AutoRender
)
BConfig
.
WebConfig
.
ViewsPath
=
AppConfig
.
DefaultString
(
"ViewsPath"
,
BConfig
.
WebConfig
.
ViewsPath
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment