mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 11:39:17 +00:00
25 lines
569 B
Go
25 lines
569 B
Go
package databag
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
//GetNodeConfig retreive current admin config
|
|
func GetNodeConfig(w http.ResponseWriter, r *http.Request) {
|
|
|
|
// validate login
|
|
if code, err := ParamAdminToken(r); err != nil {
|
|
ErrResponse(w, code, err)
|
|
return
|
|
}
|
|
|
|
// get node config fields
|
|
var config NodeConfig
|
|
config.Domain = getStrConfigValue(CNFDomain, "")
|
|
config.AccountLimit = getNumConfigValue(CNFAccountLimit, 16)
|
|
config.OpenAccess = getBoolConfigValue(CNFOpenAccess, true)
|
|
config.AccountStorage = getNumConfigValue(CNFStorage, 0)
|
|
|
|
WriteResponse(w, config)
|
|
}
|