From 26e1c5f50492387578a20180f4c0007ac85b2f1d Mon Sep 17 00:00:00 2001 From: Jycssu Date: Wed, 12 Jun 2024 14:00:06 +0200 Subject: [PATCH] chore: rename env name for thegraph api key Remove the NEXT_PUBLIC_ prefix because it's now a runtime variable --- .env.sample | 2 +- .github/workflows/branch.yml | 2 +- README.md | 4 ++-- docker-compose-branch.yml | 2 +- src/pages/_app.tsx | 7 ++----- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.env.sample b/.env.sample index 2f90ae2..2307bc5 100644 --- a/.env.sample +++ b/.env.sample @@ -1,3 +1,3 @@ BUILD_ENV= COMMUNITY_API_KEY= -NEXT_PUBLIC_THEGRAPH_API_KEY= +THEGRAPH_API_KEY= diff --git a/.github/workflows/branch.yml b/.github/workflows/branch.yml index e7f456d..d752e0a 100644 --- a/.github/workflows/branch.yml +++ b/.github/workflows/branch.yml @@ -77,5 +77,5 @@ jobs: docker login -u ${{ secrets.DOCKER_LOGIN }} -p ${{ secrets.DOCKER_PASSWD }} ${DOCKER_REGISTRY} docker compose --project-name ${{ github.ref_name }}-dashboard --file docker-compose-branch.yml up -d' env: - NEXT_PUBLIC_THEGRAPH_API_KEY: ${{ secrets.NEXT_PUBLIC_THEGRAPH_API_KEY }} + THEGRAPH_API_KEY: ${{ secrets.THEGRAPH_API_KEY }} COMMUNITY_API_KEY: ${{ secrets.COMMUNITY_API_KEY }} diff --git a/README.md b/README.md index c4c5720..920d7d0 100644 --- a/README.md +++ b/README.md @@ -18,12 +18,12 @@ To run the project you will need to set-up a `.env` file in the root folder: ``` COMMUNITY_API_KEY=XXXXXXXXXXXX -NEXT_PUBLIC_THEGRAPH_API_KEY=XXXXXXXXXXXX +THEGRAPH_API_KEY=XXXXXXXXXXXX ``` To get a `COMMUNITY_API_KEY`, join the dedicated [telegram dev channel](https://t.me/+XQyoaFfmN61yk7X0) then ask for. -To get a NEXT_PUBLIC_THEGRAPH_API_KEY, you need to create an account on thegraph.com [Thegraph docs](https://thegraph.com/docs/en/querying/managing-api-keys/) +To get a THEGRAPH_API_KEY, you need to create an account on thegraph.com [Thegraph docs](https://thegraph.com/docs/en/querying/managing-api-keys/) ### Node.js version diff --git a/docker-compose-branch.yml b/docker-compose-branch.yml index b29c869..2545edd 100644 --- a/docker-compose-branch.yml +++ b/docker-compose-branch.yml @@ -3,7 +3,7 @@ services: image: ${DOCKER_REGISTRY}/dashboard:${DOCKER_BRANCH} container_name: ${DOCKER_BRANCH}-dashboard environment: - - NEXT_PUBLIC_THEGRAPH_API_KEY=$NEXT_PUBLIC_THEGRAPH_API_KEY + - THEGRAPH_API_KEY=$THEGRAPH_API_KEY - COMMUNITY_API_KEY=$COMMUNITY_API_KEY networks: - traefik-realt diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 67d572a..3496166 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -72,8 +72,7 @@ const libraryConnectors = getConnectors({ export const getServerSideProps = async () => ({ props: { - THEGRAPH_API_KEY: - process.env.THEGRAPH_API_KEY ?? process.env.NEXT_PUBLIC_THEGRAPH_API_KEY, + THEGRAPH_API_KEY: process.env.THEGRAPH_API_KEY, }, }) @@ -120,9 +119,7 @@ const App = ({ Component, pageProps, colorScheme, env }: AppProps) => { App.getInitialProps = ({ ctx }: { ctx: GetServerSidePropsContext }) => { return { env: { - THEGRAPH_API_KEY: - process.env.THEGRAPH_API_KEY ?? - process.env.NEXT_PUBLIC_THEGRAPH_API_KEY, + THEGRAPH_API_KEY: process.env.THEGRAPH_API_KEY, }, colorScheme: getCookie('mantine-color-scheme', ctx) || 'dark', locale: getCookie('react-i18next', ctx) || 'fr',