diff --git a/.env.example b/.env.example index d3090b19..010340bb 100644 --- a/.env.example +++ b/.env.example @@ -62,6 +62,10 @@ MINT_LND_TLS_CERT_PATH="/../tls.cert" # the host and port of the lnd grpc api MINT_LND_GRPC_HOST="https://localhost:10004" +# (optional) base64 encoded macaroon and tls certificate instead of the file paths +MINT_LND_MACAROON_BASE64="base64 encoded macaroon" +MINT_LND_TLS_CERT_BASE64="base64 encoded tls cert" + # (optional) onchain backend for the mint. Uses the same configuration as the lnd lightning backend #MINT_BTC_ONCHAIN_BACKEND=Lnd diff --git a/entrypoint.sh b/entrypoint.sh index adfb35cb..87861b78 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,22 +1,22 @@ #!/bin/sh -if [ -z "$LND_MACAROON_BASE64" ] || [ -z "$LND_TLS_CERT_BASE64" ]; then - echo "Warning: LND_MACAROON_BASE64 and LND_TLS_CERT_BASE64 not set" >&2 +if [ -z "$MINT_LND_MACAROON_BASE64" ] || [ -z "$MINT_LND_TLS_CERT_BASE64" ]; then + echo "Warning: MINT_LND_MACAROON_BASE64 and MINT_LND_TLS_CERT_BASE64 not set" >&2 exec "$@" exit 0 fi # Decode the base64 environment variables and write them to files mkdir -p /tmp/lndconf -echo "$LND_MACAROON_BASE64" | base64 -d > /tmp/lndconf/admin.macaroon +echo "$MINT_LND_MACAROON_BASE64" | base64 -d > /tmp/lndconf/admin.macaroon if [ $? -ne 0 ]; then - echo "LND_MACAROON_BASE64 is not valid base64" + echo "MINT_LND_MACAROON_BASE64 is not valid base64" exit 1 fi -echo "$LND_TLS_CERT_BASE64" | base64 -d > /tmp/lndconf/tls.cert +echo "$MINT_LND_TLS_CERT_BASE64" | base64 -d > /tmp/lndconf/tls.cert if [ $? -ne 0 ]; then - echo "LND_TLS_CERT_BASE64 is not valid base64" + echo "MINT_LND_TLS_CERT_BASE64 is not valid base64" exit 1 fi @@ -25,7 +25,5 @@ chmod 700 /tmp/lndconf chmod 400 /tmp/lndconf/admin.macaroon chmod 400 /tmp/lndconf/tls.cert -#chown -R 1000:1000 /tmp/lndconf - # Start your application exec "$@" \ No newline at end of file