Skip to content

Commit

Permalink
refactor: move vars to .env
Browse files Browse the repository at this point in the history
  • Loading branch information
bodymindarts committed Sep 20, 2023
1 parent 64c69a2 commit f4b75e5
Show file tree
Hide file tree
Showing 13 changed files with 216 additions and 126 deletions.
118 changes: 118 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
export DOCKER_HOST_IP=${DOCKER_HOST_IP:-127.0.0.1}
export NETWORK=regtest

# dev/lnd/tls.cert.base64
export LND1_TLS="LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNZVENDQWdlZ0F3SUJBZ0lSQU9zZzdYWFR4cnVZYlhkeTY2d3RuN1F3Q2dZSUtvWkl6ajBFQXdJd09ERWYKTUIwR0ExVUVDaE1XYkc1a0lHRjFkRzluWlc1bGNtRjBaV1FnWTJWeWRERVZNQk1HQTFVRUF4TU1PRFl4T1RneApNak5tT0Roak1CNFhEVEl6TURFeE9USXdOREUxTTFvWERUTTBNRGN5TVRJd05ERTFNMW93T0RFZk1CMEdBMVVFCkNoTVdiRzVrSUdGMWRHOW5aVzVsY21GMFpXUWdZMlZ5ZERFVk1CTUdBMVVFQXhNTU9EWXhPVGd4TWpObU9EaGoKTUZrd0V3WUhLb1pJemowQ0FRWUlLb1pJemowREFRY0RRZ0FFM1lieUlKWU1Vcm8zZkl0UFFucysxZ2lpTXI5NQpJUXRmclFDQ2JhOWVtcjI4TENmbk1vYy9VQVFwUlg3QVlvVFRneUdiMFBuZGNUODF5ZVgvYTlPa0RLT0I4VENCCjdqQU9CZ05WSFE4QkFmOEVCQU1DQXFRd0V3WURWUjBsQkF3d0NnWUlLd1lCQlFVSEF3RXdEd1lEVlIwVEFRSC8KQkFVd0F3RUIvekFkQmdOVkhRNEVGZ1FVL1AxRHpJUkRzTEhHMU10d3NrZE5nZ0lub1Mwd2daWUdBMVVkRVFTQgpqakNCaTRJTU9EWXhPVGd4TWpObU9EaGpnZ2xzYjJOaGJHaHZjM1NDRFd4dVpD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cmVhZBIFd3JpdGUaFAoFcGVlcnMSBHJlYWQSBXdyaXRlGhgKBnNpZ25lchIIZ2VuZXJhdGUSBHJlYWQAAAYg2XkV+4Z4inbfXGZivRoY+r7KHNZhgxkCEdKByxbeb/Q="

# dev/lnd/loop/regtest/loopd1-1.loop.macaroon.base64
export LND1_LOOP_MACAROON="AgEEbG9vcAJ3AwoQRGymK6/vfF3wwuVmaTj3RhIBMBoMCgRhdXRoEgRyZWFkGg8KBGxvb3ASAmluEgNvdXQaGgoLc3VnZ2VzdGlvbnMSBHJlYWQSBXdyaXRlGhUKBHN3YXASB2V4ZWN1dGUSBHJlYWQaDQoFdGVybXMSBHJlYWQAAAYgAFS/qTZItZ3ZKksQkfXAKFnsb0JS5Ok3Oi5fAgCaE/k="
# dev/lnd/loop/regtest/loopd2-1.loop.macaroon.base64
export LND2_LOOP_MACAROON="AgEEbG9vcAJ3AwoQ6Ntr7+DpuicdMgmVPKvDVxIBMBoMCgRhdXRoEgRyZWFkGg8KBGxvb3ASAmluEgNvdXQaGgoLc3VnZ2VzdGlvbnMSBHJlYWQSBXdyaXRlGhUKBHN3YXASB2V4ZWN1dGUSBHJlYWQaDQoFdGVybXMSBHJlYWQAAAYgU6bTJC50AuYehDtb9U2s4EuH7C2Tf8eAppPPOFeUXds="

# dev/lnd/loop/regtest/loopd1-1.tls.cert.base64
export LND1_LOOP_TLS="LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNKakNDQWMyZ0F3SUJBZ0lSQU1memVXM0J0UWJaaTdxSjZoQk5vMHN3Q2dZSUtvWkl6ajBFQXdJd09URWcKTUI0R0ExVUVDaE1YYkc5dmNDQmhkWFJ2WjJWdVpYSmhkR1ZrSUdObGNuUXhGVEFUQmdOVkJBTVREREpqWkdRMQpOMlptWlRZeFpEQWVGdzB5TWpBNU1EY3lNVE15TWpSYUZ3MHlNekV4TURJeU1UTXlNalJhTURreElEQWVCZ05WCkJBb1RGMnh2YjNBZ1lYVjBiM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URrd056SXhNekl5TlZvWERUSXpNVEV3TWpJeE16SXlOVm93T1RFZ01CNEdBMVVFCkNoTVhiRzl2Y0NCaGRYUnZaMlZ1WlhKaGRHVmtJR05sY25ReEZUQVRCZ05WQkFNVERHVXhZalE0Wm1KbE5EWTIKTXpCWk1CTUdCeXFHU000OUFnRUdDQ3FHU000OUF3RUhBMElBQkVYbzlndHpkUnFMTWFhdjJ1VDA4eHlTUUpTKwpoMFNMcUMrdnpzR0RhZ2owOXg3UW9ud3oralo0eHppeklsdWVOY0JlWDYzd3VGZ0dwOTlBMW9mMDQyU2pnYlV3CmdiSXdEZ1lEVlIwUEFRSC9CQVFEQWdLa01CTUdBMVVkSlFRTU1Bb0dDQ3NHQVFVRkJ3TUJNQThHQTFVZEV3RUIKL3dRRk1BTUJBZjh3SFFZRFZSME9CQllFRkZOM2E3WkY5Y2FSUGJnNDJXYitOYnVYM2hTYU1Gc0dBMVVkRVFSVQpNRktDREdVeFlqUTRabUpsTkRZMk00SUpiRzlqWVd4b2IzTjBnZ1IxYm1sNGdncDFibWw0Y0dGamEyVjBnZ2RpCmRXWmpiMjV1aHdSL0FBQUJoeEFBQUFBQUFBQUFBQUFBQUFBQUFBQUJod1NzR3dBUU1Bb0dDQ3FHU000OUJBTUMKQTBnQU1FVUNJUURUcUpnVitReks2N3lSN1lGcWtyQkN6aEQ2OExZcjBBM1JMWFF1ckM2d21BSWdZNGdESjA1eQpRTjJCY2YvaEl6VHJwb1ZlK3Y0blBRREg3bXBFQXRyOE96MD0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo="

# dev/lnd/regtest/lnd1.pubkey
export LND1_PUBKEY="03ca1907342d5d37744cb7038375e1867c24a87564c293157c95b2a9d38dcfb4c2"
# dev/lnd/regtest/lnd2.pubkey
export LND2_PUBKEY="039341ef13e776dc1611502cf510110d9ac5cdc252141f5997adcfd72cef34c3a7"

export BITCOINDPORT=18443

export BITCOINDADDR=${DOCKER_HOST_IP}
export BITCOIND_SIGNER_PORT=18543
export BITCOIND_SIGNER_ADDR=${DOCKER_HOST_IP}
export BITCOINDRPCPASS=rpcpassword

export LND1_DNS=${DOCKER_HOST_IP}
export LND2_DNS=${DOCKER_HOST_IP}
export LNDOUTSIDE1ADDR=${DOCKER_HOST_IP}
export LNDOUTSIDE2ADDR=${DOCKER_HOST_IP}

export LND1_RPCPORT=10009
export LND2_RPCPORT=10010

export LNDOUTSIDE1RPCPORT=10012
export LNDOUTSIDE2RPCPORT=10013

export LND1_TYPE=offchain,onchain
export LND2_TYPE=offchain

export LND1_NAME=lnd1
export LND2_NAME=lnd2

export MONGODB_CON=mongodb://${DOCKER_HOST_IP}:27017/galoy

export REDIS_0_DNS=${DOCKER_HOST_IP}
export REDIS_0_PORT=6379
export REDIS_MASTER_NAME="mymaster"
export REDIS_PASSWORD=""
export REDIS_TYPE="standalone"

export BRIA_HOST=${DOCKER_HOST_IP}
export BRIA_PORT=2742
export BRIA_API_KEY="bria_dev_000000000000000000000"

export PRICE_HOST=${DOCKER_HOST_IP}
export PRICE_PORT=50051

export PRICE_HISTORY_HOST=${DOCKER_HOST_IP}
export PRICE_HISTORY_PORT=50052

export OATHKEEPER_DECISION_ENDPOINT=http://${DOCKER_HOST_IP}:4456

export WEBSOCKET_PORT=4000

export GEETEST_ID="geetest_id"
export GEETEST_KEY="geetest_key"

export TWILIO_ACCOUNT_SID="AC_twilio_id"
export TWILIO_AUTH_TOKEN="AC_twilio_auth_token"
export TWILIO_VERIFY_SERVICE_ID="VA_twilio_service"

export COMMITHASH="hash"
export HELMREVISION="1"

export LOG_LEVEL="info"

export KRATOS_MASTER_USER_PASSWORD="passwordHardtoFindWithNumber123"
export KRATOS_ADMIN_URL="http://localhost:4434"
export KRATOS_CALLBACK_API_KEY="The-Value-of-My-Key"
export KRATOS_PG_HOST="localhost"
export KRATOS_PG_PORT="5433"

export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4318"
# TODO: rename to OTEL_SERVICE_NAME
# https://opentelemetry.io/docs/concepts/sdk-configuration/general-sdk-configuration/#otel_service_name
export TRACING_SERVICE_NAME="galoy-dev"

export MATTERMOST_WEBHOOK_URL="https://chat.galoy.io/hooks/sometoken"

export KRATOS_PG_CON="postgres://dbuser:secret@localhost:5433/default?sslmode=disable"

export UNSECURE_DEFAULT_LOGIN_CODE="000000"
export UNSECURE_IP_FROM_REQUEST_OBJECT=true

export SVIX_SECRET="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2OTE2NzIwMTQsImV4cCI6MjAwNzAzMjAxNCwibmJmIjoxNjkxNjcyMDE0LCJpc3MiOiJzdml4LXNlcnZlciIsInN1YiI6Im9yZ18yM3JiOFlkR3FNVDBxSXpwZ0d3ZFhmSGlyTXUifQ.b9s0aWSisNdUNki4edabBEToLNSwjC9-AiJQr4J3y4E"
export SVIX_ENDPOINT="http://localhost:8071"
export SVIX_CALLBACK_URL=http://bats-tests:8080/webhook/

export KRATOS_PUBLIC_API="http://localhost:4433"
export KRATOS_ADMIN_API="http://localhost:4434"
112 changes: 5 additions & 107 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,110 +1,8 @@
export DOCKER_HOST_IP=${DOCKER_HOST_IP:-127.0.0.1}
export NETWORK=regtest
dotenv

export LND1_TLS=$(cat dev/lnd/tls.cert.base64)
export LND2_TLS=$LND1_TLS
use flake

export TLSOUTSIDE1=$LND1_TLS
export TLSOUTSIDE2=$LND1_TLS

export LND1_MACAROON=$(cat dev/lnd/$NETWORK/lnd1.admin.macaroon.base64)
export LND2_MACAROON=$(cat dev/lnd/$NETWORK/lnd2.admin.macaroon.base64)

export MACAROONOUTSIDE1=$(cat dev/lnd/$NETWORK/lnd-outside-1.admin.macaroon.base64)
export MACAROONOUTSIDE2=$(cat dev/lnd/$NETWORK/lnd-outside-2.admin.macaroon.base64)


export LND1_LOOP_MACAROON=$(cat dev/lnd/loop/$NETWORK/loopd1-1.loop.macaroon.base64)
export LND2_LOOP_MACAROON=$(cat dev/lnd/loop/$NETWORK/loopd2-1.loop.macaroon.base64)
export LND1_LOOP_TLS=$(cat dev/lnd/loop/$NETWORK/loopd1-1.tls.cert.base64)
export LND2_LOOP_TLS=$(cat dev/lnd/loop/$NETWORK/loopd2-1.tls.cert.base64)

export LND1_PUBKEY=$(cat dev/lnd/$NETWORK/lnd1.pubkey)
export LND2_PUBKEY=$(cat dev/lnd/$NETWORK/lnd2.pubkey)

export BITCOINDPORT=18443
export BITCOINDADDR=${DOCKER_HOST_IP}
export BITCOIND_SIGNER_PORT=18543
export BITCOIND_SIGNER_ADDR=${DOCKER_HOST_IP}
export BITCOINDRPCPASS=rpcpassword

export LND1_DNS=${DOCKER_HOST_IP}
export LND2_DNS=${DOCKER_HOST_IP}
export LNDOUTSIDE1ADDR=${DOCKER_HOST_IP}
export LNDOUTSIDE2ADDR=${DOCKER_HOST_IP}

export LND1_RPCPORT=10009
export LND2_RPCPORT=10010

export LNDOUTSIDE1RPCPORT=10012
export LNDOUTSIDE2RPCPORT=10013

export LND1_TYPE=offchain,onchain
export LND2_TYPE=offchain

export LND1_NAME=lnd1
export LND2_NAME=lnd2

export MONGODB_CON=mongodb://${DOCKER_HOST_IP}:27017/galoy

export REDIS_0_DNS=${DOCKER_HOST_IP}
export REDIS_0_PORT=6379
export REDIS_MASTER_NAME="mymaster"
export REDIS_PASSWORD=""
export REDIS_TYPE="standalone"

export BRIA_HOST=${DOCKER_HOST_IP}
export BRIA_PORT=2742
export BRIA_API_KEY="bria_dev_000000000000000000000"

export PRICE_HOST=${DOCKER_HOST_IP}
export PRICE_PORT=50051

export PRICE_HISTORY_HOST=${DOCKER_HOST_IP}
export PRICE_HISTORY_PORT=50052

export OATHKEEPER_DECISION_ENDPOINT=http://${DOCKER_HOST_IP}:4456

export WEBSOCKET_PORT=4000

export GEETEST_ID="geetest_id"
export GEETEST_KEY="geetest_key"

export TWILIO_ACCOUNT_SID="AC_twilio_id"
export TWILIO_AUTH_TOKEN="AC_twilio_auth_token"
export TWILIO_VERIFY_SERVICE_ID="VA_twilio_service"

export COMMITHASH="hash"
export HELMREVISION="1"

export LOG_LEVEL="info"

export KRATOS_MASTER_USER_PASSWORD="passwordHardtoFindWithNumber123"
export KRATOS_ADMIN_URL="http://localhost:4434"
export KRATOS_CALLBACK_API_KEY="The-Value-of-My-Key"
export KRATOS_PG_HOST="localhost"
export KRATOS_PG_PORT="5433"

export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4318"
# TODO: rename to OTEL_SERVICE_NAME
# https://opentelemetry.io/docs/concepts/sdk-configuration/general-sdk-configuration/#otel_service_name
export TRACING_SERVICE_NAME="galoy-dev"

export MATTERMOST_WEBHOOK_URL="https://chat.galoy.io/hooks/sometoken"

export KRATOS_PG_CON="postgres://dbuser:secret@localhost:5433/default?sslmode=disable"

export UNSECURE_DEFAULT_LOGIN_CODE="000000"
export UNSECURE_IP_FROM_REQUEST_OBJECT=true

export SVIX_SECRET="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2OTE2NzIwMTQsImV4cCI6MjAwNzAzMjAxNCwibmJmIjoxNjkxNjcyMDE0LCJpc3MiOiJzdml4LXNlcnZlciIsInN1YiI6Im9yZ18yM3JiOFlkR3FNVDBxSXpwZ0d3ZFhmSGlyTXUifQ.b9s0aWSisNdUNki4edabBEToLNSwjC9-AiJQr4J3y4E"
export SVIX_ENDPOINT="http://localhost:8071"
export SVIX_CALLBACK_URL=http://bats-tests:8080/webhook/

export KRATOS_PUBLIC_API="http://localhost:4433"
export KRATOS_ADMIN_API="http://localhost:4434"

# add your HONEYCOMB_API_KEY and HONEYCOMB_DATASET in .envrc.secrets to test HONEYCOMB
if [ -f .envrc.secrets ]; then
source .envrc.secrets
# add your HONEYCOMB_API_KEY and HONEYCOMB_DATASET in .env.local to test HONEYCOMB
if [ -f .env.local ]; then
source .env.local
fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ generated.gql
.swc

.envrc.secrets
.envrc.local

# bats e2e tests
-
Expand Down
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ RUN yarn build

RUN yarn install --frozen-lockfile --production

RUN touch .env

FROM gcr.io/distroless/nodejs20-debian11
COPY --from=BUILD_IMAGE /app/.env /app/.env
COPY --from=BUILD_IMAGE /app/lib /app/lib
COPY --from=BUILD_IMAGE /app/src/config/locales /app/lib/config/locales
COPY --from=BUILD_IMAGE /app/node_modules /app/node_modules

WORKDIR /app
COPY ./*.js ./package.json ./tsconfig.json ./yarn.lock ./.env ./
COPY ./*.js ./package.json ./tsconfig.json ./yarn.lock ./

USER 1000

Expand Down
5 changes: 4 additions & 1 deletion Dockerfile-debug
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ COPY ./test ./test

RUN yarn build

RUN touch .env

FROM gcr.io/distroless/nodejs20-debian11:debug
COPY --from=BUILD_IMAGE /app/.env /app/.env
COPY --from=BUILD_IMAGE /app/lib /app/lib
COPY --from=BUILD_IMAGE /app/src/config/locales /app/lib/config/locales
COPY --from=BUILD_IMAGE /app/node_modules /app/node_modules

WORKDIR /app
COPY ./*.js ./package.json ./tsconfig.json ./yarn.lock ./.env ./
COPY ./*.js ./package.json ./tsconfig.json ./yarn.lock ./

### debug only
COPY --from=BUILD_IMAGE /app/src /app/src
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile-migrate
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ COPY --from=BUILD_IMAGE /app/node_modules /app/node_modules
COPY --from=BUILD_IMAGE /app/scripts /app/scripts

WORKDIR /app
COPY ./*.js ./package.json ./tsconfig.json ./yarn.lock ./.env ./
COPY ./*.js ./package.json ./tsconfig.json ./yarn.lock ./
RUN touch .env

### debug only
COPY --from=BUILD_IMAGE /app/src /app/src
Expand Down
5 changes: 4 additions & 1 deletion Dockerfile-websocket
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ RUN yarn build

RUN yarn install --frozen-lockfile --production

RUN touch .env

FROM gcr.io/distroless/nodejs20-debian11
COPY --from=BUILD_IMAGE /app/.env /app/.env
COPY --from=BUILD_IMAGE /app/lib /app/lib
COPY --from=BUILD_IMAGE /app/src/config/locales /app/lib/config/locales
COPY --from=BUILD_IMAGE /app/node_modules /app/node_modules

WORKDIR /app
COPY ./*.js ./package.json ./tsconfig.json ./yarn.lock ./.env ./
COPY ./*.js ./package.json ./tsconfig.json ./yarn.lock ./

USER 1000

Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ update-price-history:
docker compose run price-history node servers/history/cron.js

start-main:
. ./.envrc && yarn tsnd --respawn --files -r tsconfig-paths/register -r src/services/tracing.ts \
. ./.env && yarn tsnd --respawn --files -r tsconfig-paths/register -r src/services/tracing.ts \
src/servers/graphql-main-server.ts | yarn pino-pretty -c -l

start-main-fast:
yarn run watch-main | yarn pino-pretty -c -l

start-trigger:
. ./.envrc && yarn tsnd --respawn --files -r tsconfig-paths/register -r src/services/tracing.ts \
. ./.env && yarn tsnd --respawn --files -r tsconfig-paths/register -r src/services/tracing.ts \
src/servers/trigger.ts | yarn pino-pretty -c -l

start-cron: start-deps
. ./.envrc && yarn tsnd --files -r tsconfig-paths/register -r src/services/tracing.ts \
. ./.env && yarn tsnd --files -r tsconfig-paths/register -r src/services/tracing.ts \
src/servers/cron.ts | yarn pino-pretty -c -l

start-ws:
. ./.envrc && yarn tsnd --respawn --files -r tsconfig-paths/register -r src/services/tracing.ts \
. ./.env && yarn tsnd --respawn --files -r tsconfig-paths/register -r src/services/tracing.ts \
src/servers/ws-server.ts | yarn pino-pretty -c -l

start-loopd:
Expand All @@ -44,7 +44,7 @@ start-ws-ci:
node lib/servers/ws-server.js

exporter: start-deps
. ./.envrc && yarn tsnd --respawn --files -r tsconfig-paths/register -r src/services/tracing.ts \
. ./.env && yarn tsnd --respawn --files -r tsconfig-paths/register -r src/services/tracing.ts \
src/servers/exporter.ts | yarn pino-pretty -c -l

watch:
Expand Down Expand Up @@ -116,7 +116,7 @@ execute-integration-from-within-container:
NODE_ENV=test LOGLEVEL=error $(BIN_DIR)/jest --config ./test/integration/jest.config.js --bail --runInBand --ci --reporters=default --reporters=jest-junit

unit-in-ci:
. ./.envrc && \
. ./.env && \
LOGLEVEL=warn $(BIN_DIR)/jest --config ./test/unit/jest.config.js --ci --bail --maxWorkers=50%

check-implicit:
Expand All @@ -131,7 +131,7 @@ check-code: check-implicit
yarn madge-check

create-tmp-env-ci:
. ./.envrc && \
. ./.env && \
envsubst < .env.ci > tmp.env.ci

# 16 is exit code for critical https://classic.yarnpkg.com/lang/en/docs/cli/audit
Expand Down
Loading

0 comments on commit f4b75e5

Please sign in to comment.