Update to https, use new dockerfile

This commit is contained in:
nicolas.dorier
2018-07-10 19:33:54 +09:00
parent cdbbad1694
commit 3113097c4f
4 changed files with 36 additions and 25 deletions

View File

@@ -25,10 +25,10 @@ namespace BTCPayServer.Tests.Lnd
this.output = output; this.output = output;
initializeEnvironment(); initializeEnvironment();
MerchantLnd = new LndSwaggerClient(new LndRestSettings(new Uri("http://127.0.0.1:53280")) { AllowInsecure = true }); MerchantLnd = new LndSwaggerClient(new LndRestSettings(new Uri("https://127.0.0.1:53280")) { AllowInsecure = true });
InvoiceClient = new LndInvoiceClient(MerchantLnd); InvoiceClient = new LndInvoiceClient(MerchantLnd);
CustomerLnd = new LndSwaggerClient(new LndRestSettings(new Uri("http://127.0.0.1:53281")) { AllowInsecure = true }); CustomerLnd = new LndSwaggerClient(new LndRestSettings(new Uri("https://127.0.0.1:53281")) { AllowInsecure = true });
} }
private LndSwaggerClient MerchantLnd { get; set; } private LndSwaggerClient MerchantLnd { get; set; }

View File

@@ -52,9 +52,9 @@ namespace BTCPayServer.Tests
CustomerLightningD = (CLightningRPCClient)LightningClientFactory.CreateClient(GetEnvironment("TEST_CUSTOMERLIGHTNINGD", "type=clightning;server=tcp://127.0.0.1:30992/"), btc); CustomerLightningD = (CLightningRPCClient)LightningClientFactory.CreateClient(GetEnvironment("TEST_CUSTOMERLIGHTNINGD", "type=clightning;server=tcp://127.0.0.1:30992/"), btc);
MerchantLightningD = (CLightningRPCClient)LightningClientFactory.CreateClient(GetEnvironment("TEST_MERCHANTLIGHTNINGD", "type=clightning;server=tcp://127.0.0.1:30993/"), btc); MerchantLightningD = (CLightningRPCClient)LightningClientFactory.CreateClient(GetEnvironment("TEST_MERCHANTLIGHTNINGD", "type=clightning;server=tcp://127.0.0.1:30993/"), btc);
MerchantCharge = new ChargeTester(this, "TEST_MERCHANTCHARGE", "type=charge;server=http://127.0.0.1:54938/;api-token=foiewnccewuify", "merchant_lightningd", btc); MerchantCharge = new ChargeTester(this, "TEST_MERCHANTCHARGE", "type=charge;server=https://127.0.0.1:54938/;api-token=foiewnccewuify", "merchant_lightningd", btc);
MerchantLnd = new LndMockTester(this, "TEST_MERCHANTLND", "http://lnd:lnd@127.0.0.1:53280/", "merchant_lnd", btc); MerchantLnd = new LndMockTester(this, "TEST_MERCHANTLND", "https://lnd:lnd@127.0.0.1:53280/", "merchant_lnd", btc);
PayTester = new BTCPayServerTester(Path.Combine(_Directory, "pay")) PayTester = new BTCPayServerTester(Path.Combine(_Directory, "pay"))
{ {

View File

@@ -540,7 +540,7 @@ namespace BTCPayServer.Tests
// AllowInsecure can be set to allow http // AllowInsecure can be set to allow http
Assert.False(LightningConnectionString.TryParse($"type=lnd-rest;server=http://127.0.0.1:53280/;macaroon={macaroon};allowinsecure=false", false, out conn2)); Assert.False(LightningConnectionString.TryParse($"type=lnd-rest;server=http://127.0.0.1:53280/;macaroon={macaroon};allowinsecure=false", false, out conn2));
Assert.True(LightningConnectionString.TryParse($"type=lnd-rest;server=http://127.0.0.1:53280/;macaroon={macaroon};allowinsecure=true", false, out conn2)); Assert.True(LightningConnectionString.TryParse($"type=lnd-rest;server=http://127.0.0.1:53280/;macaroon={macaroon};allowinsecure=true", false, out conn2));
Assert.True(LightningConnectionString.TryParse($"type=lnd-rest;server=https://127.0.0.1:53280/;macaroon={macaroon};allowinsecure=true", false, out conn2)); Assert.True(LightningConnectionString.TryParse($"type=lnd-rest;server=http://127.0.0.1:53280/;macaroon={macaroon};allowinsecure=true", false, out conn2));
} }
[Fact] [Fact]

View File

@@ -19,8 +19,8 @@ services:
TESTS_HOSTNAME: tests TESTS_HOSTNAME: tests
TEST_MERCHANTLIGHTNINGD: "type=clightning;server=/etc/merchant_lightningd_datadir/lightning-rpc" TEST_MERCHANTLIGHTNINGD: "type=clightning;server=/etc/merchant_lightningd_datadir/lightning-rpc"
TEST_CUSTOMERLIGHTNINGD: "type=clightning;server=/etc/customer_lightningd_datadir/lightning-rpc" TEST_CUSTOMERLIGHTNINGD: "type=clightning;server=/etc/customer_lightningd_datadir/lightning-rpc"
TEST_MERCHANTCHARGE: "type=charge;server=http://lightning-charged:9112/;api-token=foiewnccewuify;allowinsecure=true" TEST_MERCHANTCHARGE: "type=charge;server=https://lightning-charged:9112/;api-token=foiewnccewuify;allowinsecure=true"
TEST_MERCHANTLND: "type=lnd-rest;server=http://lnd:lnd@127.0.0.1:53280/;allowinsecure=true" TEST_MERCHANTLND: "type=lnd-rest;server=https://lnd:lnd@127.0.0.1:53280/;allowinsecure=true"
TESTS_INCONTAINER: "true" TESTS_INCONTAINER: "true"
expose: expose:
- "80" - "80"
@@ -202,35 +202,45 @@ services:
merchant_lnd: merchant_lnd:
image: btcpayserver/lnd:0.4.2.0 image: btcpayserver/lnd:0.4.2.0
environment: environment:
RPCHOST: bitcoind:43782 LND_CHAIN: "btc"
RPCUSER: ceiwHEbqWI83 LND_ENVIRONMENT: "regtest"
RPCPASS: DwubwWsoo3 LND_EXTRA_ARGS: |
ZMQPATH: tcp://bitcoind:28332 restlisten=0.0.0.0:8080
NETWORK: regtest bitcoin.node=bitcoind
CHAIN: bitcoin bitcoind.rpchost=bitcoind:43782
BACKEND: bitcoind bitcoind.zmqpath=tcp://bitcoind:28332
DEBUG: debug bitcoind.rpcuser=ceiwHEbqWI83
EXTERNALIP: merchant_lnd:9735 bitcoind.rpcpass=DwubwWsoo3
externalip=merchant_lnd:9735
no-macaroons=1
debuglevel=debug
noencryptwallet=1
ports: ports:
- "53280:8080" - "53280:8080"
expose: expose:
- "9735" - "9735"
volumes: volumes:
- "merchant_lnd_datadir:/root/.lnd" - "merchant_lnd_datadir:/data"
- "bitcoin_datadir:/deps/.bitcoin"
links: links:
- bitcoind - bitcoind
customer_lnd: customer_lnd:
image: btcpayserver/lnd:0.4.2.0 image: btcpayserver/lnd:0.4.2.0
environment: environment:
RPCHOST: bitcoind:43782 LND_CHAIN: "btc"
RPCUSER: ceiwHEbqWI83 LND_ENVIRONMENT: "regtest"
RPCPASS: DwubwWsoo3 LND_EXTRA_ARGS: |
ZMQPATH: tcp://bitcoind:28332 restlisten=0.0.0.0:8080
NETWORK: regtest bitcoin.node=bitcoind
CHAIN: bitcoin bitcoind.rpchost=bitcoind:43782
BACKEND: bitcoind bitcoind.zmqpath=tcp://bitcoind:28332
DEBUG: debug bitcoind.rpcuser=ceiwHEbqWI83
bitcoind.rpcpass=DwubwWsoo3
externalip=customer_lnd:10009
no-macaroons=1
debuglevel=debug
noencryptwallet=1
ports: ports:
- "53281:8080" - "53281:8080"
expose: expose:
@@ -238,6 +248,7 @@ services:
- "10009" - "10009"
volumes: volumes:
- "customer_lnd_datadir:/root/.lnd" - "customer_lnd_datadir:/root/.lnd"
- "bitcoin_datadir:/deps/.bitcoin"
links: links:
- bitcoind - bitcoind