From dc74a1101b9d6019263b191b2d1f1b2d2aeb799e Mon Sep 17 00:00:00 2001 From: Edd Date: Wed, 25 Oct 2023 11:54:06 +0100 Subject: [PATCH] feat: add geo restrictions --- src/pages/restricted/index.js | 25 +++++++++++++++ vercel.json | 60 +++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 src/pages/restricted/index.js diff --git a/src/pages/restricted/index.js b/src/pages/restricted/index.js new file mode 100644 index 00000000..0a135fa9 --- /dev/null +++ b/src/pages/restricted/index.js @@ -0,0 +1,25 @@ +import * as React from 'react' +import CrossLarge from '../../components/Svg/CrossLarge' + +const RestrictedPage = () => { + return ( +
+
+
+
+ +
+
+

+ Due to uncertainty about the legal and regulatory status of the + content hosted on this site, it is not available to visitors in + your jurisdiction. +

+
+
+
+
+ ) +} + +export default RestrictedPage diff --git a/vercel.json b/vercel.json index 2fda516d..b1cee7c8 100644 --- a/vercel.json +++ b/vercel.json @@ -6,6 +6,66 @@ } }, "redirects": [ + { + "source": "/:path((?!restricted|assets).*)", + "has": [ + { + "type": "header", + "key": "x-vercel-ip-country", + "value": "US" + } + ], + "permanent": false, + "destination": "/restricted" + }, + { + "source": "/:path((?!restricted|assets).*)", + "has": [ + { + "type": "header", + "key": "x-vercel-ip-country", + "value": "CU" + } + ], + "permanent": false, + "destination": "/restricted" + }, + { + "source": "/:path((?!restricted|assets).*)", + "has": [ + { + "type": "header", + "key": "x-vercel-ip-country", + "value": "KP" + } + ], + "permanent": false, + "destination": "/restricted" + }, + { + "source": "/:path((?!restricted|assets).*)", + "has": [ + { + "type": "header", + "key": "x-vercel-ip-country", + "value": "IR" + } + ], + "permanent": false, + "destination": "/restricted" + }, + { + "source": "/:path((?!restricted).*)", + "has": [ + { + "type": "header", + "key": "x-vercel-ip-country", + "value": "SY" + } + ], + "permanent": false, + "destination": "/restricted" + }, { "source": "/discord", "destination": "https://discord.gg/3hQyGgZ"