From d61dcfa7eecc53a8d82dca9bd236e57d4cde1b70 Mon Sep 17 00:00:00 2001 From: Benoit Simard Date: Mon, 4 Mar 2024 15:33:01 +0100 Subject: [PATCH] CRA to Vite migration for env variables Fix #144 --- .github/workflows/deploy-app.yml | 2 +- README.md | 6 +++--- src/config.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-app.yml b/.github/workflows/deploy-app.yml index ec8af96..44e9a5d 100644 --- a/.github/workflows/deploy-app.yml +++ b/.github/workflows/deploy-app.yml @@ -9,7 +9,7 @@ jobs: env: CI: false PUBLIC_URL: "/gephi-lite" - REACT_APP_GITHUB_PROXY: "https://githubapi.gephi.org" + VITE_GITHUB_PROXY: "https://githubapi.gephi.org" steps: - name: Checkout uses: actions/checkout@v2 diff --git a/README.md b/README.md index 616cb61..785df04 100644 --- a/README.md +++ b/README.md @@ -55,15 +55,15 @@ Your Gephi Lite is ready to be deployed! To allow users to synchronize their data with GitHub, Gephi Lite needs a reverse proxy to avoid CORS issues. When working locally in development, [we use `http-proxy-middleware`](https://github.com/gephi/gephi-lite/blob/main/vite.config.js) to make that work. -To deploy the application, you need to define the env variable `REACT_APP_GITHUB_PROXY` before building it, by following those steps: +To deploy the application, you need to define the env variable `VITE_GITHUB_PROXY` before building it, by following those steps: ``` -$> REACT_APP_GITHUB_PROXY=mydomain.for.github.auth.proxy.com +$> VITE_GITHUB_PROXY=mydomain.for.github.auth.proxy.com $> npm install $> npm run build ``` -On [gephi.org/gephi-lite](https://gephi.org/gephi-lite) we use this settings : `REACT_APP_GITHUB_PROXY: "https://githubapi.gephi.org"`. +On [gephi.org/gephi-lite](https://gephi.org/gephi-lite) we use this settings : `VITE_GITHUB_PROXY: "https://githubapi.gephi.org"`. Then on our server, we configured NGINX with this following settings: diff --git a/src/config.ts b/src/config.ts index d8447e8..8a95629 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,7 +1,7 @@ export const config = { website_url: "https://github.com/gephi/gephi-lite#readme", notificationTimeoutMs: 3000, - github_proxy: import.meta.env.REACT_APP_GITHUB_PROXY || "/_github", + github_proxy: import.meta.env.VITE_GITHUB_PROXY || "/_github", github: { client_id: "938f561199e6e55c739b", scopes: ["gist"],