mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 10:51:36 +01:00
Enable rate limiting and compression for NGINX
This commit is contained in:
@@ -131,7 +131,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
script = ''
|
script = ''
|
||||||
REGISTRATION_IS_DISABLED=${toString cfg.disableRegistration} BODY_SIZE_LIMIT=Infinity ORIGIN=https://${cfg.domain} PORT=${toString cfg.webAppPort} ${pkgs.nodejs_22}/bin/node ${cfg.package}/web-app
|
REGISTRATION_IS_DISABLED=${toString cfg.disableRegistration} BODY_SIZE_LIMIT=10M ORIGIN=https://${cfg.domain} PORT=${toString cfg.webAppPort} ${pkgs.nodejs_22}/bin/node ${cfg.package}/web-app
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -154,6 +154,14 @@ in
|
|||||||
enable = true;
|
enable = true;
|
||||||
recommendedProxySettings = true;
|
recommendedProxySettings = true;
|
||||||
recommendedTlsSettings = true;
|
recommendedTlsSettings = true;
|
||||||
|
recommendedZstdSettings = true;
|
||||||
|
recommendedOptimisation = true;
|
||||||
|
|
||||||
|
appendHttpConfig = ''
|
||||||
|
limit_req_zone $binary_remote_addr zone=requestLimit:10m rate=5r/s;
|
||||||
|
limit_req_status 429;
|
||||||
|
limit_req zone=requestLimit burst=20 nodelay;
|
||||||
|
'';
|
||||||
|
|
||||||
virtualHosts = {
|
virtualHosts = {
|
||||||
"${cfg.domain}" = {
|
"${cfg.domain}" = {
|
||||||
@@ -172,8 +180,6 @@ in
|
|||||||
proxyPass = "http://localhost:${toString cfg.apiPort}/";
|
proxyPass = "http://localhost:${toString cfg.apiPort}/";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
default_type application/json;
|
default_type application/json;
|
||||||
proxy_set_header Connection "";
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
"/api/rpc/register" = mkIf cfg.disableRegistration {
|
"/api/rpc/register" = mkIf cfg.disableRegistration {
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ export const actions: Actions = {
|
|||||||
Authorization: `Bearer ${cookies.get("session_token")}`
|
Authorization: `Bearer ${cookies.get("session_token")}`
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
|
category_name: data.get("category-name"),
|
||||||
category_weight: data.get("category-weight")
|
category_weight: data.get("category-weight")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,6 +89,11 @@
|
|||||||
>
|
>
|
||||||
<input type="hidden" name="category-id" value={id} />
|
<input type="hidden" name="category-id" value={id} />
|
||||||
|
|
||||||
|
<label>
|
||||||
|
Name:
|
||||||
|
<input type="text" name="category-name" value={category_name} maxlength="50" required />
|
||||||
|
</label>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
Weight:
|
Weight:
|
||||||
<input type="number" name="category-weight" value={category_weight} min="0" />
|
<input type="number" name="category-weight" value={category_weight} min="0" />
|
||||||
|
|||||||
Reference in New Issue
Block a user