Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/upgrade-to-sdk-style-pro…
Browse files Browse the repository at this point in the history
…jects' into feature/net5-kestrel

# Conflicts:
#	.appveyor.yml
#	.github/workflows/tests.yml
#	BuildTools/AutoUpdateBuilder/AutoUpdateBuilder.csproj
#	BuildTools/DependencyFinder/DependencyFinder.csproj
#	BuildTools/GnupgSigningTool/GnupgSigningTool.csproj
#	BuildTools/UpdateVersionStamp/UpdateVersionStamp.csproj
#	Duplicati CommandLine Only.sln
#	Duplicati.Library.RestAPI/RESTMethods/RequestInfo.cs
#	Duplicati.Library.RestAPI/Runner.cs
#	Duplicati.sln
#	Duplicati/CommandLine/BackendTester/Duplicati.CommandLine.BackendTester.csproj
#	Duplicati/CommandLine/BackendTester/app.config
#	Duplicati/CommandLine/BackendTool/Duplicati.CommandLine.BackendTool.csproj
#	Duplicati/CommandLine/BackendTool/app.config
#	Duplicati/CommandLine/ConfigurationImporter/Duplicati.CommandLine.ConfigurationImporter.csproj
#	Duplicati/CommandLine/Duplicati.CommandLine.csproj
#	Duplicati/CommandLine/RecoveryTool/Duplicati.CommandLine.RecoveryTool.csproj
#	Duplicati/CommandLine/app.config
#	Duplicati/GUI/Duplicati.GUI.TrayIcon/Assets/icons/normal-warning.png
#	Duplicati/GUI/Duplicati.GUI.TrayIcon/Duplicati.GUI.TrayIcon.csproj
#	Duplicati/GUI/Duplicati.GUI.TrayIcon/Program.cs
#	Duplicati/GUI/Duplicati.GUI.TrayIcon/app.config
#	Duplicati/Library/AutoUpdater/Duplicati.Library.AutoUpdater.csproj
#	Duplicati/Library/Backend/AlternativeFTP/Duplicati.Library.Backend.AlternativeFTP.csproj
#	Duplicati/Library/Backend/AzureBlob/Duplicati.Library.Backend.AzureBlob.csproj
#	Duplicati/Library/Backend/Backblaze/Duplicati.Library.Backend.Backblaze.csproj
#	Duplicati/Library/Backend/Box/Duplicati.Library.Backend.Box.csproj
#	Duplicati/Library/Backend/CloudFiles/Duplicati.Library.Backend.CloudFiles.csproj
#	Duplicati/Library/Backend/Dropbox/Duplicati.Library.Backend.Dropbox.csproj
#	Duplicati/Library/Backend/FTP/Duplicati.Library.Backend.FTP.csproj
#	Duplicati/Library/Backend/File/Duplicati.Library.Backend.File.csproj
#	Duplicati/Library/Backend/GoogleServices/Duplicati.Library.Backend.GoogleServices.csproj
#	Duplicati/Library/Backend/HubiC/Duplicati.Library.Backend.HubiC.csproj
#	Duplicati/Library/Backend/Idrivee2/Duplicati.Library.Backend.Idrivee2.csproj
#	Duplicati/Library/Backend/Jottacloud/Duplicati.Library.Backend.Jottacloud.csproj
#	Duplicati/Library/Backend/Mega/Duplicati.Library.Backend.Mega.csproj
#	Duplicati/Library/Backend/OAuthHelper/Duplicati.Library.OAuthHelper.csproj
#	Duplicati/Library/Backend/OneDrive/Duplicati.Library.Backend.OneDrive.csproj
#	Duplicati/Library/Backend/OpenStack/Duplicati.Library.Backend.OpenStack.csproj
#	Duplicati/Library/Backend/Rclone/Duplicati.Library.Backend.Rclone.csproj
#	Duplicati/Library/Backend/S3/Duplicati.Library.Backend.S3.csproj
#	Duplicati/Library/Backend/SSHv2/Duplicati.Library.Backend.SSHv2.csproj
#	Duplicati/Library/Backend/SharePoint/Duplicati.Library.Backend.SharePoint.csproj
#	Duplicati/Library/Backend/Sia/Duplicati.Library.Backend.Sia.csproj
#	Duplicati/Library/Backend/Storj/Duplicati.Library.Backend.Storj.csproj
#	Duplicati/Library/Backend/TahoeLAFS/Duplicati.Library.Backend.TahoeLAFS.csproj
#	Duplicati/Library/Backend/Tardigrade/Duplicati.Library.Backend.Tardigrade.csproj
#	Duplicati/Library/Backend/TencentCOS/Duplicati.Library.Backend.TencentCOS.csproj
#	Duplicati/Library/Backend/WEBDAV/Duplicati.Library.Backend.WEBDAV.csproj
#	Duplicati/Library/Common/Duplicati.Library.Common.csproj
#	Duplicati/Library/Compression/Duplicati.Library.Compression.csproj
#	Duplicati/Library/DynamicLoader/Duplicati.Library.DynamicLoader.csproj
#	Duplicati/Library/Encryption/Duplicati.Library.Encryption.csproj
#	Duplicati/Library/Interface/Duplicati.Library.Interface.csproj
#	Duplicati/Library/Localization/Duplicati.Library.Localization.csproj
#	Duplicati/Library/Logging/Duplicati.Library.Logging.csproj
#	Duplicati/Library/Main/Duplicati.Library.Main.csproj
#	Duplicati/Library/Modules/Builtin/CheckMonoSSL.cs
#	Duplicati/Library/Modules/Builtin/Duplicati.Library.Modules.Builtin.csproj
#	Duplicati/Library/Modules/Builtin/SendJabberMessage.cs
#	Duplicati/Library/SQLiteHelper/Duplicati.Library.SQLiteHelper.csproj
#	Duplicati/Library/Snapshots/Duplicati.Library.Snapshots.csproj
#	Duplicati/Library/UsageReporter/Duplicati.Library.UsageReporter.csproj
#	Duplicati/Library/Utility/Duplicati.Library.Utility.csproj
#	Duplicati/Library/Utility/HashAlgorithmHelper.cs
#	Duplicati/Library/Utility/Power/WindowsPowerSupplyState.cs
#	Duplicati/License/Duplicati.License.csproj
#	Duplicati/Server/Duplicati.Server.Serialization/Duplicati.Server.Serialization.csproj
#	Duplicati/Server/Duplicati.Server.csproj
#	Duplicati/Server/app.config
#	Duplicati/Service/Duplicati.Service.csproj
#	Duplicati/Service/app.config
#	Duplicati/Tools/Duplicati.Tools.csproj
#	Duplicati/UnitTest/Duplicati.UnitTest.csproj
#	Duplicati/UnitTest/GeneralBlackBoxTesting.cs
#	Duplicati/UnitTest/app.config
#	Duplicati/WindowsService/WindowsService.csproj
#	Installer/debian/docker/debian/control
#	Tools/SQLiteTool/SQLiteTool.csproj
#	Tools/ZipFileDebugger/ZipFileDebugger.csproj
#	guiTests/guiTest.py
#	thirdparty/UnixSupport/UnixSupport.csproj
#	thirdparty/alphavss/Homepage.txt
#	thirdparty/alphavss/License.txt
#	thirdparty/alphavss/licensedata.json
  • Loading branch information
tsuckow committed Mar 1, 2024
2 parents ab3a0f5 + 72e47e4 commit a3bbf63
Show file tree
Hide file tree
Showing 249 changed files with 4,154 additions and 3,015 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- Thank you for taking the time to submit an issue using this template. By following the instructions and filling out the sections below, you will help the developers get the necessary information to fix your issue. You may remove sections that aren't relevant to your particular case. You can also preview your report before submitting it. -->
<!-- Please note that the issues are a tool for Duplicati developers. If you post here, you are supposed to want to help the project by providing timely information on your problem so it can be fixed. If this is not the case, please use the forum instead -->
<!-- Love Duplicati? Please consider supporting our collective at https://opencollective.com/duplicati/donate. -->

<!-- Please search to see if an issue has already been created for your report. -->
Expand Down
105 changes: 105 additions & 0 deletions .github/workflows/buildsrelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Build release installers

on:
workflow_dispatch

env:
build_directory: "Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Release"

jobs:
macbuild:
name: mac build and installers
runs-on: macos-latest
strategy:
fail-fast: false

steps:
- name: Install NuGet
uses: nuget/[email protected]

- name: Checkout Source
uses: actions/checkout@v3

- name: Restore NuGet Packages
run: |
nuget restore Duplicati.sln
nuget restore "BuildTools/UpdateVersionStamp/UpdateVersionStamp.sln"
- name: Build Duplicati (macOS)
run: |
msbuild /property:Configuration=Release "BuildTools/UpdateVersionStamp/UpdateVersionStamp.sln"
RELEASE_TIMESTAMP=$(date +%Y-%m-%d)
RELEASE_TYPE="canary"
RELEASE_INC_VERSION=$(cat Updates/build_version.txt)
RELEASE_INC_VERSION=$((RELEASE_INC_VERSION+1))
RELEASE_VERSION="2.0.7.${RELEASE_INC_VERSION}"
RELEASE_NAME="${RELEASE_VERSION}_${RELEASE_TYPE}_${RELEASE_TIMESTAMP}"
echo "${RELEASE_NAME}" > "Duplicati/License/VersionTag.txt"
echo "${RELEASE_TYPE}" > "Duplicati/Library/AutoUpdater/AutoUpdateBuildChannel.txt"
mono "BuildTools/UpdateVersionStamp/bin/Release/UpdateVersionStamp.exe" --version="${RELEASE_VERSION}"
msbuild -p:DefineConstants=\"ENABLE_GTK\;XAMARIN_MAC\" -p:Configuration=Release Duplicati.sln
- name: Build installers (OSX)
run: |
Installer/OSX/artifact_mac.sh
- name: Upload build results
uses: actions/upload-artifact@v3
with:
retention-days: 5
name: build-results-mac
path: ~/artifacts/**/*

windowsbuild:
name: windows installer
runs-on: windows-latest
needs: macbuild
steps:
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Install NuGet
uses: nuget/[email protected]
- uses: actions/checkout@v3
- name: Retrieve mac build
uses: actions/download-artifact@v3
with:
name: build-results-mac
path: ~/macartifacts
- name: set env
run: echo "ZIPBUILDFILE=$(resolve-path ~ | select-object -expandproperty path)\macartifacts\$(get-childitem ~\macartifacts\*.zip | select-object -first 1 -expandproperty name )" >> $env:GITHUB_ENV
- name: Build installers (Windows)
run: |
echo ${{ env.ZIPBUILDFILE }}
.\\Installer\\Windows\\artifact_win.bat ${{ env.ZIPBUILDFILE }}
- name: Upload build results
uses: actions/upload-artifact@v3
with:
retention-days: 5
name: build-results-windows
path: ~/artifacts/**/*

debianbuild:
name: debian like installer
runs-on: ubuntu-latest
needs: macbuild
steps:
- uses: actions/checkout@v3
- name: Retrieve mac build
uses: actions/download-artifact@v3
with:
name: build-results-mac
path: ~/macartifacts
- name: set env
run: echo "ZIPBUILDFILE=$(ls ~/macartifacts/*.zip | tail -1)" >> $GITHUB_ENV
- name: Build installers (Deb)
run: |
echo ${{ env.ZIPBUILDFILE }}
sudo apt install debhelper
Installer/debian/artifact_deb.sh ${{ env.ZIPBUILDFILE }}
- name: Upload build results
uses: actions/upload-artifact@v3
with:
retention-days: 5
name: build-results-linux
path: ~/artifacts/**/*

108 changes: 108 additions & 0 deletions .github/workflows/buildsreleasefrompr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Build release installers from PR

on:
pull_request:
types: [ labeled ]

env:
build_directory: "Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Release"

jobs:
macbuild:
if: ${{ github.event.label.name == 'testbuild' }}
name: mac build and installers
runs-on: macos-latest
strategy:
fail-fast: false


steps:
- name: Install NuGet
uses: nuget/[email protected]

- name: Checkout Source
uses: actions/checkout@v3

- name: Restore NuGet Packages
run: |
nuget restore Duplicati.sln
nuget restore "BuildTools/UpdateVersionStamp/UpdateVersionStamp.sln"
- name: Build Duplicati (macOS)
run: |
msbuild /property:Configuration=Release "BuildTools/UpdateVersionStamp/UpdateVersionStamp.sln"
RELEASE_TIMESTAMP=$(date +%Y-%m-%d)
RELEASE_TYPE="canary"
RELEASE_INC_VERSION=$(cat Updates/build_version.txt)
RELEASE_INC_VERSION=$((RELEASE_INC_VERSION+1))
RELEASE_VERSION="2.0.7.${RELEASE_INC_VERSION}"
RELEASE_NAME="${RELEASE_VERSION}_${RELEASE_TYPE}_${RELEASE_TIMESTAMP}"
echo "${RELEASE_NAME}" > "Duplicati/License/VersionTag.txt"
echo "${RELEASE_TYPE}" > "Duplicati/Library/AutoUpdater/AutoUpdateBuildChannel.txt"
mono "BuildTools/UpdateVersionStamp/bin/Release/UpdateVersionStamp.exe" --version="${RELEASE_VERSION}"
msbuild -p:DefineConstants=\"ENABLE_GTK\;XAMARIN_MAC\" -p:Configuration=Release Duplicati.sln
- name: Build installers (OSX)
run: |
Installer/OSX/artifact_mac.sh
- name: Upload build results
uses: actions/upload-artifact@v3
with:
retention-days: 5
name: build-results-mac
path: ~/artifacts/**/*

windowsbuild:
name: windows installer
runs-on: windows-latest
needs: macbuild
steps:
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Install NuGet
uses: nuget/[email protected]
- uses: actions/checkout@v3
- name: Retrieve mac build
uses: actions/download-artifact@v3
with:
name: build-results-mac
path: ~/macartifacts
- name: set env
run: echo "ZIPBUILDFILE=$(resolve-path ~ | select-object -expandproperty path)\macartifacts\$(get-childitem ~\macartifacts\*.zip | select-object -first 1 -expandproperty name )" >> $env:GITHUB_ENV
- name: Build installers (Windows)
run: |
echo ${{ env.ZIPBUILDFILE }}
.\\Installer\\Windows\\artifact_win.bat ${{ env.ZIPBUILDFILE }}
- name: Upload build results
uses: actions/upload-artifact@v3
with:
retention-days: 5
name: build-results-windows
path: ~/artifacts/**/*

debianbuild:
name: debian like installer
runs-on: ubuntu-latest
needs: macbuild
steps:
- uses: actions/checkout@v3
- name: Retrieve mac build
uses: actions/download-artifact@v3
with:
name: build-results-mac
path: ~/macartifacts
- name: set env
run: echo "ZIPBUILDFILE=$(ls ~/macartifacts/*.zip | tail -1)" >> $GITHUB_ENV
- name: Build installers (Deb)
run: |
echo ${{ env.ZIPBUILDFILE }}
sudo apt install debhelper
Installer/debian/artifact_deb.sh ${{ env.ZIPBUILDFILE }}
- name: Upload build results
uses: actions/upload-artifact@v3
with:
retention-days: 5
name: build-results-linux
path: ~/artifacts/**/*

25 changes: 25 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Close inactive issues
on:
schedule:
- cron: "30 1 * * *"

jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/stale@v8
with:
days-before-issue-stale: 15
days-before-issue-close: 15
stale-issue-label: "stale"
stale-issue-message: "This issue is stale because it has been open for 15 days with no activity."
close-issue-message: "This issue was closed because it has been inactive for 15 days since being marked as stale."
days-before-pr-stale: -1
days-before-pr-close: -1
exempt-all-assignees: true
only-labels: "pending user feedback"
exempt-issue-labels: "bug,enhancement,good first issue,backend enhancement,backend issue,backup corruption,bounty,bugreport attached,core logic,docker,filters,help wanted,linux,localization,MacOS,mono,performance issue,reproduced,server side,ssl/tls issue,Synology,tests,translation,UI,windows"
repo-token: ${{ secrets.GITHUB_TOKEN }}

2 changes: 1 addition & 1 deletion BuildTools/AutoUpdateBuilder/AutoUpdateBuilder.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 0 additions & 3 deletions BuildTools/AutoUpdateBuilder/app.config

This file was deleted.

3 changes: 0 additions & 3 deletions BuildTools/DependencyFinder/app.config

This file was deleted.

3 changes: 0 additions & 3 deletions BuildTools/GnupgSigningTool/app.config

This file was deleted.

1 change: 0 additions & 1 deletion BuildTools/UpdateVersionStamp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ static Program()
{
var versionre = @"(?<version>\d+\.\d+\.(\*|(\d+(\.(\*|\d+)))?))";
FILEMAP = new Dictionary<string, Regex>(StringComparer.InvariantCultureIgnoreCase);
FILEMAP.Add("AssemblyInfo.cs", new Regex(@"(\[assembly\: AssemblyVersion\(\""" + versionre + @"""\)\])|(\[assembly\: AssemblyFileVersion\(\""" + versionre + @"\""\)\])|(\[assembly\: AssemblyFileVersionAttribute\(\""" + versionre + @"\""\)\])"));
FILEMAP.Add("UpgradeData.wxi", new Regex(@"\<\?define ProductVersion\=\""" + versionre + @"\"" \?\>"));
FILEMAP.Add("AssemblyRedirects.xml", new Regex(@"newVersion\=\""" + versionre + @"\"""));
FILEMAP.Add("index.html", new Regex(@"\?v\=" + versionre));
Expand Down
4 changes: 4 additions & 0 deletions Duplicati.Library.RestAPI/RESTMethods/RequestInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ public void OutputError(object item = null, System.Net.HttpStatusCode code = Sys
{
Response.Status = code;
Response.Reason = reason ?? "Error";
if(item == null && reason != null)
{
item = new { Error = reason };
}
BodyWriter.WriteJsonObject(item);
}

Expand Down
45 changes: 24 additions & 21 deletions Duplicati.Library.RestAPI/Runner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ public static Duplicati.Library.Interface.IBasicResults Run(IRunnerData data, bo
}
catch (Exception ex)
{
FIXMEGlobal.DataConnection.LogError(data.Backup.ID, string.Format("Failed while executing \"{0}\" with id: {1}", data.Operation, data.Backup.ID), ex);
FIXMEGlobal.DataConnection.LogError(data.Backup.ID, string.Format("Failed while executing {0} \"{1}\" (id: {2})", data.Operation, data.Backup.Name, data.Backup.ID), ex);
UpdateMetadataError(data.Backup, ex);
Library.UsageReporter.Reporter.Report(ex);

Expand Down Expand Up @@ -755,44 +755,47 @@ private static void UpdateMetadata(Duplicati.Server.Serialization.Interface.IBac
backup.Metadata["LastRestoreFinished"] = Library.Utility.Utility.SerializeDateTime(result.EndTime.ToUniversalTime());
}

if (result is IParsedBackendStatistics r2)
if (result is IParsedBackendStatistics r2 && !result.Interrupted)
{
UpdateMetadata(backup, r2);
}

if (result is IBackendStatsticsReporter r3)
if (result is IBackendStatsticsReporter r3 && !result.Interrupted)
{
if (r3.BackendStatistics is IParsedBackendStatistics statistics)
UpdateMetadata(backup, statistics);
}

if (result is ICompactResults r4)
if (result is ICompactResults r4 && !result.Interrupted)
{
UpdateMetadataLastCompact(backup, r4);

if (r4.VacuumResults != null)
UpdateMetadataLastVacuum(backup, r4.VacuumResults);
}

if (result is IVacuumResults r5)
if (result is IVacuumResults r5 && !result.Interrupted)
{
UpdateMetadataLastVacuum(backup, r5);
}

if (result is IBackupResults r)
{
backup.Metadata["SourceFilesSize"] = r.SizeOfExaminedFiles.ToString();
backup.Metadata["SourceFilesCount"] = r.ExaminedFiles.ToString();
backup.Metadata["SourceSizeString"] = Duplicati.Library.Utility.Utility.FormatSizeString(r.SizeOfExaminedFiles);
backup.Metadata["LastBackupStarted"] = Library.Utility.Utility.SerializeDateTime(r.BeginTime.ToUniversalTime());
backup.Metadata["LastBackupFinished"] = Library.Utility.Utility.SerializeDateTime(r.EndTime.ToUniversalTime());
backup.Metadata["LastBackupDuration"] = r.Duration.ToString();

if (r.CompactResults != null)
UpdateMetadataLastCompact(backup, r.CompactResults);

if (r.VacuumResults != null)
UpdateMetadataLastVacuum(backup, r.VacuumResults);
if (!result.Interrupted)
{
backup.Metadata["SourceFilesSize"] = r.SizeOfExaminedFiles.ToString();
backup.Metadata["SourceFilesCount"] = r.ExaminedFiles.ToString();
backup.Metadata["SourceSizeString"] = Duplicati.Library.Utility.Utility.FormatSizeString(r.SizeOfExaminedFiles);
backup.Metadata["LastBackupStarted"] = Library.Utility.Utility.SerializeDateTime(r.BeginTime.ToUniversalTime());
backup.Metadata["LastBackupFinished"] = Library.Utility.Utility.SerializeDateTime(r.EndTime.ToUniversalTime());
backup.Metadata["LastBackupDuration"] = r.Duration.ToString();

if (r.CompactResults != null)
UpdateMetadataLastCompact(backup, r.CompactResults);

if (r.VacuumResults != null)
UpdateMetadataLastVacuum(backup, r.VacuumResults);
}

if (r.FilesWithError > 0 || r.Warnings.Any() || r.Errors.Any())
{
Expand Down Expand Up @@ -838,19 +841,19 @@ private static void UpdateMetadata(Duplicati.Server.Serialization.Interface.IBac
);
}
}
else if (result.ParsedResult != Library.Interface.ParsedResultType.Success)
else if (result.ParsedResult != ParsedResultType.Success)
{
var type = result.ParsedResult == Library.Interface.ParsedResultType.Warning
var type = result.ParsedResult == ParsedResultType.Warning
? NotificationType.Warning
: NotificationType.Error;

var title = result.ParsedResult == Library.Interface.ParsedResultType.Warning
var title = result.ParsedResult == ParsedResultType.Warning
? (backup.IsTemporary ?
"Warning" : string.Format("Warning while running {0}", backup.Name))
: (backup.IsTemporary ?
"Error" : string.Format("Error while running {0}", backup.Name));

var message = result.ParsedResult == Library.Interface.ParsedResultType.Warning
var message = result.ParsedResult == ParsedResultType.Warning
? string.Format("Got {0} warning(s)", result.Warnings.Count())
: string.Format("Got {0} error(s)", result.Errors.Count());

Expand Down
Loading

0 comments on commit a3bbf63

Please sign in to comment.