From 0af1adcfb812e11015effc64dba69386d0f5915f Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Tue, 24 Jul 2018 22:10:37 +0900 Subject: [PATCH] Can update server --- BTCPayServer/BTCPayServer.csproj | 2 +- BTCPayServer/Controllers/ServerController.cs | 7 +++++++ BTCPayServer/Views/Server/Maintenance.cshtml | 12 +++++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/BTCPayServer/BTCPayServer.csproj b/BTCPayServer/BTCPayServer.csproj index 6b39df890..148a9dbb8 100644 --- a/BTCPayServer/BTCPayServer.csproj +++ b/BTCPayServer/BTCPayServer.csproj @@ -2,7 +2,7 @@ Exe netcoreapp2.1 - 1.0.2.66 + 1.0.2.67 NU1701,CA1816,CA1308,CA1810,CA2208 diff --git a/BTCPayServer/Controllers/ServerController.cs b/BTCPayServer/Controllers/ServerController.cs index 0a0348195..aaf8cd80c 100644 --- a/BTCPayServer/Controllers/ServerController.cs +++ b/BTCPayServer/Controllers/ServerController.cs @@ -225,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(); diff --git a/BTCPayServer/Views/Server/Maintenance.cshtml b/BTCPayServer/Views/Server/Maintenance.cshtml index 5f5038901..651abf497 100644 --- a/BTCPayServer/Views/Server/Maintenance.cshtml +++ b/BTCPayServer/Views/Server/Maintenance.cshtml @@ -36,13 +36,23 @@
-
+ +
+
Update
+ Click here to update your server +
+
+
+ +
+