Admin Dashboard overview
This commit is contained in:
@@ -21,7 +21,7 @@ namespace Core\API {
|
||||
"allowed_extensions" => new ArrayType("allowed_extensions", Parameter::TYPE_STRING),
|
||||
"trusted_domains" => new ArrayType("trusted_domains", Parameter::TYPE_STRING),
|
||||
"user_registration_enabled" => new Parameter("user_registration_enabled", Parameter::TYPE_BOOLEAN),
|
||||
"captcha_provider" => new StringType("captcha_provider", -1, true, "none", CaptchaProvider::PROVIDERS),
|
||||
"captcha_provider" => new StringType("captcha_provider", -1, true, "disabled", CaptchaProvider::PROVIDERS),
|
||||
"mail_enabled" => new Parameter("mail_enabled", Parameter::TYPE_BOOLEAN),
|
||||
"mail_port" => new IntegerType("mail_port", 1, 65535),
|
||||
"rate_limiting_enabled" => new Parameter("rate_limiting_enabled", Parameter::TYPE_BOOLEAN),
|
||||
|
||||
@@ -46,11 +46,12 @@ class Stats extends Request {
|
||||
"server" => [
|
||||
"version" => WEBBASE_VERSION,
|
||||
"server" => $_SERVER["SERVER_SOFTWARE"] ?? "Unknown",
|
||||
"memory_usage" => memory_get_usage(),
|
||||
"load_avg" => $loadAvg,
|
||||
"memoryUsage" => memory_get_usage(),
|
||||
"loadAverage" => $loadAvg,
|
||||
"database" => $this->context->getSQL()->getStatus(),
|
||||
"mail" => $settings->isMailEnabled(),
|
||||
"captcha" => $settings->getCaptchaProvider()?->jsonSerialize()
|
||||
"captcha" => $settings->getCaptchaProvider()?->jsonSerialize(),
|
||||
"rateLimiting" => $settings->isRateLimitingEnabled()
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
@@ -1470,6 +1470,10 @@ namespace Core\API\User {
|
||||
'token' => new StringType('token', 36),
|
||||
));
|
||||
$this->userToken = null;
|
||||
$this->rateLimiting = new RateLimiting(
|
||||
new RateLimitRule(10, 30, RateLimitRule::SECOND),
|
||||
new RateLimitRule(30, 1, RateLimitRule::MINUTE),
|
||||
);
|
||||
}
|
||||
|
||||
public function getToken(): ?UserToken {
|
||||
|
||||
@@ -109,7 +109,7 @@ class Settings {
|
||||
$settings->timeZone = date_default_timezone_get();
|
||||
|
||||
// captcha
|
||||
$settings->captchaProvider = "none";
|
||||
$settings->captchaProvider = "disabled";
|
||||
$settings->captchaSiteKey = "";
|
||||
$settings->captchaSecretKey = "";
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
return [
|
||||
"title" => "Einstellungen",
|
||||
"information" => "Informationen",
|
||||
"disabled" => "Deaktiviert",
|
||||
"enabled" => "Aktiviert",
|
||||
|
||||
# API Key
|
||||
"api_key" => "API Schlüssel",
|
||||
@@ -44,6 +46,8 @@ return [
|
||||
"captcha_provider" => "Captcha Anbieter",
|
||||
"captcha_site_key" => "Öffentlicher Captcha Schlüssel",
|
||||
"captcha_secret_key" => "Geheimer Captcha Schlüssel",
|
||||
"recaptcha" => "Google reCaptcha",
|
||||
"hcaptcha" => "hCaptcha",
|
||||
|
||||
# redis
|
||||
"rate_limit" => "Rate-Limit",
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
return [
|
||||
"title" => "Settings",
|
||||
"information" => "Information",
|
||||
"disabled" => "Disabled",
|
||||
"enabled" => "Enabled",
|
||||
|
||||
# API Key
|
||||
"api_key" => "API Key",
|
||||
@@ -44,6 +46,8 @@ return [
|
||||
"captcha_provider" => "Captcha Provider",
|
||||
"captcha_site_key" => "Captcha Site Key",
|
||||
"captcha_secret_key" => "Secret Captcha Key",
|
||||
"recaptcha" => "Google reCaptcha",
|
||||
"hcaptcha" => "hCaptcha",
|
||||
|
||||
# redis
|
||||
"rate_limit" => "Rate Limiting",
|
||||
|
||||
@@ -6,11 +6,11 @@ use Core\Objects\ApiObject;
|
||||
|
||||
abstract class CaptchaProvider extends ApiObject {
|
||||
|
||||
const NONE = "none";
|
||||
const DISABLED = "disabled";
|
||||
const RECAPTCHA = "recaptcha";
|
||||
const HCAPTCHA = "hcaptcha";
|
||||
|
||||
const PROVIDERS = [self::NONE, self::RECAPTCHA, self::HCAPTCHA];
|
||||
const PROVIDERS = [self::DISABLED, self::RECAPTCHA, self::HCAPTCHA];
|
||||
|
||||
private string $siteKey;
|
||||
private string $secretKey;
|
||||
|
||||
Reference in New Issue
Block a user