Rate Limiting settings
This commit is contained in:
@@ -30,7 +30,6 @@ namespace Core\API {
|
||||
$password = $settings["mail_password"] ?? "";
|
||||
$connectionData = new ConnectionData($host, $port, $login, $password);
|
||||
$connectionData->setProperty("from", $settings["mail_from"] ?? "");
|
||||
$connectionData->setProperty("last_sync", $settings["mail_last_sync"] ?? "");
|
||||
$connectionData->setProperty("mail_footer", $settings["mail_footer"] ?? "");
|
||||
$connectionData->setProperty("mail_async", $settings["mail_async"] ?? false);
|
||||
return $connectionData;
|
||||
|
||||
@@ -16,7 +16,6 @@ namespace Core\API {
|
||||
public function __construct(Context $context, bool $externalCall = false, array $params = array()) {
|
||||
parent::__construct($context, $externalCall, $params);
|
||||
|
||||
// TODO: improve this, additional validation for allowed chars etc.
|
||||
// API parameters should be more configurable, e.g. allow regexes, min/max values for numbers, etc.
|
||||
$this->predefinedKeys = [
|
||||
"allowed_extensions" => new ArrayType("allowed_extensions", Parameter::TYPE_STRING),
|
||||
@@ -24,7 +23,9 @@ namespace Core\API {
|
||||
"user_registration_enabled" => new Parameter("user_registration_enabled", Parameter::TYPE_BOOLEAN),
|
||||
"captcha_provider" => new StringType("captcha_provider", -1, true, "none", CaptchaProvider::PROVIDERS),
|
||||
"mail_enabled" => new Parameter("mail_enabled", Parameter::TYPE_BOOLEAN),
|
||||
"mail_port" => new IntegerType("mail_port", 1, 65535)
|
||||
"mail_port" => new IntegerType("mail_port", 1, 65535),
|
||||
"rate_limiting_enabled" => new Parameter("rate_limiting_enabled", Parameter::TYPE_BOOLEAN),
|
||||
"redis_port" => new IntegerType("redis_port", 1, 65535),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,8 +181,7 @@ class Settings {
|
||||
->addRow("mail_username", '""', false, false)
|
||||
->addRow("mail_password", '""', true, false)
|
||||
->addRow("mail_from", '""', false, false)
|
||||
->addRow("mail_last_sync", '""', false, false)
|
||||
->addRow("mail_footer", '""', false, false)
|
||||
->addRow("mail_footer", '""', false, false)
|
||||
->addRow("mail_async", false, false, false)
|
||||
->addRow("rate_limiting_enabled", json_encode($this->allowedExtensions), false, false)
|
||||
->addRow("redis_host", json_encode($this->redisHost), false, false)
|
||||
|
||||
@@ -45,6 +45,13 @@ return [
|
||||
"captcha_site_key" => "Öffentlicher Captcha Schlüssel",
|
||||
"captcha_secret_key" => "Geheimer Captcha Schlüssel",
|
||||
|
||||
# redis
|
||||
"rate_limit" => "Rate-Limit",
|
||||
"rate_limiting_enabled" => "Rate-Limiting aktiviert",
|
||||
"redis_host" => "Redis Host",
|
||||
"redis_port" => "Redis Port",
|
||||
"redis_password" => "Redis Passwort",
|
||||
|
||||
# dialog
|
||||
"fetch_settings_error" => "Fehler beim Holen der Einstellungen",
|
||||
"save_settings_success" => "Einstellungen erfolgreich gespeichert",
|
||||
|
||||
@@ -45,6 +45,13 @@ return [
|
||||
"captcha_site_key" => "Captcha Site Key",
|
||||
"captcha_secret_key" => "Secret Captcha Key",
|
||||
|
||||
# redis
|
||||
"rate_limit" => "Rate Limiting",
|
||||
"rate_limiting_enabled" => "Rate Limiting enabled",
|
||||
"redis_host" => "Redis host",
|
||||
"redis_port" => "Redis port",
|
||||
"redis_password" => "Redis password",
|
||||
|
||||
# dialog
|
||||
"fetch_settings_error" => "Error fetching settings",
|
||||
"save_settings_success" => "Settings saved successfully",
|
||||
|
||||
Reference in New Issue
Block a user