2022-01-15 21:45:37 +00:00
|
|
|
package databag
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
|
|
|
func GetNodeConfig(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
|
|
|
// validate login
|
2022-01-19 20:07:57 +00:00
|
|
|
if err := AdminLogin(r); err != nil {
|
|
|
|
ErrResponse(w, http.StatusUnauthorized, err)
|
2022-01-15 21:45:37 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// get node config fields
|
|
|
|
var config NodeConfig;
|
|
|
|
config.Domain = getStrConfigValue(CONFIG_DOMAIN, "");
|
2022-03-11 05:26:17 +00:00
|
|
|
config.AccountLimit = getNumConfigValue(CONFIG_ACCOUNTLIMIT, 16);
|
|
|
|
config.OpenAccess = getBoolConfigValue(CONFIG_OPENACCESS, true);
|
2022-01-15 21:45:37 +00:00
|
|
|
config.AccountStorage = getNumConfigValue(CONFIG_STORAGE, 0);
|
|
|
|
|
2022-01-16 07:25:43 +00:00
|
|
|
WriteResponse(w, config);
|
2022-01-15 21:45:37 +00:00
|
|
|
}
|
|
|
|
|