From 1d6c1aad3b08d200efcdf3813660dfad24992a3a Mon Sep 17 00:00:00 2001 From: Giancarlo Otarola Date: Thu, 12 Nov 2020 13:27:54 -0300 Subject: [PATCH 1/7] add logs for api client and add tag name and name when downloading the daemon --- public/electron/clients/api/index.js | 3 +++ scripts/download-daemon.js | 22 ++++++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/public/electron/clients/api/index.js b/public/electron/clients/api/index.js index 0f5d4ba9..b3349b47 100644 --- a/public/electron/clients/api/index.js +++ b/public/electron/clients/api/index.js @@ -1,5 +1,8 @@ const ApiClient = require('./client'); +// eslint-disable-next-line no-console +console.log(`Init ApiClient pointing to: ${process.env.SPACE_SERVICES_URL}`); + const apiClient = new ApiClient({ timeout: 5000, baseURL: process.env.SPACE_SERVICES_URL || 'https://api-dev.space.storage', diff --git a/scripts/download-daemon.js b/scripts/download-daemon.js index 3c3bfa46..15de47eb 100644 --- a/scripts/download-daemon.js +++ b/scripts/download-daemon.js @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ const fs = require('fs-extra'); const path = require('path'); const axios = require('axios'); @@ -24,16 +25,13 @@ async function getDaemon() { responseType: 'stream', url: daemonURL, }).catch((error) => { - // eslint-disable-next-line no-console console.error(`\nError when trying to download the daemon binary from: ${daemonURL}`); - // eslint-disable-next-line no-console console.error(`Error : ${error.stack || error.message}`); process.exit(1); }); const totalLength = headers['content-length']; - // eslint-disable-next-line no-console console.log(`Downloading space daemon binary from ${daemonURL}:`); const progressBar = new ProgressBar(`File: ${headers['content-disposition'].split(';')[1].trim()} [:bar] :percent :etas`, { width: 40, @@ -55,21 +53,29 @@ async function getDaemon() { data.destroy(); writer.destroy(); - // eslint-disable-next-line no-console console.error(`\nError when downloading the space daemon binary: ${error.stack || error.message}`); process.exit(1); }); - writer.on('finish', () => { - // eslint-disable-next-line no-console - console.log('Space daemon was download successfully!'); + writer.on('finish', async () => { + let tag = ''; + let name = ''; + try { + const { data: spaceDaemonReleaseInfo } = await axios.get('https://api.github.com/repos/FleekHQ/space-daemon/releases/latest'); + name = spaceDaemonReleaseInfo.name; + tag = spaceDaemonReleaseInfo.tag_name; + } catch (error) { + console.error(`Could not get space daemon name and tag info: ${error.message}`); + } + console.log('Space daemon was download successfully:'); + console.log(`\t•Tag: ${tag}`); + console.log(`\t•Name: ${name}`); process.exit(0); }); writer.on('error', (error) => { writer.destroy(); - // eslint-disable-next-line no-console console.error(`\nError when saving the space daemon binary: ${error.stack || error.message}`); process.exit(1); }); From 46ee61364f03a50acd7a1d8ae184738586b03d8f Mon Sep 17 00:00:00 2001 From: Giancarlo Otarola Date: Thu, 12 Nov 2020 16:18:57 -0300 Subject: [PATCH 2/7] move some config fields to env vars --- .github/workflows/release.yml | 13 ++++++++++--- public/electron/clients/api/index.js | 4 ++-- src/config.js | 27 ++++++++++++++++++--------- 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4d377df2..efb0e7d2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,6 +31,9 @@ jobs: - name: Get daemon run: yarn download-daemon - name: Linux app pack and release + env: + SPACE_SERVICES_URL: ${{secrets.SPACE_SERVICES_URL}} + REACT_APP_FE_NODE_ENV: ${{secrets.REACT_APP_FE_NODE_ENV}} if: matrix.os == 'ubuntu-latest' run: yarn electron-pack --linux - name: MacOS app pack and release @@ -39,11 +42,15 @@ jobs: APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} CSC_LINK: ${{ secrets.CSC_LINK }} CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} + SPACE_SERVICES_URL: ${{secrets.SPACE_SERVICES_URL}} + REACT_APP_FE_NODE_ENV: ${{secrets.REACT_APP_FE_NODE_ENV}} if: matrix.os == 'macos-latest' run: yarn electron-pack --mac - name: Windows app pack and release - # env: - # CSC_LINK: ${{ secrets.WIN_CSC_LINK }} - # CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }} + env: + SPACE_SERVICES_URL: ${{secrets.SPACE_SERVICES_URL}} + REACT_APP_FE_NODE_ENV: ${{secrets.REACT_APP_FE_NODE_ENV}} + # CSC_LINK: ${{ secrets.WIN_CSC_LINK }} + # CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }} if: matrix.os == 'windows-latest' run: yarn electron-pack --win --x64 --ia32 diff --git a/public/electron/clients/api/index.js b/public/electron/clients/api/index.js index b3349b47..7500dfb0 100644 --- a/public/electron/clients/api/index.js +++ b/public/electron/clients/api/index.js @@ -1,11 +1,11 @@ const ApiClient = require('./client'); // eslint-disable-next-line no-console -console.log(`Init ApiClient pointing to: ${process.env.SPACE_SERVICES_URL}`); +console.log(`Init ApiClient, URL: ${process.env.SPACE_SERVICES_URL}`); const apiClient = new ApiClient({ timeout: 5000, - baseURL: process.env.SPACE_SERVICES_URL || 'https://api-dev.space.storage', + baseURL: process.env.SPACE_SERVICES_URL, }); module.exports = apiClient; diff --git a/src/config.js b/src/config.js index d3530726..d90f5a09 100644 --- a/src/config.js +++ b/src/config.js @@ -1,16 +1,25 @@ -const { REACT_APP_FE_NODE_ENV } = process.env; +const { + REACT_APP_FE_NODE_ENV, + TORUS_GOOGLE_VERIFIER = 'space-google-testnet', + TORUS_TWITTER_VERIFIER = 'fleek-auth0-twitter', + TORUS_TWITTER_CLIENT_ID = 'jMfyGURX9wbS3GpusgLOZkvOn0AvIaJj', + TORUS_TWITTER_AUTH_DOMAIN = 'https://space-twitter.us.auth0.com', + TORUS_PROVIDERS_REDIRECT_URL = 'https://floral-mountain-2401.on.fleek.co/', + WS_AUTH_CHALLENGE_URL = 'wss://gqo1oqz055.execute-api.us-west-2.amazonaws.com/dev', + TORUS_GOOGLE_CLIENT_ID = '480855465278-s0lcvq0m4hpn5hokhgs8s1ujfe3lbk4f.apps.googleusercontent.com', +} = process.env; const config = { development: { ws: { - url: 'wss://gqo1oqz055.execute-api.us-west-2.amazonaws.com/dev', + url: WS_AUTH_CHALLENGE_URL, }, torus: { sdkConfig: { - enableLogging: true, + enableLogging: REACT_APP_FE_NODE_ENV !== 'production', redirectToOpener: true, redirectPathName: 'redirect.html', - baseUrl: 'https://floral-mountain-2401.on.fleek.co/', + baseUrl: TORUS_PROVIDERS_REDIRECT_URL, proxyContractAddress: '0x4023d2a0D330bF11426B12C6144Cfb96B7fa6183', // details for test net network: 'testnet', // details for test net }, @@ -18,17 +27,17 @@ const config = { google: { name: 'Google', typeOfLogin: 'google', - clientId: '480855465278-s0lcvq0m4hpn5hokhgs8s1ujfe3lbk4f.apps.googleusercontent.com', - verifier: 'space-google-testnet', jwtParams: {}, + verifier: TORUS_GOOGLE_VERIFIER, + clientId: TORUS_GOOGLE_CLIENT_ID, }, twitter: { name: 'Twitter', typeOfLogin: 'twitter', - clientId: 'jMfyGURX9wbS3GpusgLOZkvOn0AvIaJj', - verifier: 'fleek-auth0-twitter', + verifier: TORUS_TWITTER_VERIFIER, + clientId: TORUS_TWITTER_CLIENT_ID, jwtParams: { - domain: 'https://space-twitter.us.auth0.com', + domain: TORUS_TWITTER_AUTH_DOMAIN, }, }, }, From ab2ee531bb1e269044ce9af25451a90f215619dd Mon Sep 17 00:00:00 2001 From: Giancarlo Otarola Date: Thu, 12 Nov 2020 16:19:11 -0300 Subject: [PATCH 3/7] add .env.example file --- .env.example | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..ec08e9e1 --- /dev/null +++ b/.env.example @@ -0,0 +1,15 @@ +DEV_DAEMON=false +DAEMON_PATH="/Users//go/src/space-daemon" + +SPACE_SERVICES_URL="https://api-dev.space.storage" +SPACE_BILLING_SERVICE_URL="https://7ll1etbd0m.execute-api.us-west-2.amazonaws.com/dev" +WS_AUTH_CHALLENGE_URL="wss://gqo1oqz055.execute-api.us-west-2.amazonaws.com/dev" + +REACT_APP_FE_NODE_ENV="production" + +TORUS_GOOGLE_VERIFIER="space-google-testnet" +TORUS_TWITTER_VERIFIER="fleek-auth0-twitter" +TORUS_TWITTER_CLIENT_ID="jMfyGURX9wbS3GpusgLOZkvOn0AvIaJj" +TORUS_TWITTER_AUTH_DOMAIN="https://space-twitter.us.auth0.com" +TORUS_PROVIDERS_REDIRECT_URL="https://floral-mountain-2401.on.fleek.co/" +TORUS_GOOGLE_CLIENT_ID="480855465278-s0lcvq0m4hpn5hokhgs8s1ujfe3lbk4f.apps.googleusercontent.com" \ No newline at end of file From a566942b0490b16643ef07e73fc8006094bdadc6 Mon Sep 17 00:00:00 2001 From: Giancarlo Otarola Date: Fri, 13 Nov 2020 11:58:52 -0300 Subject: [PATCH 4/7] add .env.example file and move config fields to env file --- .env.example | 20 ++--- .github/workflows/release.yml | 16 ++-- README.md | 6 +- package.json | 9 +-- public/electron/clients/api/index.js | 5 +- src/config.js | 105 +++++++++------------------ 6 files changed, 65 insertions(+), 96 deletions(-) diff --git a/.env.example b/.env.example index ec08e9e1..4e00a954 100644 --- a/.env.example +++ b/.env.example @@ -1,15 +1,15 @@ DEV_DAEMON=false -DAEMON_PATH="/Users//go/src/space-daemon" +DAEMON_PATH=/path/to/daemon SPACE_SERVICES_URL="https://api-dev.space.storage" SPACE_BILLING_SERVICE_URL="https://7ll1etbd0m.execute-api.us-west-2.amazonaws.com/dev" -WS_AUTH_CHALLENGE_URL="wss://gqo1oqz055.execute-api.us-west-2.amazonaws.com/dev" +REACT_APP_WS_AUTH_CHALLENGE_URL="wss://gqo1oqz055.execute-api.us-west-2.amazonaws.com/dev" -REACT_APP_FE_NODE_ENV="production" - -TORUS_GOOGLE_VERIFIER="space-google-testnet" -TORUS_TWITTER_VERIFIER="fleek-auth0-twitter" -TORUS_TWITTER_CLIENT_ID="jMfyGURX9wbS3GpusgLOZkvOn0AvIaJj" -TORUS_TWITTER_AUTH_DOMAIN="https://space-twitter.us.auth0.com" -TORUS_PROVIDERS_REDIRECT_URL="https://floral-mountain-2401.on.fleek.co/" -TORUS_GOOGLE_CLIENT_ID="480855465278-s0lcvq0m4hpn5hokhgs8s1ujfe3lbk4f.apps.googleusercontent.com" \ No newline at end of file +REACT_APP_TORUS_NETWORK= +REACT_APP_TORUS_GOOGLE_VERIFIER= +REACT_APP_TORUS_TWITTER_VERIFIER= +REACT_APP_TORUS_TWITTER_CLIENT_ID= +REACT_APP_TORUS_TWITTER_AUTH_DOMAIN= +REACT_APP_TORUS_PROXY_CONTRACT= +REACT_APP_TORUS_PROVIDERS_REDIRECT_URL= +REACT_APP_TORUS_GOOGLE_CLIENT_ID= \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index efb0e7d2..ce9fadb0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,15 @@ jobs: FA_NPM_TOKEN: ${{secrets.FA_NPM_TOKEN}} TERMINAL_NPM_TOKEN: ${{secrets.TERMINAL_NPM_TOKEN}} SPACE_SERVICES_URL: ${{secrets.SPACE_SERVICES_URL}} - REACT_APP_FE_NODE_ENV: ${{secrets.REACT_APP_FE_NODE_ENV}} + REACT_APP_TORUS_NETWORK: ${{secrets.REACT_APP_TORUS_NETWORK}} + REACT_APP_TORUS_PROXY_CONTRACT: ${{secrets.REACT_APP_TORUS_PROXY_CONTRACT}} + REACT_APP_TORUS_GOOGLE_VERIFIER: ${{secrets.REACT_APP_TORUS_GOOGLE_VERIFIER}} + REACT_APP_WS_AUTH_CHALLENGE_URL: ${{secrets.REACT_APP_WS_AUTH_CHALLENGE_URL}} + REACT_APP_TORUS_TWITTER_VERIFIER: ${{secrets.REACT_APP_TORUS_TWITTER_VERIFIER}} + REACT_APP_TORUS_GOOGLE_CLIENT_ID: ${{secrets.REACT_APP_TORUS_GOOGLE_CLIENT_ID}} + REACT_APP_TORUS_TWITTER_CLIENT_ID: ${{secrets.REACT_APP_TORUS_TWITTER_CLIENT_ID}} + REACT_APP_TORUS_TWITTER_AUTH_DOMAIN: ${{secrets.REACT_APP_TORUS_TWITTER_AUTH_DOMAIN}} + REACT_APP_TORUS_PROVIDERS_REDIRECT_URL: ${{secrets.REACT_APP_TORUS_PROVIDERS_REDIRECT_URL}} strategy: fail-fast: false matrix: @@ -42,14 +50,10 @@ jobs: APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} CSC_LINK: ${{ secrets.CSC_LINK }} CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} - SPACE_SERVICES_URL: ${{secrets.SPACE_SERVICES_URL}} - REACT_APP_FE_NODE_ENV: ${{secrets.REACT_APP_FE_NODE_ENV}} if: matrix.os == 'macos-latest' run: yarn electron-pack --mac - name: Windows app pack and release - env: - SPACE_SERVICES_URL: ${{secrets.SPACE_SERVICES_URL}} - REACT_APP_FE_NODE_ENV: ${{secrets.REACT_APP_FE_NODE_ENV}} + # env: # CSC_LINK: ${{ secrets.WIN_CSC_LINK }} # CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }} if: matrix.os == 'windows-latest' diff --git a/README.md b/README.md index 24de8e0f..0cd0b181 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -![Test Action Status](https://github.com/FleekHQ/desktop-storage/workflows/Test/badge.svg) -![Build-Pack-Release Action Status](https://github.com/FleekHQ/desktop-storage/workflows/Build-Pack-Release/badge.svg) +![Test Action Status](https://github.com/FleekHQ/space-desktop/workflows/Test/badge.svg) +![Build-Pack-Release Action Status](https://github.com/FleekHQ/space-desktop/workflows/Build-Pack-Release/badge.svg) This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). @@ -84,4 +84,4 @@ For the release process, will be just necessary to create and merge a PR from `d **Note 2**: By running `npm version `, the tag is automatically created with `v`, it just required to be pushed. Ex, `git push origin --tags `. * Create a draft release selecting the tag version previously pushed. -After doing those actions, we are ready to create the PR to make the app release. When the release PR (`develop` to `master`) is merged, the CI process will be in charge of generating the installer for each OS (mac, linux, and windows) and links to the installers will be available on the [repository releases page](https://github.com/FleekHQ/desktop-storage/releases) based on the app version. +After doing those actions, we are ready to create the PR to make the app release. When the release PR (`develop` to `master`) is merged, the CI process will be in charge of generating the installer for each OS (mac, linux, and windows) and links to the installers will be available on the [repository releases page](https://github.com/FleekHQ/space-desktop/releases) based on the app version. diff --git a/package.json b/package.json index 50fd8790..8f4c786d 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "homepage": "./", "repository": { "type": "git", - "url": "https://github.com/FleekHQ/desktop-storage.git" + "url": "https://github.com/FleekHQ/space-desktop.git" }, "scripts": { "start": "node scripts/start.js", @@ -167,9 +167,8 @@ }, "publish": { "provider": "github", - "repo": "desktop-storage", - "owner": "FleekHQ", - "private": true + "repo": "space-desktop", + "owner": "FleekHQ" }, "files": [ "build/**/*", @@ -207,7 +206,7 @@ "icon": "build/icon.png", "iconSize": 70, "contents": [ - { "x": 129, "y": 217, "type": "file", "path": "Space.app" }, + { "x": 129, "y": 217, "type": "file" }, { "x": 481, "y": 217, "type": "link", "path": "/Applications" } ] } diff --git a/public/electron/clients/api/index.js b/public/electron/clients/api/index.js index 7500dfb0..fbc2f230 100644 --- a/public/electron/clients/api/index.js +++ b/public/electron/clients/api/index.js @@ -1,11 +1,12 @@ const ApiClient = require('./client'); +const baseURL = process.env.SPACE_SERVICES_URL || 'https://api.space.storage'; // eslint-disable-next-line no-console -console.log(`Init ApiClient, URL: ${process.env.SPACE_SERVICES_URL}`); +console.log(`Init ApiClient, URL: ${baseURL}`); const apiClient = new ApiClient({ + baseURL, timeout: 5000, - baseURL: process.env.SPACE_SERVICES_URL, }); module.exports = apiClient; diff --git a/src/config.js b/src/config.js index d90f5a09..701ddda1 100644 --- a/src/config.js +++ b/src/config.js @@ -1,81 +1,46 @@ const { - REACT_APP_FE_NODE_ENV, - TORUS_GOOGLE_VERIFIER = 'space-google-testnet', - TORUS_TWITTER_VERIFIER = 'fleek-auth0-twitter', - TORUS_TWITTER_CLIENT_ID = 'jMfyGURX9wbS3GpusgLOZkvOn0AvIaJj', - TORUS_TWITTER_AUTH_DOMAIN = 'https://space-twitter.us.auth0.com', - TORUS_PROVIDERS_REDIRECT_URL = 'https://floral-mountain-2401.on.fleek.co/', - WS_AUTH_CHALLENGE_URL = 'wss://gqo1oqz055.execute-api.us-west-2.amazonaws.com/dev', - TORUS_GOOGLE_CLIENT_ID = '480855465278-s0lcvq0m4hpn5hokhgs8s1ujfe3lbk4f.apps.googleusercontent.com', + NODE_ENV, + REACT_APP_TORUS_NETWORK, + REACT_APP_TORUS_GOOGLE_VERIFIER, + REACT_APP_TORUS_TWITTER_VERIFIER, + REACT_APP_TORUS_TWITTER_CLIENT_ID, + REACT_APP_TORUS_TWITTER_AUTH_DOMAIN, + REACT_APP_TORUS_PROXY_CONTRACT, + REACT_APP_TORUS_PROVIDERS_REDIRECT_URL, + REACT_APP_WS_AUTH_CHALLENGE_URL, + REACT_APP_TORUS_GOOGLE_CLIENT_ID, } = process.env; -const config = { - development: { - ws: { - url: WS_AUTH_CHALLENGE_URL, - }, - torus: { - sdkConfig: { - enableLogging: REACT_APP_FE_NODE_ENV !== 'production', - redirectToOpener: true, - redirectPathName: 'redirect.html', - baseUrl: TORUS_PROVIDERS_REDIRECT_URL, - proxyContractAddress: '0x4023d2a0D330bF11426B12C6144Cfb96B7fa6183', // details for test net - network: 'testnet', // details for test net - }, - providers: { - google: { - name: 'Google', - typeOfLogin: 'google', - jwtParams: {}, - verifier: TORUS_GOOGLE_VERIFIER, - clientId: TORUS_GOOGLE_CLIENT_ID, - }, - twitter: { - name: 'Twitter', - typeOfLogin: 'twitter', - verifier: TORUS_TWITTER_VERIFIER, - clientId: TORUS_TWITTER_CLIENT_ID, - jwtParams: { - domain: TORUS_TWITTER_AUTH_DOMAIN, - }, - }, - }, - }, +export default { + ws: { + url: REACT_APP_WS_AUTH_CHALLENGE_URL, }, - production: { - ws: { - url: 'wss://auth.space.storage', + torus: { + sdkConfig: { + enableLogging: NODE_ENV !== 'production', + redirectToOpener: true, + redirectPathName: 'redirect.html', + baseUrl: REACT_APP_TORUS_PROVIDERS_REDIRECT_URL, + proxyContractAddress: REACT_APP_TORUS_PROXY_CONTRACT, // details for test net + network: REACT_APP_TORUS_NETWORK, // details for test net }, - torus: { - sdkConfig: { - enableLogging: false, - redirectToOpener: true, - redirectPathName: 'redirect.html', - baseUrl: 'https://floral-mountain-2401.on.fleek.co/', - proxyContractAddress: '0x4023d2a0D330bF11426B12C6144Cfb96B7fa6183', // details for test net - network: 'testnet', // details for test net + providers: { + google: { + name: 'Google', + typeOfLogin: 'google', + jwtParams: {}, + verifier: REACT_APP_TORUS_GOOGLE_VERIFIER, + clientId: REACT_APP_TORUS_GOOGLE_CLIENT_ID, }, - providers: { - google: { - name: 'Google', - typeOfLogin: 'google', - clientId: '480855465278-s0lcvq0m4hpn5hokhgs8s1ujfe3lbk4f.apps.googleusercontent.com', - verifier: 'space-google-testnet', - jwtParams: {}, - }, - twitter: { - name: 'Twitter', - typeOfLogin: 'twitter', - clientId: 'jMfyGURX9wbS3GpusgLOZkvOn0AvIaJj', - verifier: 'fleek-auth0-twitter', - jwtParams: { - domain: 'https://space-twitter.us.auth0.com', - }, + twitter: { + name: 'Twitter', + typeOfLogin: 'twitter', + verifier: REACT_APP_TORUS_TWITTER_VERIFIER, + clientId: REACT_APP_TORUS_TWITTER_CLIENT_ID, + jwtParams: { + domain: REACT_APP_TORUS_TWITTER_AUTH_DOMAIN, }, }, }, }, }; - -export default config[REACT_APP_FE_NODE_ENV] || config.development; From 5b1352ab0d6b8c19a4f3974a887cdbb7660b69fb Mon Sep 17 00:00:00 2001 From: Giancarlo Otarola Date: Fri, 13 Nov 2020 12:14:49 -0300 Subject: [PATCH 5/7] remove specific env vars for linux command and minimal description for .env files --- .github/workflows/release.yml | 3 --- README.md | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ce9fadb0..8083e542 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,9 +39,6 @@ jobs: - name: Get daemon run: yarn download-daemon - name: Linux app pack and release - env: - SPACE_SERVICES_URL: ${{secrets.SPACE_SERVICES_URL}} - REACT_APP_FE_NODE_ENV: ${{secrets.REACT_APP_FE_NODE_ENV}} if: matrix.os == 'ubuntu-latest' run: yarn electron-pack --linux - name: MacOS app pack and release diff --git a/README.md b/README.md index 0cd0b181..92f51474 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,9 @@ Also, if the daemon requires additional env variables, you need to pass those en You can also download the latest version of the daemon directly into the resource folder (same way as CI does). To do that you can run `yarn download-daemon` +### .env File +Take a look at the `.env.example` file to set the necessary environment variables with its right values when you run the project locally. + ## Build app locally The default behavior of the build process it's to try to sign the application. If you are not exporting the ENV variables required to sign the application, the build process is going to fail. If you want to skip the signing process in order to be able to run the build process locally you can pass the `CSC_IDENTITY_AUTO_DISCOVERY=false` env variable, so the sign step is going to be ignored From bb1001882e9ddf439bfc1e24a8a7bed6372c81e4 Mon Sep 17 00:00:00 2001 From: Giancarlo Otarola Date: Fri, 13 Nov 2020 12:16:23 -0300 Subject: [PATCH 6/7] add a comment --- public/electron/clients/api/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/electron/clients/api/index.js b/public/electron/clients/api/index.js index fbc2f230..f78a85ff 100644 --- a/public/electron/clients/api/index.js +++ b/public/electron/clients/api/index.js @@ -1,5 +1,6 @@ const ApiClient = require('./client'); +// process.env.SPACE_SERVICES_URL is specially for local development const baseURL = process.env.SPACE_SERVICES_URL || 'https://api.space.storage'; // eslint-disable-next-line no-console console.log(`Init ApiClient, URL: ${baseURL}`); From fa1a2a3e55d4a9e007702da929d5c5c8fc670cde Mon Sep 17 00:00:00 2001 From: Giancarlo Otarola Date: Fri, 13 Nov 2020 12:19:16 -0300 Subject: [PATCH 7/7] remove all values from .env.example --- .env.example | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index 4e00a954..723dea6f 100644 --- a/.env.example +++ b/.env.example @@ -1,9 +1,9 @@ DEV_DAEMON=false DAEMON_PATH=/path/to/daemon -SPACE_SERVICES_URL="https://api-dev.space.storage" -SPACE_BILLING_SERVICE_URL="https://7ll1etbd0m.execute-api.us-west-2.amazonaws.com/dev" -REACT_APP_WS_AUTH_CHALLENGE_URL="wss://gqo1oqz055.execute-api.us-west-2.amazonaws.com/dev" +SPACE_SERVICES_URL= +SPACE_BILLING_SERVICE_URL= +REACT_APP_WS_AUTH_CHALLENGE_URL= REACT_APP_TORUS_NETWORK= REACT_APP_TORUS_GOOGLE_VERIFIER=