From 4799dd7a0465bd39aee67757b752becf854abcbb Mon Sep 17 00:00:00 2001 From: Arya Kiran Date: Sat, 4 Nov 2023 00:28:19 +0530 Subject: [PATCH] offload nitter ratelimiting to an extra nginx --- privfrontends/templates/Caddyfile.j2 | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/privfrontends/templates/Caddyfile.j2 b/privfrontends/templates/Caddyfile.j2 index 10938de..7527a35 100644 --- a/privfrontends/templates/Caddyfile.j2 +++ b/privfrontends/templates/Caddyfile.j2 @@ -80,12 +80,6 @@ lbry.{{ server_prefix }}.projectsegfau.lt lbry.projectsegfau.lt { nitter.{{ server_prefix }}.projectsegfau.lt nitter.projectsegfau.lt n.psf.lt n.{{ server_prefix }}.psf.lt { import def import banips - - @rlignore { - not path /css/* /js/* /fonts/* /browserconfig.xml /android-chrome* /favicon* /logo* /lp.svg /robots.txt /safari* /site.webmanifest /pic/* - } - rate_limit @rlignore {remote.ip} 2r/s 60000 500 - rate_limit @rlignore {remote.ip} 30r/m 300000 500 log { # This is temporarily required to monitor nitter traffic due to scrapers being more active, so we need to monitor and rate limit them at a later date. output file /var/log/caddy/nitter.log @@ -96,11 +90,7 @@ nitter.{{ server_prefix }}.projectsegfau.lt nitter.projectsegfau.lt n.psf.lt n.{ Permissions-Policy "Permissions-Policy: accelerometer=(), ambient-light-sensor=(), autoplay=(self), battery=(), camera=(), cross-origin-isolated=(), display-capture=(), document-domain=(), encrypted-media=(), execution-while-not-rendered=(), execution-while-out-of-viewport=(), fullscreen=(self), geolocation=(), gyroscope=(), keyboard-map=(), magnetometer=(), microphone=(), midi=(), navigation-override=(), payment=(), picture-in-picture=(self), publickey-credentials-get=(), screen-wake-lock=(), sync-xhr=(), usb=(), web-share=(), xr-spatial-tracking=()" header Content-Security-Policy "default-src 'none'; script-src 'self' 'unsafe-inline'; script-src-attr 'none'; img-src 'self'; style-src 'self' 'unsafe-inline'; style-src-elem 'self'; font-src 'self'; object-src 'none'; media-src 'self' blob:; worker-src 'self' blob:; base-uri 'self'; form-action 'self'; frame-ancestors 'self'; connect-src 'self' https://*.twimg.com; manifest-src 'self'" } - reverse_proxy :8387 { - transport http { - compression off - } - } + reverse_proxy :8065 import torloc nitter import i2ploc pjsfs4ukb6prmfx3qx3a5ef2cpcupkvcrxdh72kqn2rxc2cw4nka.b32.i2p }