-
Notifications
You must be signed in to change notification settings - Fork 485
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENVs changes and test script for validator (#1296)
* use SENTRY_CSP_REPORT_URI only in nextjs part of the app * rename NEXT_PUBLIC_FAVICON_GENERATOR_API_KEY to FAVICON_GENERATOR_API_KEY * tests presets for envs validator * simplify logs * refactor getExternalJsonContent function * tweak contribution guide * break validator * debug workflow * fix copying assets folder * fix CI
- Loading branch information
Showing
29 changed files
with
271 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
/public | ||
.env | ||
.env.registry | ||
.env.secrets | ||
index.js |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/bash | ||
|
||
secrets_file=".env.secrets" | ||
test_folder="./test" | ||
common_file="${test_folder}/.env.common" | ||
|
||
# Generate ENV registry file | ||
export NEXT_PUBLIC_GIT_COMMIT_SHA=$(git rev-parse --short HEAD) | ||
export NEXT_PUBLIC_GIT_TAG=$(git describe --tags --abbrev=0) | ||
../../scripts/collect_envs.sh ../../../docs/ENVS.md | ||
cp ../../../.env.example ${secrets_file} | ||
|
||
# Copy test assets | ||
mkdir -p "./public/assets" | ||
cp -r ${test_folder}/assets ./public/ | ||
|
||
# Build validator script | ||
yarn build | ||
|
||
validate_file() { | ||
local test_file="$1" | ||
|
||
echo | ||
echo "🧿 Validating file '$test_file'..." | ||
|
||
dotenv \ | ||
-e $test_file \ | ||
-e $common_file \ | ||
-e $secrets_file \ | ||
yarn run validate -- --silent | ||
|
||
if [ $? -eq 0 ]; then | ||
echo "👍 All good!" | ||
return 0 | ||
else | ||
echo "🛑 The file is invalid. Please fix errors and run script again." | ||
echo | ||
return 1 | ||
fi | ||
} | ||
|
||
test_files=($(find "$test_folder" -maxdepth 1 -type f | grep -vE '\/\.env\.common$')) | ||
|
||
for file in "${test_files[@]}"; do | ||
validate_file "$file" | ||
if [ $? -eq 1 ]; then | ||
exit 1 | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
NEXT_PUBLIC_AD_BANNER_PROVIDER=adbutler | ||
NEXT_PUBLIC_AD_ADBUTLER_CONFIG_DESKTOP={'id':'123456','width':'728','height':'90'} | ||
NEXT_PUBLIC_AD_ADBUTLER_CONFIG_MOBILE={'id':'654321','width':'300','height':'100'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
NEXT_PUBLIC_AD_TEXT_PROVIDER=coinzilla | ||
NEXT_PUBLIC_AD_BANNER_PROVIDER=slise | ||
NEXT_PUBLIC_ADMIN_SERVICE_API_HOST=https://example.com | ||
NEXT_PUBLIC_API_BASE_PATH=/ | ||
NEXT_PUBLIC_API_SPEC_URL=https://example.com | ||
NEXT_PUBLIC_API_WEBSOCKET_PROTOCOL=ws | ||
NEXT_PUBLIC_APP_ENV=development | ||
NEXT_PUBLIC_APP_PORT=3000 | ||
NEXT_PUBLIC_APP_PROTOCOL=http | ||
NEXT_PUBLIC_BRIDGED_TOKENS_CHAINS=[{'id':'1','title':'Ethereum','short_title':'ETH','base_url':'https://example.com'}] | ||
NEXT_PUBLIC_BRIDGED_TOKENS_BRIDGES=[{'type':'omni','title':'OmniBridge','short_title':'OMNI'}] | ||
NEXT_PUBLIC_CONTRACT_INFO_API_HOST=https://example.com | ||
NEXT_PUBLIC_FEATURED_NETWORKS=https://example.com | ||
NEXT_PUBLIC_FOOTER_LINKS=https://example.com | ||
NEXT_PUBLIC_GRAPHIQL_TRANSACTION=0xf7d4972356e6ae44ae948d0cf19ef2beaf0e574c180997e969a2837da15e349d | ||
NEXT_PUBLIC_HIDE_INDEXING_ALERT=false | ||
NEXT_PUBLIC_HOMEPAGE_CHARTS=['daily_txs'] | ||
NEXT_PUBLIC_HOMEPAGE_PLATE_TEXT_COLOR='#fff' | ||
NEXT_PUBLIC_HOMEPAGE_PLATE_BACKGROUND='rgb(255, 145, 0)' | ||
NEXT_PUBLIC_HOMEPAGE_SHOW_GAS_TRACKER=true | ||
NEXT_PUBLIC_HOMEPAGE_SHOW_AVG_BLOCK_TIME=true | ||
NEXT_PUBLIC_IS_TESTNET=true | ||
NEXT_PUBLIC_MARKETPLACE_CONFIG_URL=https://example.com | ||
NEXT_PUBLIC_MARKETPLACE_SUBMIT_FORM=https://example.com | ||
NEXT_PUBLIC_MAINTENANCE_ALERT_MESSAGE='<a href="#">Hello</a>' | ||
NEXT_PUBLIC_NETWORK_CURRENCY_DECIMALS=18 | ||
NEXT_PUBLIC_NETWORK_CURRENCY_NAME=Ether | ||
NEXT_PUBLIC_NETWORK_CURRENCY_SYMBOL=ETH | ||
NEXT_PUBLIC_NETWORK_EXPLORERS=[{'title':'Explorer','baseUrl':'https://example.com/','paths':{'tx':'/tx','address':'/address','token':'/token','block':'/block'}}] | ||
NEXT_PUBLIC_NETWORK_GOVERNANCE_TOKEN_SYMBOL=gETH | ||
NEXT_PUBLIC_NETWORK_ICON=https://example.com/icon.png | ||
NEXT_PUBLIC_NETWORK_ICON_DARK=https://example.com/icon.png | ||
NEXT_PUBLIC_NETWORK_LOGO=https://example.com/logo.png | ||
NEXT_PUBLIC_NETWORK_LOGO_DARK=https://example.com/logo.png | ||
NEXT_PUBLIC_NETWORK_RPC_URL=https://example.com | ||
NEXT_PUBLIC_NETWORK_SHORT_NAME=Test | ||
NEXT_PUBLIC_NETWORK_VERIFICATION_TYPE=validation | ||
NEXT_PUBLIC_OG_DESCRIPTION='Hello world!' | ||
NEXT_PUBLIC_OG_IMAGE_URL=https://example.com/image.png | ||
NEXT_PUBLIC_OTHER_LINKS=[{'url':'https://blockscout.com','text':'Blockscout'}] | ||
NEXT_PUBLIC_PROMOTE_BLOCKSCOUT_IN_TITLE=true | ||
NEXT_PUBLIC_STATS_API_HOST=https://example.com | ||
NEXT_PUBLIC_USE_NEXT_JS_PROXY=false | ||
NEXT_PUBLIC_VIEWS_ADDRESS_IDENTICON_TYPE=gradient_avatar | ||
NEXT_PUBLIC_VIEWS_ADDRESS_HIDDEN_VIEWS=['top_accounts'] | ||
NEXT_PUBLIC_VIEWS_BLOCK_HIDDEN_FIELDS=['burnt_fees','total_reward'] | ||
NEXT_PUBLIC_VIEWS_NFT_MARKETPLACES=[{'name':'NFT Marketplace','collection_url':'https://example.com/{hash}','instance_url':'https://example.com/{hash}/{id}','logo_url':'https://example.com/logo.png'}] | ||
NEXT_PUBLIC_VIEWS_TX_ADDITIONAL_FIELDS=['fee_per_gas'] | ||
NEXT_PUBLIC_VIEWS_TX_HIDDEN_FIELDS=['value','fee_currency','gas_price','tx_fee','gas_fees','burnt_fees'] | ||
NEXT_PUBLIC_VISUALIZE_API_HOST=https://example.com | ||
NEXT_PUBLIC_WEB3_DISABLE_ADD_TOKEN_TO_WALLET=false | ||
NEXT_PUBLIC_WEB3_WALLETS=['coinbase','metamask','token_pocket'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
NEXT_PUBLIC_HAS_BEACON_CHAIN=true | ||
NEXT_PUBLIC_BEACON_CHAIN_CURRENCY_SYMBOL=aETH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
NEXT_PUBLIC_API_HOST=blockscout.com | ||
NEXT_PUBLIC_APP_HOST=localhost | ||
NEXT_PUBLIC_AUTH_URL=https://example.com | ||
NEXT_PUBLIC_IS_ACCOUNT_SUPPORTED=true | ||
NEXT_PUBLIC_LOGOUT_URL=https://example.com | ||
NEXT_PUBLIC_NETWORK_ID=1 | ||
NEXT_PUBLIC_NETWORK_NAME=Testnet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
NEXT_PUBLIC_IS_L2_NETWORK=true | ||
NEXT_PUBLIC_L1_BASE_URL=https://example.com | ||
NEXT_PUBLIC_L2_WITHDRAWAL_URL=https://example.com |
Oops, something went wrong.