Skip to content
This repository was archived by the owner on Aug 23, 2024. It is now read-only.

Commit

Permalink
Clean .env file
Browse files Browse the repository at this point in the history
  • Loading branch information
selankon committed Mar 13, 2024
1 parent 676cb77 commit c611c4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ To deploy using [Docker Compose](https://docs.docker.com/compose) follow the ins

Configure the `.env` file with the following variables:

- `API_URL` Api url for the Vocdoni API
- `VOCDONI_UI_TAG` Docker tag of the image (master, stg, release)
- `VOCDONI_ENVIRONMENT` Enviromnent type (dev, stg, prod)
- `ETH_NETWORK_ID` Ethereum nework ID (xdai, goerli...)
- `DOMAIN` Domain name to be served. Used by Traefik to fetch SSL certificates from Let's Encrypt
- `LE_EMAIL` Email associated to the domain. Used by Traefik to fetch SSL certificates from Let's Encrypt

TBD: Add all remaining variables.

Expand Down
19 changes: 3 additions & 16 deletions env-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,22 @@
const LANG = process.env.APP_LANG || 'en';
const DEVELOPMENT = process.env.NODE_ENV !== 'production';
const COMMIT_SHA = process.env.COMMIT_SHA || 'development';
const VOCDONI_ENVIRONMENT = process.env.VOCDONI_ENVIRONMENT || 'dev';
const VOCDONI_ENVIRONMENT = process.env.VOCDONI_ENVIRONMENT || 'stg';

const isTrueEnv = (env) => env === 'true' || env === true;

const VERIFY_SINGLE_PAGE = isTrueEnv(process.env.VERIFY_SINGLE_PAGE) || false;

let plaza, apiUrl;
let plaza;
switch (VOCDONI_ENVIRONMENT) {
case 'stg':
plaza = `https://app-stg.vocdoni.io`;
apiUrl = `https://api-stg.vocdoni.net/v2`;
break;
case 'prod':
plaza = `https://onvote.app`;
apiUrl = `https://api.vocdoni.net/v2`;
break;
default:
plaza = `https://app-dev.vocdoni.io`;
apiUrl = `https://api-dev.vocdoni.net/v2`;
break;
}

Expand All @@ -37,18 +34,8 @@ module.exports = {
APP_TAGS: 'vocdoni, blockchain, explorer, organizations, processes, blocks, transactions, vote, votes',
VERIFY_SINGLE_PAGE,

// BLOCKCHAIN
ETH_NETWORK_ID: process.env.ETH_NETWORK_ID || 'goerli',

// VOCHAIN
BLOCK_TIME: process.env.BLOCK_TIME || '12',

// GATEWAYS
PLAZA_URL: process.env.PLAZA_URL || plaza, // Deprecated see https://github.com/vocdoni/explorer-ui/issues/163
API_URL: process.env.API_URL || apiUrl,

// HELPSCOUT
HELPSCOUT_PROJECT_ID: '', // TODO:
PLAZA_URL: process.env.PLAZA_URL || plaza,
};

console.log('Building the frontend with ENV:', module.exports);

0 comments on commit c611c4e

Please sign in to comment.