2022-01-15 21:45:37 +00:00
|
|
|
package databag
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
2022-07-29 21:39:39 +00:00
|
|
|
//GetNodeConfig retreive current admin config
|
2022-01-15 21:45:37 +00:00
|
|
|
func GetNodeConfig(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
2022-07-22 19:28:14 +00:00
|
|
|
// validate login
|
|
|
|
if code, err := ParamAdminToken(r); err != nil {
|
|
|
|
ErrResponse(w, code, err)
|
|
|
|
return
|
|
|
|
}
|
2022-01-15 21:45:37 +00:00
|
|
|
|
2022-07-22 19:28:14 +00:00
|
|
|
// get node config fields
|
|
|
|
var config NodeConfig
|
|
|
|
config.Domain = getStrConfigValue(CNFDomain, "")
|
|
|
|
config.AccountStorage = getNumConfigValue(CNFStorage, 0)
|
2022-09-01 07:22:43 +00:00
|
|
|
config.EnableImage = getBoolConfigValue(CNFEnableImage, true)
|
|
|
|
config.EnableAudio = getBoolConfigValue(CNFEnableAudio, true)
|
|
|
|
config.EnableVideo = getBoolConfigValue(CNFEnableVideo, true)
|
|
|
|
config.KeyType = getStrConfigValue(CNFKeyType, APPRSA4096)
|
2022-11-10 04:54:44 +00:00
|
|
|
config.PushSupported = getBoolConfigValue(CNFPushSupported, true)
|
2022-01-15 21:45:37 +00:00
|
|
|
|
2022-07-22 19:28:14 +00:00
|
|
|
WriteResponse(w, config)
|
2022-01-15 21:45:37 +00:00
|
|
|
}
|