Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/environment variables 1144 #1146

Merged
merged 6 commits into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env.libre
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ HAPI_SYNC_PRODUCERS_INTERVAL=14400
HAPI_SYNC_PRODUCER_INFO_INTERVAL=1
HAPI_SYNC_PRODUCER_CPU_INTERVAL=6
HAPI_SYNC_EXCHANGE_RATE=86400
HAPI_EOS_EXCHANGE_RATE_API=https://api.coingecko.com/api/v3/simple/price?ids=proton&vs_currencies=usd
HAPI_COINGECKO_API_TOKEN_ID=BTC
HAPI_EOS_EXCHANGE_RATE_API=https://dashboard-api.libre.org/exchange-rates
HAPI_COINGECKO_API_TOKEN_ID=LIBRE
HAPI_REWARDS_TOKEN=LIBRE
HAPI_SYNC_STATS_INTERVAL=60
HAPI_SYNC_SCHEDULE_HISTORY_INTERVAL=86400
Expand Down
4 changes: 2 additions & 2 deletions .env.libretestnet
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ HAPI_SYNC_PRODUCERS_INTERVAL=14400
HAPI_SYNC_PRODUCER_INFO_INTERVAL=1
HAPI_SYNC_PRODUCER_CPU_INTERVAL=6
HAPI_SYNC_EXCHANGE_RATE=86400
HAPI_EOS_EXCHANGE_RATE_API=https://api.coingecko.com/api/v3/simple/price?ids=wax&vs_currencies=usd
HAPI_COINGECKO_API_TOKEN_ID=BTC
HAPI_EOS_EXCHANGE_RATE_API=https://dashboard-api.libre.org/exchange-rates
HAPI_COINGECKO_API_TOKEN_ID=LIBRE
HAPI_REWARDS_TOKEN=LIBRE
HAPI_SYNC_STATS_INTERVAL=60
HAPI_SYNC_SCHEDULE_HISTORY_INTERVAL=86400
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deploy-airwire-testnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
REACT_APP_EOS_RATE_LINK: ''
REACT_APP_USE_REWARDS: 'false'
REACT_APP_USE_VOTES: 'false'
REACT_APP_USE_CPU_BENCHMARK: 'true'
REACT_APP_HASURA_URL: 'https://graphql-testnet-dashboard.airwire.io/v1/graphql'
REACT_APP_EOS_API_NETWORK_NAME: 'airwire-testnet'
REACT_APP_EOS_API_NETWORK_LABEL: 'Airwire Testnet'
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deploy-airwire.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
REACT_APP_EOS_RATE_LINK: ''
REACT_APP_USE_REWARDS: 'false'
REACT_APP_USE_VOTES: 'false'
REACT_APP_USE_CPU_BENCHMARK: 'false'
REACT_APP_HASURA_URL: 'https://graphql-dashboard.airwire.io/v1/graphql'
REACT_APP_EOS_API_NETWORK_NAME: 'airwire'
REACT_APP_EOS_API_NETWORK_LABEL: 'Airwire'
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deploy-jungle-testnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ jobs:
REACT_APP_EOS_RATE_LINK: https://jungle.eosrate.io
REACT_APP_USE_REWARDS: true
REACT_APP_USE_VOTES: true
REACT_APP_USE_CPU_BENCHMARK: true
REACT_APP_HASURA_URL: https://graphql-jungle.antelope.tools/v1/graphql
REACT_APP_EOS_API_NETWORK_NAME: jungle
REACT_APP_EOS_API_NETWORK_LABEL: Jungle4 Testnet
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deploy-lacchain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
REACT_APP_EOS_RATE_LINK: ''
REACT_APP_USE_REWARDS: 'false'
REACT_APP_USE_VOTES: 'false'
REACT_APP_USE_CPU_BENCHMARK: 'true'
REACT_APP_HASURA_URL: 'https://graphql-lacchain.antelope.tools/v1/graphql'
REACT_APP_EOS_API_NETWORK_NAME: 'lacchain'
REACT_APP_EOS_API_NETWORK_LABEL: 'LACChain EOSIO'
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/deploy-libre-testnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
REACT_APP_EOS_RATE_LINK: ''
REACT_APP_USE_REWARDS: 'true'
REACT_APP_USE_VOTES: 'true'
REACT_APP_USE_CPU_BENCHMARK: 'false'
REACT_APP_HASURA_URL: 'https://graphql-libre-testnet.antelope.tools/v1/graphql'
REACT_APP_EOS_API_NETWORK_NAME: 'libre-testnet'
REACT_APP_EOS_API_NETWORK_LABEL: 'Libre Testnet'
Expand Down Expand Up @@ -105,8 +104,8 @@ jobs:
HAPI_SYNC_PRODUCER_CPU_INTERVAL: '6'
HAPI_SYNC_PRODUCER_INFO_INTERVAL: '1'
HAPI_SYNC_SCHEDULE_HISTORY_INTERVAL: 86400
HAPI_EOS_EXCHANGE_RATE_API: 'https://api.coingecko.com/api/v3/simple/price?ids=btc&vs_currencies=usd'
HAPI_COINGECKO_API_TOKEN_ID: BTC
HAPI_EOS_EXCHANGE_RATE_API: 'https://dashboard-api.libre.org/exchange-rates'
HAPI_COINGECKO_API_TOKEN_ID: LIBRE
HAPI_REWARDS_TOKEN: LIBRE
HAPI_CREATE_ACCOUNT_ACTION_NAME: newaccount
HAPI_EOS_FAUCET_ACCOUNT: ${{ secrets.HAPI_EOS_FAUCET_ACCOUNT }}
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/deploy-libre.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
REACT_APP_EOS_RATE_LINK: ''
REACT_APP_USE_REWARDS: 'false'
REACT_APP_USE_VOTES: 'false'
REACT_APP_USE_CPU_BENCHMARK: 'false'
REACT_APP_HASURA_URL: 'https://graphql-libre.antelope.tools/v1/graphql'
REACT_APP_EOS_API_NETWORK_NAME: 'libre'
REACT_APP_EOS_API_NETWORK_LABEL: 'Libre Mainnet'
Expand Down Expand Up @@ -104,8 +103,8 @@ jobs:
HAPI_SYNC_PRODUCER_CPU_INTERVAL: '6'
HAPI_SYNC_PRODUCER_INFO_INTERVAL: '1'
HAPI_SYNC_SCHEDULE_HISTORY_INTERVAL: 86400
HAPI_EOS_EXCHANGE_RATE_API: 'https://api.coingecko.com/api/v3/simple/price?ids=btc&vs_currencies=usd'
HAPI_COINGECKO_API_TOKEN_ID: BTC
HAPI_EOS_EXCHANGE_RATE_API: 'https://dashboard-api.libre.org/exchange-rates'
HAPI_COINGECKO_API_TOKEN_ID: LIBRE
HAPI_REWARDS_TOKEN: LIBRE
HAPI_CREATE_ACCOUNT_ACTION_NAME: newaccount
HAPI_EOS_FAUCET_ACCOUNT: ${{ secrets.HAPI_EOS_FAUCET_ACCOUNT }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deploy-proton-testnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
REACT_APP_EOS_RATE_LINK: ''
REACT_APP_USE_REWARDS: 'true'
REACT_APP_USE_VOTES: 'true'
REACT_APP_USE_CPU_BENCHMARK: 'false'
REACT_APP_HASURA_URL: 'https://graphql-proton-testnet.antelope.tools/v1/graphql'
REACT_APP_EOS_API_NETWORK_NAME: 'proton-testnet'
REACT_APP_EOS_API_NETWORK_LABEL: 'Proton Testnet'
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deploy-proton.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
REACT_APP_EOS_RATE_LINK: ''
REACT_APP_USE_REWARDS: 'true'
REACT_APP_USE_VOTES: 'true'
REACT_APP_USE_CPU_BENCHMARK: 'false'
REACT_APP_HASURA_URL: 'https://graphql-proton.antelope.tools/v1/graphql'
REACT_APP_EOS_API_NETWORK_NAME: 'proton'
REACT_APP_EOS_API_NETWORK_LABEL: 'Proton Mainnet'
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deploy-telos-testnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
REACT_APP_EOS_RATE_LINK: ''
REACT_APP_USE_REWARDS: 'true'
REACT_APP_USE_VOTES: 'true'
REACT_APP_USE_CPU_BENCHMARK: 'true'
REACT_APP_HASURA_URL: 'https://graphql-telos-testnet.antelope.tools/v1/graphql'
REACT_APP_EOS_API_NETWORK_NAME: 'telos-testnet'
REACT_APP_EOS_API_NETWORK_LABEL: 'Telos Testnet'
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deploy-telos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
REACT_APP_EOS_RATE_LINK: ''
REACT_APP_USE_REWARDS: 'true'
REACT_APP_USE_VOTES: 'true'
REACT_APP_USE_CPU_BENCHMARK: 'true'
REACT_APP_HASURA_URL: 'https://graphql-telos.antelope.tools/v1/graphql'
REACT_APP_EOS_API_NETWORK_NAME: 'telos'
REACT_APP_EOS_API_NETWORK_LABEL: 'Telos Mainnet'
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deploy-ultra-testnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
REACT_APP_EOS_RATE_LINK: ''
REACT_APP_USE_REWARDS: 'false'
REACT_APP_USE_VOTES: 'false'
REACT_APP_USE_CPU_BENCHMARK: 'false'
REACT_APP_HASURA_URL: 'https://graphql-ultra-testnet.antelope.tools/v1/graphql'
REACT_APP_EOS_API_NETWORK_NAME: 'ultra-testnet'
REACT_APP_EOS_API_NETWORK_LABEL: 'Ultra Testnet'
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deploy-wax-testnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
REACT_APP_EOS_RATE_LINK: ''
REACT_APP_USE_REWARDS: 'false'
REACT_APP_USE_VOTES: 'true'
REACT_APP_USE_CPU_BENCHMARK: 'true'
REACT_APP_HASURA_URL: 'https://graphql-wax-testnet.antelope.tools/v1/graphql'
REACT_APP_EOS_API_NETWORK_NAME: 'wax-testnet'
REACT_APP_EOS_API_NETWORK_LABEL: 'WAX Testnet'
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deploy-wax.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
REACT_APP_EOS_RATE_LINK: ''
REACT_APP_USE_REWARDS: 'false'
REACT_APP_USE_VOTES: 'true'
REACT_APP_USE_CPU_BENCHMARK: 'true'
REACT_APP_HASURA_URL: 'https://graphql-wax.antelope.tools/v1/graphql'
REACT_APP_EOS_API_NETWORK_NAME: 'wax'
REACT_APP_EOS_API_NETWORK_LABEL: 'WAX Mainnet'
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ services:
REACT_APP_EOS_RATE_LINK: '${REACT_APP_EOS_RATE_LINK}'
REACT_APP_USE_REWARDS: '${REACT_APP_USE_REWARDS}'
REACT_APP_USE_VOTES: '${REACT_APP_USE_VOTES}'
REACT_APP_USE_CPU_BENCHMARK: '${REACT_APP_USE_CPU_BENCHMARK}'
REACT_APP_HASURA_URL: '${REACT_APP_HASURA_URL}'
REACT_APP_EOS_API_NETWORK_NAME: '${REACT_APP_EOS_API_NETWORK_NAME}'
REACT_APP_EOS_API_NETWORK_LABEL: '${REACT_APP_EOS_API_NETWORK_LABEL}'
Expand Down
5 changes: 4 additions & 1 deletion hapi/src/services/setting.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ const syncEOSPrice = async () => {
return
}

const response = data[eosConfig.coingeckoApiTokenId]
const tokenPrice = !isNaN(response?.usd) ? response.usd : response

await hasuraUtil.request(UPSERT, {
setting: { id: 1, token_price: data[eosConfig.coingeckoApiTokenId].usd }
setting: { id: 1, token_price: tokenPrice }
})
} catch (error) {
console.error(error)
Expand Down
9 changes: 9 additions & 0 deletions kubernetes/configmap-dashboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ data:
# webapp
PORT: '${PORT}'
REACT_APP_TITLE: '${REACT_APP_TITLE}'
REACT_APP_VERSION: '${REACT_APP_VERSION}'
REACT_APP_DEFAULT_PRODUCER_LOGO: '${REACT_APP_DEFAULT_PRODUCER_LOGO}'
REACT_APP_FOOTER_LINKS: '${REACT_APP_FOOTER_LINKS}'
REACT_APP_EOS_RATE_LINK: '${REACT_APP_EOS_RATE_LINK}'
REACT_APP_USE_REWARDS: '${REACT_APP_USE_REWARDS}'
REACT_APP_USE_VOTES: '${REACT_APP_USE_VOTES}'
Expand All @@ -24,9 +26,13 @@ data:
REACT_APP_EOS_API_NETWORK_LABEL: '${REACT_APP_EOS_API_NETWORK_LABEL}'
REACT_APP_EOS_API_NETWORK_LOGO: '${REACT_APP_EOS_API_NETWORK_LOGO}'
REACT_APP_TOKEN_SYMBOL: '${REACT_APP_TOKEN_SYMBOL}'
REACT_APP_SYNC_TOLERANCE_INTERVAL: '${REACT_APP_SYNC_TOLERANCE_INTERVAL}'
REACT_APP_NETWORK_URL: '${REACT_APP_NETWORK_URL}'
REACT_APP_DISABLED_MENU_ITEMS: '${REACT_APP_DISABLED_MENU_ITEMS}'
REACT_APP_BLOCK_EXPLORER_URL: '${REACT_APP_BLOCK_EXPLORER_URL}'
REACT_APP_STATE_HISTORY_ENABLED: '${REACT_APP_STATE_HISTORY_ENABLED}'
REACT_APP_GOOGLE_ANALITIC_PAGE_ID: '${REACT_APP_GOOGLE_ANALITIC_PAGE_ID}'
REACT_APP_PUBLIC_RE_CAPTCHA_KEY: '${REACT_APP_PUBLIC_RE_CAPTCHA_KEY}'
---
apiVersion: v1
kind: ConfigMap
Expand Down Expand Up @@ -86,6 +92,9 @@ data:
HAPI_COINGECKO_API_TOKEN_ID: '${HAPI_COINGECKO_API_TOKEN_ID}'
HAPI_REWARDS_TOKEN: '${HAPI_REWARDS_TOKEN}'
HAPI_CREATE_ACCOUNT_ACTION_NAME: '${HAPI_CREATE_ACCOUNT_ACTION_NAME}'
HAPI_EOSRATE_GET_STATS_URL: '${HAPI_EOSRATE_GET_STATS_URL}'
HAPI_EOSRATE_GET_STATS_USER: '${HAPI_EOSRATE_GET_STATS_USER}'
HAPI_EOSRATE_GET_STATS_PASSWORD: '${HAPI_EOSRATE_GET_STATS_PASSWORD}'
---
apiVersion: v1
kind: ConfigMap
Expand Down
2 changes: 0 additions & 2 deletions webapp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ARG react_app_footer_links
ARG react_app_eos_rate_link
ARG react_app_use_rewards
ARG react_app_use_votes
ARG react_app_use_cpu_benchmark
ARG react_app_hasura_url
ARG react_app_eos_api_network_name
ARG react_app_eos_api_network_label
Expand Down Expand Up @@ -41,7 +40,6 @@ ENV REACT_APP_FOOTER_LINKS $react_app_footer_links
ENV REACT_APP_EOS_RATE_LINK $react_app_eos_rate_link
ENV REACT_APP_USE_REWARDS $react_app_use_rewards
ENV REACT_APP_USE_VOTES $react_app_use_votes
ENV REACT_APP_USE_CPU_BENCHMARK $react_app_use_cpu_benchmark
ENV REACT_APP_HASURA_URL $react_app_hasura_url
ENV REACT_APP_EOS_API_NETWORK_NAME $react_app_eos_api_network_name
ENV REACT_APP_EOS_API_NETWORK_LABEL $react_app_eos_api_network_label
Expand Down
1 change: 0 additions & 1 deletion webapp/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ build-docker: ./Dockerfile
--build-arg react_app_eos_rate_link="$(REACT_APP_EOS_RATE_LINK)" \
--build-arg react_app_use_rewards="$(REACT_APP_USE_REWARDS)" \
--build-arg react_app_use_votes="$(REACT_APP_USE_VOTES)" \
--build-arg react_app_use_cpu_benchmark="$(REACT_APP_USE_CPU_BENCHMARK)" \
--build-arg react_app_hasura_url="$(REACT_APP_HASURA_URL)" \
--build-arg react_app_eos_api_network_name="$(REACT_APP_EOS_API_NETWORK_NAME)" \
--build-arg react_app_eos_api_network_label="$(REACT_APP_EOS_API_NETWORK_LABEL)" \
Expand Down
5 changes: 1 addition & 4 deletions webapp/src/config/general.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
export const useRewards = process.env.REACT_APP_USE_REWARDS === 'true'
export const useVotes = process.env.REACT_APP_USE_VOTES === 'true'
export const useCpuBenchmark =
process.env.REACT_APP_USE_CPU_BENCHMARK === 'true'
export const title = process.env.REACT_APP_TITLE
export const eosRateLink = process.env.REACT_APP_EOS_RATE_LINK
export const defaultProducerLogo =
process.env.REACT_APP_DEFAULT_PRODUCER_LOGO ||
'https://bloks.io/img/eosio.png'

export const footerLinks = process.env.REACT_APP_FOOTER_LINKS
? JSON.parse(process.env.REACT_APP_FOOTER_LINKS)
: []
export const disabledMenuItems = JSON.parse(
process.env.REACT_APP_DISABLED_MENU_ITEMS || '[]'
process.env.REACT_APP_DISABLED_MENU_ITEMS || '[]',
)
export const appVersion =
process.env.REACT_APP_VERSION.split('/').pop() || 'v1.0'
Expand Down