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-17 21:42:17 +00:00
|
|
|
if !AdminLogin(r) {
|
2022-01-16 07:25:43 +00:00
|
|
|
LogMsg("SetNodeConfig - invalid admin credentials");
|
2022-01-15 21:45:37 +00:00
|
|
|
w.WriteHeader(http.StatusUnauthorized);
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// get node config fields
|
|
|
|
var config NodeConfig;
|
|
|
|
config.Domain = getStrConfigValue(CONFIG_DOMAIN, "");
|
|
|
|
config.PublicLimit = getNumConfigValue(CONFIG_PUBLICLIMIT, 0);
|
|
|
|
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
|
|
|
}
|
|
|
|
|