diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index e02b235..dc57326 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -105,7 +105,7 @@ services: command: - '--noseedbackup' - '--alias=lnd' - - '--externalip=127.0.0.1' + - '--externalip=${LND_EXTERNAL_IP:-127.0.0.1}' - '--bitcoin.active' - '--bitcoin.regtest' - '--bitcoin.node=bitcoind' @@ -147,7 +147,7 @@ services: environment: - NODE_ENV=production - PORT=3000 - - DOMAIN=http://localhost:${LNURL_SERVER_PORT:-30001} + - DOMAIN=${LNURL_DOMAIN:-http://localhost:${LNURL_SERVER_PORT:-30001}} - DATABASE_URL=sqlite:///data/lnurl.db - BITCOIN_RPC_HOST=bitcoind - BITCOIN_RPC_PORT=43782 diff --git a/test/helpers/constants.ts b/test/helpers/constants.ts index 728bec8..4e6d006 100644 --- a/test/helpers/constants.ts +++ b/test/helpers/constants.ts @@ -55,10 +55,14 @@ export type LndConfig = { macaroonPath: string; }; +export const lndHost = process.env.LND_HOST ?? 'localhost'; + export const lndConfig: LndConfig = { - server: 'localhost:10009', - restHost: 'localhost', - restPort: 8080, - tls: `${__dirname}/../../docker/lnd/tls.cert`, - macaroonPath: `${__dirname}/../../docker/lnd/data/chain/bitcoin/regtest/admin.macaroon`, + server: `${lndHost}:${process.env.LND_GRPC_PORT ?? '10009'}`, + restHost: lndHost, + restPort: Number.parseInt(process.env.LND_REST_PORT ?? '8080', 10), + tls: process.env.LND_TLS_PATH ?? `${__dirname}/../../docker/lnd/tls.cert`, + macaroonPath: + process.env.LND_MACAROON_PATH ?? + `${__dirname}/../../docker/lnd/data/chain/bitcoin/regtest/admin.macaroon`, }; diff --git a/test/helpers/lnd.ts b/test/helpers/lnd.ts index 17c858f..e43555d 100644 --- a/test/helpers/lnd.ts +++ b/test/helpers/lnd.ts @@ -9,7 +9,7 @@ import { tap, typeText, } from './actions'; -import { LndConfig } from './constants'; +import { LndConfig, lndHost } from './constants'; import { openSettings } from './navigation'; import createLndRpc, { LnRpc, WalletUnlockerRpc } from '@radar/lnrpc'; @@ -112,8 +112,8 @@ export async function connectToLND(lndNodeID: string, { navigationClose = true } await tap('NavigationAction'); await tap('FundManual'); await typeText('NodeIdInput', lndNodeID); - await typeText('PortInput', '9735'); - await typeText('HostInput', '0.0.0.0'); + await typeText('PortInput', process.env.LND_P2P_PORT ?? '9735'); + await typeText('HostInput', lndHost === 'localhost' ? '0.0.0.0' : lndHost); await confirmInputOnKeyboard(); await tap('ExternalContinue'); await sleep(1000); diff --git a/wdio.conf.ts b/wdio.conf.ts index 048d459..dc12f66 100644 --- a/wdio.conf.ts +++ b/wdio.conf.ts @@ -96,6 +96,13 @@ export const config: WebdriverIO.Config = { 'appium:app': iosApp, 'appium:autoGrantPermissions': true, 'appium:autoAcceptAlerts': false, + ...(process.env.E2E_LOCAL_HOST + ? { + 'appium:processArguments': { + env: { E2E_LOCAL_HOST: process.env.E2E_LOCAL_HOST }, + }, + } + : {}), // 'appium:fullReset': true, 'appium:noReset': false,