Compare commits

...

6 Commits

4 changed files with 29 additions and 7 deletions

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<Version>1.0.2.63</Version>
<Version>1.0.2.68</Version>
<NoWarn>NU1701,CA1816,CA1308,CA1810,CA2208</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@ -208,7 +208,11 @@ namespace BTCPayServer.Controllers
}
catch (Exception ex)
{
ModelState.AddModelError(nameof(vm.DNSDomain), $"Invalid domain ({ex.Message})");
var messages = new List<object>();
messages.Add(ex.Message);
if (ex.InnerException != null)
messages.Add(ex.InnerException.Message);
ModelState.AddModelError(nameof(vm.DNSDomain), $"Invalid domain ({string.Join(", ", messages.ToArray())})");
return View(vm);
}
}
@ -221,6 +225,13 @@ namespace BTCPayServer.Controllers
builder.Query = null;
StatusMessage = $"Domain name changing... the server will restart, please use \"{builder.Uri.AbsoluteUri}\"";
}
else if (command == "update")
{
var error = RunSSH(vm, command, $"sudo bash -c '. /etc/profile.d/btcpay-env.sh && btcpay-update.sh'");
if (error != null)
return error;
StatusMessage = $"The server might restart soon if an update is available...";
}
else
{
return NotFound();

View File

@ -13,7 +13,7 @@
<form method="post">
<div class="form-group">
<h5>SSH Settings</h5>
<span>You need SSH credentials to run any of those actions</span>
<span>For changing any settings, you need to enter your SSH credentials:</span>
</div>
<div class="form-group">
<label asp-for="UserName"></label>
@ -28,21 +28,31 @@
</div>
<div class="form-group">
<h5>Actions</h5>
<span>Run any of those administrative functions</span>
<h5>Change domain name</h5>
<span>You can change the domain name of your server by following <a href="https://github.com/btcpayserver/btcpayserver-doc/blob/master/ChangeDomain.md">this guide</a></span>
</div>
<div class="form-group">
<div class="input-group">
<input asp-for="DNSDomain" class="form-control" />
<span class="input-group-btn">
<button type="submit" class="btn btn-primary" name="command" value="changedomain" title="Change domain">
<button name="command" type="submit" class="btn btn-primary" value="changedomain" title="Change domain">
<span class="fa fa-check"></span> Confirm
</button>
</span>
</div>
<span asp-validation-for="DNSDomain" class="text-danger"></span>
</div>
<div class="form-group">
<h5>Update</h5>
<span>Click here to update your server</span>
</div>
<div class="form-group">
<div class="input-group">
<button name="command" type="submit" class="btn btn-primary" value="update">Update</button>
</div>
</div>
</form>
</div>
</div>

View File

@ -15,7 +15,8 @@ ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
WORKDIR /app
# This should be removed soon https://github.com/dotnet/corefx/issues/30003
RUN apk add --no-cache curl
RUN mkdir /datadir
ENV BTCPAY_DATADIR=/datadir
VOLUME /datadir