mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
After a plugin install or uninstall, restart now just kill the process instead of requiring SSH with docker install
This commit is contained in:
@@ -33,6 +33,7 @@ using Microsoft.AspNetCore.Identity;
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||||
using Microsoft.AspNetCore.Routing;
|
using Microsoft.AspNetCore.Routing;
|
||||||
|
using Microsoft.Extensions.Hosting;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using MimeKit;
|
using MimeKit;
|
||||||
@@ -87,7 +88,8 @@ namespace BTCPayServer.Controllers
|
|||||||
IOptions<ExternalServicesOptions> externalServiceOptions,
|
IOptions<ExternalServicesOptions> externalServiceOptions,
|
||||||
Logs logs,
|
Logs logs,
|
||||||
LinkGenerator linkGenerator,
|
LinkGenerator linkGenerator,
|
||||||
EmailSenderFactory emailSenderFactory
|
EmailSenderFactory emailSenderFactory,
|
||||||
|
IHostApplicationLifetime applicationLifetime
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
_policiesSettings = policiesSettings;
|
_policiesSettings = policiesSettings;
|
||||||
@@ -110,6 +112,7 @@ namespace BTCPayServer.Controllers
|
|||||||
Logs = logs;
|
Logs = logs;
|
||||||
_linkGenerator = linkGenerator;
|
_linkGenerator = linkGenerator;
|
||||||
_emailSenderFactory = emailSenderFactory;
|
_emailSenderFactory = emailSenderFactory;
|
||||||
|
ApplicationLifetime = applicationLifetime;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Route("server/maintenance")]
|
[Route("server/maintenance")]
|
||||||
@@ -131,7 +134,7 @@ namespace BTCPayServer.Controllers
|
|||||||
{
|
{
|
||||||
vm.CanUseSSH = _sshState.CanUseSSH;
|
vm.CanUseSSH = _sshState.CanUseSSH;
|
||||||
|
|
||||||
if (!vm.CanUseSSH)
|
if (command != "soft-restart" && !vm.CanUseSSH)
|
||||||
{
|
{
|
||||||
TempData[WellKnownTempData.ErrorMessage] = "Maintenance feature requires access to SSH properly configured in BTCPay Server configuration.";
|
TempData[WellKnownTempData.ErrorMessage] = "Maintenance feature requires access to SSH properly configured in BTCPay Server configuration.";
|
||||||
return View(vm);
|
return View(vm);
|
||||||
@@ -220,6 +223,11 @@ namespace BTCPayServer.Controllers
|
|||||||
return error;
|
return error;
|
||||||
TempData[WellKnownTempData.SuccessMessage] = $"BTCPay will restart momentarily.";
|
TempData[WellKnownTempData.SuccessMessage] = $"BTCPay will restart momentarily.";
|
||||||
}
|
}
|
||||||
|
else if (command == "soft-restart")
|
||||||
|
{
|
||||||
|
TempData[WellKnownTempData.SuccessMessage] = $"BTCPay will restart momentarily.";
|
||||||
|
ApplicationLifetime.StopApplication();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return NotFound();
|
return NotFound();
|
||||||
@@ -286,6 +294,7 @@ namespace BTCPayServer.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
public IHttpClientFactory HttpClientFactory { get; }
|
public IHttpClientFactory HttpClientFactory { get; }
|
||||||
|
public IHostApplicationLifetime ApplicationLifetime { get; }
|
||||||
|
|
||||||
[Route("server/policies")]
|
[Route("server/policies")]
|
||||||
public async Task<IActionResult> Policies()
|
public async Task<IActionResult> Policies()
|
||||||
|
|||||||
@@ -127,7 +127,7 @@
|
|||||||
@if (Model.CanShowRestart)
|
@if (Model.CanShowRestart)
|
||||||
{
|
{
|
||||||
<form method="post" asp-action="Maintenance" class="mt-2">
|
<form method="post" asp-action="Maintenance" class="mt-2">
|
||||||
<button type="submit" name="command" value="restart" class="btn btn-info" asp-action="Maintenance">Restart now</button>
|
<button type="submit" name="command" value="soft-restart" class="btn btn-info" asp-action="Maintenance">Restart now</button>
|
||||||
</form>
|
</form>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
### Improvement
|
### Improvement
|
||||||
|
|
||||||
|
* After a plugin install or uninstall, restart now just kill the process instead of requiring SSH with docker install @NicolasDorier
|
||||||
* Checkout v2: Display and copy addresses (#4489) @dennisreimann
|
* Checkout v2: Display and copy addresses (#4489) @dennisreimann
|
||||||
* Checkout v2: Configure countdown timer (#4471) @dennisreimann
|
* Checkout v2: Configure countdown timer (#4471) @dennisreimann
|
||||||
* Unify 2FA login boxes (#4506) @dennisreimann
|
* Unify 2FA login boxes (#4506) @dennisreimann
|
||||||
|
|||||||
Reference in New Issue
Block a user