Merge branch 'refs/heads/feature/kestrel-avalonia-upgrade' into feature/http-server-modernization
# Conflicts: # Duplicati.Library.RestAPI/UpdatePollThread.cs # Duplicati/Server/Program.cs # Duplicati/Server/webroot/ngax/scripts/services/ServerStatus.js # Duplicati/WebserverCore/DuplicatiWebserver.cs
This commit is contained in:
@@ -59,7 +59,7 @@ namespace Duplicati.Server.WebServer.RESTMethods
|
||||
try
|
||||
{
|
||||
// Add install defaults/overrides, if present
|
||||
var path = SystemIO.IO_OS.PathCombine(Library.AutoUpdater.UpdaterManager.InstalledBaseDir, "newbackup.json");
|
||||
var path = SystemIO.IO_OS.PathCombine(Library.AutoUpdater.UpdaterManager.INSTALLATIONDIR, "newbackup.json");
|
||||
if (System.IO.File.Exists(path))
|
||||
{
|
||||
Newtonsoft.Json.Linq.JObject n;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Duplicati.Server.WebServer.RESTMethods
|
||||
{
|
||||
@@ -26,7 +27,16 @@ namespace Duplicati.Server.WebServer.RESTMethods
|
||||
{
|
||||
public void GET(string key, RequestInfo info)
|
||||
{
|
||||
var path = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Duplicati.Library.Utility.Utility.getEntryAssembly().Location), "licenses");
|
||||
var exefolder = System.IO.Path.GetDirectoryName(Duplicati.Library.Utility.Utility.getEntryAssembly().Location);
|
||||
var path = System.IO.Path.Combine(exefolder, "licenses");
|
||||
if (Duplicati.Library.Common.Platform.IsClientOSX && !Directory.Exists(path))
|
||||
{
|
||||
// Go up one, as the licenses cannot be in the binary folder in MacOS Packages
|
||||
exefolder = Path.GetDirectoryName(exefolder);
|
||||
var test = Path.Combine(exefolder, "Licenses");
|
||||
if (Directory.Exists(test))
|
||||
path = test;
|
||||
}
|
||||
info.OutputOK(Duplicati.License.LicenseReader.ReadLicenses(path));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,6 @@ namespace Duplicati.Server.WebServer.RESTMethods
|
||||
ServerVersionName = Duplicati.License.VersionNumbers.Version,
|
||||
ServerVersionType = Duplicati.Library.AutoUpdater.UpdaterManager.SelfVersion.ReleaseType,
|
||||
StartedBy = FIXMEGlobal.Origin,
|
||||
BaseVersionName = Duplicati.Library.AutoUpdater.UpdaterManager.BaseVersion.Displayname,
|
||||
DefaultUpdateChannel = Duplicati.Library.AutoUpdater.AutoUpdateSettings.DefaultUpdateChannel,
|
||||
DefaultUsageReportLevel = Duplicati.Library.UsageReporter.Reporter.DefaultReportLevel,
|
||||
ServerTime = DateTime.Now,
|
||||
@@ -65,8 +64,8 @@ namespace Duplicati.Server.WebServer.RESTMethods
|
||||
DirectorySeparator = System.IO.Path.DirectorySeparatorChar,
|
||||
PathSeparator = System.IO.Path.PathSeparator,
|
||||
CaseSensitiveFilesystem = Duplicati.Library.Utility.Utility.IsFSCaseSensitive,
|
||||
MonoVersion = Duplicati.Library.Utility.Utility.IsMono ? Duplicati.Library.Utility.Utility.MonoVersion.ToString() : null,
|
||||
MachineName = System.Environment.MachineName,
|
||||
PackageTypeId = Duplicati.Library.AutoUpdater.UpdaterManager.PackageTypeId,
|
||||
UserName = System.Environment.UserName,
|
||||
NewLine = System.Environment.NewLine,
|
||||
CLRVersion = System.Environment.Version.ToString(),
|
||||
|
||||
@@ -33,23 +33,6 @@ namespace Duplicati.Server.WebServer.RESTMethods
|
||||
FIXMEGlobal.UpdatePoller.CheckNow();
|
||||
info.OutputOK();
|
||||
return;
|
||||
|
||||
case "install":
|
||||
FIXMEGlobal.UpdatePoller.InstallUpdate();
|
||||
info.OutputOK();
|
||||
return;
|
||||
|
||||
case "activate":
|
||||
if (FIXMEGlobal.WorkThread.CurrentTask != null || FIXMEGlobal.WorkThread.CurrentTasks.Count != 0)
|
||||
{
|
||||
info.ReportServerError("Cannot activate update while task is running or scheduled");
|
||||
}
|
||||
else
|
||||
{
|
||||
FIXMEGlobal.UpdatePoller.ActivateUpdate();
|
||||
info.OutputOK();
|
||||
}
|
||||
return;
|
||||
|
||||
default:
|
||||
info.ReportClientError("No such action", System.Net.HttpStatusCode.NotFound);
|
||||
|
||||
Reference in New Issue
Block a user