Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
27b686095c | |||
cd2fef0dab | |||
743288fa47 | |||
270ebead49 |
@ -2,7 +2,7 @@
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
<Version>1.0.2.40</Version>
|
||||
<Version>1.0.2.41</Version>
|
||||
<NoWarn>NU1701,CA1816,CA1308,CA1810,CA2208</NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
|
@ -82,7 +82,9 @@ namespace BTCPayServer.Configuration
|
||||
throw new ConfigException($"Invalid setting {net.CryptoCode}.lightning, " + Environment.NewLine +
|
||||
$"If you have a lightning server use: 'type=clightning;server=/root/.lightning/lightning-rpc', " + Environment.NewLine +
|
||||
$"If you have a lightning charge server: 'type=charge;server=https://charge.example.com;api-token=yourapitoken'" + Environment.NewLine +
|
||||
$"If you have a lnd server: 'type=lnd-rest;server=https://lnd:lnd@lnd.example.com;macaron=abf239...;certthumbprint=2abdf302...'");
|
||||
$"If you have a lnd server: 'type=lnd-rest;server=https://lnd:lnd@lnd.example.com;macaroon=abf239...;certthumbprint=2abdf302...'" + Environment.NewLine +
|
||||
$" lnd server: 'type=lnd-rest;server=https://lnd:lnd@lnd.example.com;macaroonfilepath=/root/.lnd/admin.macaroon;certthumbprint=2abdf302...'" + Environment.NewLine +
|
||||
error);
|
||||
}
|
||||
if(connectionString.IsLegacy)
|
||||
{
|
||||
|
@ -7,13 +7,17 @@ using System.Threading.Tasks;
|
||||
using System.Text;
|
||||
using NBXplorer;
|
||||
using NBitcoin;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace BTCPayServer.Services
|
||||
{
|
||||
public class BTCPayServerEnvironment
|
||||
{
|
||||
public BTCPayServerEnvironment(IHostingEnvironment env, BTCPayNetworkProvider provider)
|
||||
public BTCPayServerEnvironment(IHostingEnvironment env, BTCPayNetworkProvider provider, IHttpContextAccessor httpContext)
|
||||
{
|
||||
ExpectedHost = httpContext.HttpContext.Request.Host.Value;
|
||||
ExpectedDomain = httpContext.HttpContext.Request.Host.Host;
|
||||
ExpectedProtocol = httpContext.HttpContext.Request.Scheme;
|
||||
Version = typeof(BTCPayServerEnvironment).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyFileVersionAttribute>().Version;
|
||||
#if DEBUG
|
||||
Build = "Debug";
|
||||
@ -27,6 +31,11 @@ namespace BTCPayServer.Services
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string ExpectedDomain { get; set; }
|
||||
public string ExpectedHost { get; set; }
|
||||
public string ExpectedProtocol { get; set; }
|
||||
|
||||
public NetworkType NetworkType { get; set; }
|
||||
public string Version
|
||||
{
|
||||
|
@ -78,9 +78,19 @@
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="badUrl" class="alert alert-danger alert-dismissible" style="display:none; position:absolute; top:75px;" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<span>BTCPay is expecting you to access this website from <b>@(env.ExpectedProtocol)://@(env.ExpectedHost)/</b>. If you want to change this expectation:</span>
|
||||
<ul>
|
||||
<li>Either starts BTCPay with <b>--externalurl @(env.ExpectedProtocol)://@(env.ExpectedHost)/</b></li>
|
||||
<li>Or, if using docker-compose deployment, setting environment variable <b>BTCPAY_PROTOCOL=@(env.ExpectedProtocol)</b> and <b>BTCPAY_HOST=@(env.ExpectedDomain)</b></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
|
||||
@RenderBody()
|
||||
|
||||
<footer class="siteFooter bg-dark text-white">
|
||||
@ -93,6 +103,14 @@
|
||||
}
|
||||
|
||||
@RenderSection("Scripts", required: false)
|
||||
|
||||
<script type="text/javascript">
|
||||
var expectedDomain = @Html.Raw(Json.Serialize(env.ExpectedHost));
|
||||
var expectedProtocol = @Html.Raw(Json.Serialize(env.ExpectedProtocol));
|
||||
if (window.location.host != expectedDomain || window.location.protocol != expectedProtocol + ":") {
|
||||
document.getElementById("badUrl").style.display = "block";
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
@ -7,33 +7,49 @@
|
||||
|
||||
<h4>@ViewData["Title"]</h4>
|
||||
<partial name="_StatusMessage" for="StatusMessage" />
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div asp-validation-summary="All" class="text-danger"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-warning alert-dismissible" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<p>
|
||||
<span>A connection to a lightning charge node or clightning unix socket is required to generate lightning network enabled invoices. <br /></span>
|
||||
<span>This is experimental and not advised for production so keep in mind:</span>
|
||||
</p>
|
||||
<ul>
|
||||
<li>You might lose your money</li>
|
||||
<li>The devs of BTCPay Server don't know what they are doing and won't be able to help you if shit hit the fan</li>
|
||||
<li>You approve being #reckless and being the sole responsible party for your loss</li>
|
||||
<li>BTCPay Server relies on a <a href="https://github.com/ElementsProject/lightning-charge">Lightning Charge</a> node or CLightning unix socket</li>
|
||||
<li>If you have no idea what above mean, search by yourself</li>
|
||||
<li>If you still have no idea how to use lightning, give up for now, we'll make it easier later</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="col-md-10">
|
||||
<form method="post">
|
||||
<div class="form-group">
|
||||
<h5>Lightning node url</h5>
|
||||
<span>This URL should point to an installed lightning charge server for @Model.CryptoCode</span>
|
||||
<p>This connection string encapsulates the necessary information BTCPay needs to connect to your lightning node, we currently support:</p>
|
||||
<ul>
|
||||
<li><code>clightning</code> via TCP or unix domain socket connection</li>
|
||||
<li><code>lightning charge</code> via HTTPS</li>
|
||||
<li><code>lnd</code> via the REST proxy</li>
|
||||
</ul>
|
||||
<table class="table table-sm table-responsive-md">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Examples</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<th class="small"><b>type=</b>clightning;<b>server=</b>unix://root/.lightning/lightning-rpc</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="small"><b>type=</b>clightning;<b>server=</b>tcp://1.1.1.1:27743/</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="small"><b>type=</b>lnd-rest;<b>server=</b>http://mylnd:8080/;<b>macaroonfilepath=</b>/root/.lnd/admin.macaroon;<b>allowinsecure=</b>true</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="small"><b>type=</b>lnd-rest;<b>server=</b>https://mylnd:8080/;<b>macaroon=</b>abef263adfe...</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="small"><b>type=</b>lnd-rest;<b>server=</b>https://mylnd:8080/;<b>macaroon=</b>abef263adfe...;<b>certthumbprint=</b>abef263adfe...</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="small"><b>type=</b>charge;<b>server=</b>https://charge:8080/;<b>api-token=</b>myapitoken...</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Note that the <code>certthumbprint</code> to connect to your LND node can be obtained through this command line:</p>
|
||||
<p><pre><code>openssl x509 -noout -fingerprint -sha256 -inform pem -in /root/.lnd/tls.cert</code></pre></p>
|
||||
<p>You can omit <code>certthumprint</code> if you the certificate is trusted by your machine</p>
|
||||
<p>You can set <code>allowinsecure</code> to <code>true</code> if your LND REST server is using HTTP or HTTPS with an untrusted certificate which you don't know the <code>certthumprint</code></p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="ConnectionString"></label>
|
||||
|
Reference in New Issue
Block a user