2021-02-01 17:25:08 +01:00
|
|
|
#!/bin/sh
|
2021-02-02 17:54:01 +01:00
|
|
|
__MEMPOOL_BACKEND_MAINNET_HTTP_HOST__=${BACKEND_MAINNET_HTTP_HOST:=127.0.0.1}
|
2021-02-03 02:12:15 +01:00
|
|
|
__MEMPOOL_BACKEND_MAINNET_HTTP_PORT__=${BACKEND_MAINNET_HTTP_PORT:=8999}
|
2021-02-10 14:51:01 +01:00
|
|
|
__MEMPOOL_FRONTEND_HTTP_PORT__=${FRONTEND_HTTP_PORT:=8080}
|
2021-02-01 17:25:08 +01:00
|
|
|
|
2021-02-02 16:34:21 +01:00
|
|
|
sed -i "s/__MEMPOOL_BACKEND_MAINNET_HTTP_HOST__/${__MEMPOOL_BACKEND_MAINNET_HTTP_HOST__}/g" /etc/nginx/conf.d/nginx-mempool.conf
|
2021-02-03 02:12:15 +01:00
|
|
|
sed -i "s/__MEMPOOL_BACKEND_MAINNET_HTTP_PORT__/${__MEMPOOL_BACKEND_MAINNET_HTTP_PORT__}/g" /etc/nginx/conf.d/nginx-mempool.conf
|
2021-02-01 17:25:08 +01:00
|
|
|
|
2021-02-10 14:51:01 +01:00
|
|
|
cp /etc/nginx/nginx.conf /patch/nginx.conf
|
|
|
|
sed -i "s/__MEMPOOL_FRONTEND_HTTP_PORT__/${__MEMPOOL_FRONTEND_HTTP_PORT__}/g" /patch/nginx.conf
|
|
|
|
cat /patch/nginx.conf > /etc/nginx/nginx.conf
|
|
|
|
|
2023-03-21 13:50:46 +01:00
|
|
|
if [ "${LIGHTNING_DETECTED_PORT}" != "" ];then
|
2023-03-21 10:10:37 +01:00
|
|
|
export LIGHTNING=true
|
|
|
|
fi
|
2023-03-21 07:56:11 +01:00
|
|
|
|
2022-10-16 04:46:30 +02:00
|
|
|
# Runtime overrides - read env vars defined in docker compose
|
|
|
|
|
|
|
|
__TESTNET_ENABLED__=${TESTNET_ENABLED:=false}
|
|
|
|
__SIGNET_ENABLED__=${SIGNET_ENABLED:=false}
|
|
|
|
__LIQUID_ENABLED__=${LIQUID_EANBLED:=false}
|
|
|
|
__LIQUID_TESTNET_ENABLED__=${LIQUID_TESTNET_ENABLED:=false}
|
|
|
|
__BISQ_ENABLED__=${BISQ_ENABLED:=false}
|
|
|
|
__BISQ_SEPARATE_BACKEND__=${BISQ_SEPARATE_BACKEND:=false}
|
|
|
|
__ITEMS_PER_PAGE__=${ITEMS_PER_PAGE:=10}
|
|
|
|
__KEEP_BLOCKS_AMOUNT__=${KEEP_BLOCKS_AMOUNT:=8}
|
|
|
|
__NGINX_PROTOCOL__=${NGINX_PROTOCOL:=http}
|
|
|
|
__NGINX_HOSTNAME__=${NGINX_HOSTNAME:=localhost}
|
|
|
|
__NGINX_PORT__=${NGINX_PORT:=8999}
|
|
|
|
__BLOCK_WEIGHT_UNITS__=${BLOCK_WEIGHT_UNITS:=4000000}
|
|
|
|
__MEMPOOL_BLOCKS_AMOUNT__=${MEMPOOL_BLOCKS_AMOUNT:=8}
|
|
|
|
__BASE_MODULE__=${BASE_MODULE:=mempool}
|
|
|
|
__MEMPOOL_WEBSITE_URL__=${MEMPOOL_WEBSITE_URL:=https://mempool.space}
|
|
|
|
__LIQUID_WEBSITE_URL__=${LIQUID_WEBSITE_URL:=https://liquid.network}
|
|
|
|
__BISQ_WEBSITE_URL__=${BISQ_WEBSITE_URL:=https://bisq.markets}
|
|
|
|
__MINING_DASHBOARD__=${MINING_DASHBOARD:=true}
|
|
|
|
__LIGHTNING__=${LIGHTNING:=false}
|
2023-02-13 04:43:12 +01:00
|
|
|
__AUDIT__=${AUDIT:=false}
|
2023-01-06 01:36:38 +01:00
|
|
|
__MAINNET_BLOCK_AUDIT_START_HEIGHT__=${MAINNET_BLOCK_AUDIT_START_HEIGHT:=0}
|
|
|
|
__TESTNET_BLOCK_AUDIT_START_HEIGHT__=${TESTNET_BLOCK_AUDIT_START_HEIGHT:=0}
|
|
|
|
__SIGNET_BLOCK_AUDIT_START_HEIGHT__=${SIGNET_BLOCK_AUDIT_START_HEIGHT:=0}
|
2023-03-06 06:10:20 +01:00
|
|
|
__FULL_RBF_ENABLED__=${FULL_RBF_ENABLED:=false}
|
2023-03-01 09:26:53 +01:00
|
|
|
__HISTORICAL_PRICE__=${HISTORICAL_PRICE:=true}
|
2022-10-16 04:46:30 +02:00
|
|
|
|
|
|
|
# Export as environment variables to be used by envsubst
|
|
|
|
export __TESTNET_ENABLED__
|
|
|
|
export __SIGNET_ENABLED__
|
|
|
|
export __LIQUID_ENABLED__
|
|
|
|
export __LIQUID_TESTNET_ENABLED__
|
|
|
|
export __BISQ_ENABLED__
|
|
|
|
export __BISQ_SEPARATE_BACKEND__
|
|
|
|
export __ITEMS_PER_PAGE__
|
|
|
|
export __KEEP_BLOCKS_AMOUNT__
|
|
|
|
export __NGINX_PROTOCOL__
|
|
|
|
export __NGINX_HOSTNAME__
|
|
|
|
export __NGINX_PORT__
|
|
|
|
export __BLOCK_WEIGHT_UNITS__
|
|
|
|
export __MEMPOOL_BLOCKS_AMOUNT__
|
|
|
|
export __BASE_MODULE__
|
|
|
|
export __MEMPOOL_WEBSITE_URL__
|
|
|
|
export __LIQUID_WEBSITE_URL__
|
|
|
|
export __BISQ_WEBSITE_URL__
|
|
|
|
export __MINING_DASHBOARD__
|
|
|
|
export __LIGHTNING__
|
2023-02-13 04:43:12 +01:00
|
|
|
export __AUDIT__
|
2023-01-06 01:36:38 +01:00
|
|
|
export __MAINNET_BLOCK_AUDIT_START_HEIGHT__
|
|
|
|
export __TESTNET_BLOCK_AUDIT_START_HEIGHT__
|
|
|
|
export __SIGNET_BLOCK_AUDIT_START_HEIGHT__
|
2023-03-06 06:10:20 +01:00
|
|
|
export __FULL_RBF_ENABLED__
|
2023-03-01 09:26:53 +01:00
|
|
|
export __HISTORICAL_PRICE__
|
2022-10-16 04:46:30 +02:00
|
|
|
|
2022-10-16 17:40:22 +02:00
|
|
|
folder=$(find /var/www/mempool -name "config.js" | xargs dirname)
|
|
|
|
echo ${folder}
|
|
|
|
envsubst < ${folder}/config.template.js > ${folder}/config.js
|
2022-10-16 04:46:30 +02:00
|
|
|
|
2021-02-01 17:25:08 +01:00
|
|
|
exec "$@"
|