From d6ab547055ab1728d4a7a2a5caa8e15c8cc05e30 Mon Sep 17 00:00:00 2001 From: Jared Vu Date: Mon, 30 Oct 2023 15:17:12 -0700 Subject: [PATCH] Update README.md (#111) * Add README in scripts directory * Add Cloudflare instructions to README --- README.md | 25 +++++++++++++++++++++---- scripts/README.md | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 scripts/README.md diff --git a/README.md b/README.md index 5a5cbea..08ba6ef 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Alternatively, follow theĀ [IPFS Kubo installation guide](https://docs.ipfs.tech ## Part 1: Setting up your local environment -### Step 1: Clone the repo +### 1. Clone the repo Clone the repository and navigate to its directory: @@ -35,7 +35,7 @@ git clone https://github.com/dydxprotocol/v4-web.git cd v4-web ``` -### Step 2: Install pnpm and dependencies +### 2. Install pnpm and dependencies Install pnpm and the project dependencies: @@ -69,7 +69,9 @@ You'll need to provide a Wallet Connect project id to enable onboarding and wall - Create a project on https://cloud.walletconnect.com/app - Copy over the project ID into this [field](https://github.com/dydxprotocol/v4-web/blob/67ecbd75b43e0c264b7b4d2d9b3d969830b0621c/public/configs/env.json#L822C33-L822C46) -## Part 4: Deploying with Vercel +# Deployments + +## Deploying with Vercel ### Step 1: Connect your repository to Vercel @@ -86,7 +88,7 @@ If you wish to incorporate analytics via Amplitude and Bugsnag, you can use our For more details, check out Vercel's [official documentation](https://vercel.com/docs). -## Part 5: Deploying to IPFS +## Deploying to IPFS ### web3.storage: deploy to IPFS via web3.storage using the provided script @@ -118,3 +120,18 @@ To access your content on IPFS: 2. **Public IPFS gateway:** Access your content via a public IPFS gateway, such as [https://dweb.link](https://dweb.link/) or [https://w3s.link/](https://w3s.link/). Use the gateway URL with your CID appended, like `https://dweb.link/ipfs/your_cid`. Replace `your_cid` with the actual CID. + +## Cloudflare Settings + +We recommend that you add your website to Cloudflare for additional security settings. + +To block OFAC Sanctioned countries: +1. Navigate Websites > Domain > Security > WAF + +2. Create Rule with the following settings: + * If incoming requests match +`(ip.geoip.country eq "CU") or (ip.geoip.country eq "IR") or (ip.geoip.country eq "KP") or (ip.geoip.country eq "SY") or (ip.geoip.country eq "MM") or (ip.geoip.subdivision_1_iso_code eq "UA-09") or (ip.geoip.subdivision_1_iso_code eq "UA-14") or (ip.geoip.subdivision_1_iso_code eq "UA-43")` + * This rule will bring up a Cloudflare page when a restricted geography tries to access your site. You will have the option to display: + 1. Custom Text + - (e.g. `Because you appear to be a resident of, or trading from, a jurisdiction that violates our terms of use, or have engaged in activity that violates our terms of use, you have been blocked. You may withdraw your funds from the protocol at any time.`) + 2. Default Cloudflare WAF block page diff --git a/scripts/README.md b/scripts/README.md new file mode 100644 index 0000000..dea4d27 --- /dev/null +++ b/scripts/README.md @@ -0,0 +1,38 @@ +## App Integrations +### Amplitude +Analytics service used to collect data to help the dYdX Product team make informed product decisions. + +To use with dydxprotocol/v4-web: +1. Amplitude account with API key. +2. Add API key in Github > Secrets and Variables > Actions as `AMPLITUDE_API_KEY` +3. In your deploy scripts add `pnpm run build:inject-amplitude` after your pnpm build / vite build command. + +### Bugsnag +Error handling service used to collect handled/unhandled errors within the app. The information collected is used to help debug and alert the engineering team of crashes/unhandled errors within the app to improve stability. + +To use with dydxprotocol/v4-web: +1. Bugsnag account with API key. +2. Add API key in Github > Secrets and Variables > Actions as `BUGSNAG_API_KEY` +3. In your deploy scripts add `pnpm run build:inject-bugsnag` after your pnpm build / vite build command. +4. If you are using with the Amplitude deployment scripts, your build command may look like the following: `pnpm build && pnpm run build:inject-amplitude && pnpm run build:inject-bugsnag` + +### StatusPage +Service used to inform users of any status updates to our platform. These status updates are manually set and updated by the On Call engineers. + +To use with dydxprotocol/v4-web: +1. StatusPage account and script URI +2. Add API key in Github > Secrets and Variables > Actions as `STATUS_PAGE_SCRIPT_URI` +3. In your deploy scripts add `pnpm run build:inject-statuspage` after your pnpm build / vite build command. +4. If you are using with the Amplitude deployment scripts, your build command may look like the following: `pnpm build && pnpm run build:inject-amplitude && pnpm run build:inject-statuspage` + +### Intercom +Service used for live customer support (chat/inbox) as well as home for Help Articles. + +To use with dydxprotocol/v4-web: +1. Create Intercom account +2. In Intercom UI +Getting started > Set up Messenger > will give you your API Key on Step 2 +Customize Intercom Messenger by adding logo and brand colors +3. Add API key in Github > Secrets and Variables > Actions as `INTERCOM_APP_ID` +4. In your deploy scripts add `pnpm run build:inject-intercom` after your pnpm build / vite build command. +5. If you are using with the Amplitude deployment scripts, your build command may look like the following: `pnpm build && pnpm run build:inject-amplitude && pnpm run build:inject-intercom`