From 7d3596443ae79f00b80d46234340030ab017bf6e Mon Sep 17 00:00:00 2001 From: ZhymabekRoman Date: Fri, 2 Feb 2024 05:14:18 +0600 Subject: [PATCH] Adding new blacklist address --- CaddyfileDev | 136 +++++++++++++++----------------- CaddyfileProd | 136 +++++++++++++++----------------- scripts/generate_caddy_rules.py | 2 +- 3 files changed, 131 insertions(+), 143 deletions(-) diff --git a/CaddyfileDev b/CaddyfileDev index 81a2e15..7c67617 100644 --- a/CaddyfileDev +++ b/CaddyfileDev @@ -4,13 +4,8 @@ header -Server - handle_path /site.webmanifest { - root * ./static/site.webmanifest - file_server - } - - handle_path /favicon-32x32.png { - root * ./static/favicon-32x32.png + handle_path /android-chrome-512x512.png { + root * ./static/android-chrome-512x512.png file_server } @@ -19,68 +14,8 @@ file_server } - handle_path /ads.txt { - root * ./static/ads.txt - file_server - } - - handle_path /humans.txt { - root * ./static/humans.txt - file_server - } - - handle_path /mstile-150x150.png { - root * ./static/mstile-150x150.png - file_server - } - - handle_path /mstile-310x310.png { - root * ./static/mstile-310x310.png - file_server - } - - handle_path /sitemap.xml { - root * ./static/sitemap.xml - file_server - } - - handle_path /99860281ef1143d5a5558ad9a21a470d.txt { - root * ./static/99860281ef1143d5a5558ad9a21a470d.txt - file_server - } - - handle_path /mstile-70x70.png { - root * ./static/mstile-70x70.png - file_server - } - - handle_path /android-chrome-192x192.png { - root * ./static/android-chrome-192x192.png - file_server - } - - handle_path /mstile-310x150.png { - root * ./static/mstile-310x150.png - file_server - } - - handle_path /safari-pinned-tab.svg { - root * ./static/safari-pinned-tab.svg - file_server - } - - handle_path /android-chrome-512x512.png { - root * ./static/android-chrome-512x512.png - file_server - } - - handle_path /favicon-16x16.png { - root * ./static/favicon-16x16.png - file_server - } - - handle_path /favicon.ico { - root * ./static/favicon.ico + handle_path /site.webmanifest { + root * ./static/site.webmanifest file_server } @@ -94,8 +29,8 @@ file_server } - handle_path /security.txt { - root * ./static/security.txt + handle_path /favicon-32x32.png { + root * ./static/favicon-32x32.png file_server } @@ -104,6 +39,65 @@ file_server } + handle_path /humans.txt { + root * ./static/humans.txt + file_server + } + + handle_path /mstile-150x150.png { + root * ./static/mstile-150x150.png + file_server + } + + handle_path /sitemap.xml { + root * ./static/sitemap.xml + file_server + } + + handle_path /android-chrome-192x192.png { + root * ./static/android-chrome-192x192.png + file_server + } + + handle_path /security.txt { + root * ./static/security.txt + file_server + } + + handle_path /safari-pinned-tab.svg { + root * ./static/safari-pinned-tab.svg + file_server + } + + handle_path /mstile-310x310.png { + root * ./static/mstile-310x310.png + file_server + } + + handle_path /favicon-16x16.png { + root * ./static/favicon-16x16.png + file_server + } + + handle_path /mstile-310x150.png { + root * ./static/mstile-310x150.png + file_server + } + + handle_path /mstile-70x70.png { + root * ./static/mstile-70x70.png + file_server + } + + handle_path /favicon.ico { + root * ./static/favicon.ico + file_server + } + + handle_path /graphql/websocket { + respond "Access denied" 403 + } + handle_path /onboarding/* { respond "Access denied" 403 } diff --git a/CaddyfileProd b/CaddyfileProd index 6c94430..683f2f5 100644 --- a/CaddyfileProd +++ b/CaddyfileProd @@ -5,13 +5,8 @@ freedium.cfd { header -Server - handle_path /site.webmanifest { - root * ./static/site.webmanifest - file_server - } - - handle_path /favicon-32x32.png { - root * ./static/favicon-32x32.png + handle_path /android-chrome-512x512.png { + root * ./static/android-chrome-512x512.png file_server } @@ -20,68 +15,8 @@ freedium.cfd { file_server } - handle_path /ads.txt { - root * ./static/ads.txt - file_server - } - - handle_path /humans.txt { - root * ./static/humans.txt - file_server - } - - handle_path /mstile-150x150.png { - root * ./static/mstile-150x150.png - file_server - } - - handle_path /mstile-310x310.png { - root * ./static/mstile-310x310.png - file_server - } - - handle_path /sitemap.xml { - root * ./static/sitemap.xml - file_server - } - - handle_path /99860281ef1143d5a5558ad9a21a470d.txt { - root * ./static/99860281ef1143d5a5558ad9a21a470d.txt - file_server - } - - handle_path /mstile-70x70.png { - root * ./static/mstile-70x70.png - file_server - } - - handle_path /android-chrome-192x192.png { - root * ./static/android-chrome-192x192.png - file_server - } - - handle_path /mstile-310x150.png { - root * ./static/mstile-310x150.png - file_server - } - - handle_path /safari-pinned-tab.svg { - root * ./static/safari-pinned-tab.svg - file_server - } - - handle_path /android-chrome-512x512.png { - root * ./static/android-chrome-512x512.png - file_server - } - - handle_path /favicon-16x16.png { - root * ./static/favicon-16x16.png - file_server - } - - handle_path /favicon.ico { - root * ./static/favicon.ico + handle_path /site.webmanifest { + root * ./static/site.webmanifest file_server } @@ -95,8 +30,8 @@ freedium.cfd { file_server } - handle_path /security.txt { - root * ./static/security.txt + handle_path /favicon-32x32.png { + root * ./static/favicon-32x32.png file_server } @@ -105,6 +40,65 @@ freedium.cfd { file_server } + handle_path /humans.txt { + root * ./static/humans.txt + file_server + } + + handle_path /mstile-150x150.png { + root * ./static/mstile-150x150.png + file_server + } + + handle_path /sitemap.xml { + root * ./static/sitemap.xml + file_server + } + + handle_path /android-chrome-192x192.png { + root * ./static/android-chrome-192x192.png + file_server + } + + handle_path /security.txt { + root * ./static/security.txt + file_server + } + + handle_path /safari-pinned-tab.svg { + root * ./static/safari-pinned-tab.svg + file_server + } + + handle_path /mstile-310x310.png { + root * ./static/mstile-310x310.png + file_server + } + + handle_path /favicon-16x16.png { + root * ./static/favicon-16x16.png + file_server + } + + handle_path /mstile-310x150.png { + root * ./static/mstile-310x150.png + file_server + } + + handle_path /mstile-70x70.png { + root * ./static/mstile-70x70.png + file_server + } + + handle_path /favicon.ico { + root * ./static/favicon.ico + file_server + } + + handle_path /graphql/websocket { + respond "Access denied" 403 + } + handle_path /onboarding/* { respond "Access denied" 403 } diff --git a/scripts/generate_caddy_rules.py b/scripts/generate_caddy_rules.py index bb2fd1b..9b938df 100644 --- a/scripts/generate_caddy_rules.py +++ b/scripts/generate_caddy_rules.py @@ -21,7 +21,7 @@ for file in static_files: OUTPUT_RULES.append(file_template) -ACCESS_DENIED_PATHS = ["onboarding/*", "wp-*", ".env", "api*", "apple-touch-icon-precomposed.png", "rss.xml", ".git/*", "apple-touch-icon-120x120.png", "apple-touch-icon-120x120-precomposed.png", "apple-touch-icon-152x152.png", "apple-touch-icon-152x152-precomposed.png", ".well-known/*"] +ACCESS_DENIED_PATHS = ["graphql/websocket", "onboarding/*", "wp-*", ".env", "api*", "apple-touch-icon-precomposed.png", "rss.xml", ".git/*", "apple-touch-icon-120x120.png", "apple-touch-icon-120x120-precomposed.png", "apple-touch-icon-152x152.png", "apple-touch-icon-152x152-precomposed.png", ".well-known/*"] access_denied_paths_template = """ handle_path /{{ file }} {