From 09ddaf2a08101cbf49623f73f478b53b7e6373a8 Mon Sep 17 00:00:00 2001 From: Ionite Date: Fri, 4 Aug 2023 15:10:49 -0400 Subject: [PATCH 01/11] Allow missing commits for sentry release --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 80287394..5054d406 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -92,6 +92,7 @@ jobs: with: environment: production ignore_missing: true + ignore-empty: true version: StabilityMatrix.Avalonia@${{ env.GIT_TAG_NAME }} - name: Create Sentry release From 5cff99c5116a723d975078e6cb4e5f0d9ae6f379 Mon Sep 17 00:00:00 2001 From: Ionite Date: Fri, 4 Aug 2023 15:13:04 -0400 Subject: [PATCH 02/11] Fix ignore_missing casing and removed duplicate --- .github/workflows/release.yml | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5054d406..5abe1f55 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,21 +82,7 @@ jobs: path: ${{ env.out-name }} - name: Create Sentry release - if: ${{ github.event_name == 'release' || github.event.inputs.sentry-release == 'true' }} - uses: getsentry/action-release@v1 - env: - MAKE_SENTRY_RELEASE: ${{ secrets.SENTRY_PROJECT != '' }} - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - SENTRY_ORG: ${{ secrets.SENTRY_ORG }} - SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} - with: - environment: production - ignore_missing: true - ignore-empty: true - version: StabilityMatrix.Avalonia@${{ env.GIT_TAG_NAME }} - - - name: Create Sentry release - if: ${{ github.event_name == 'workflow_dispatch' }} + if: ${{ github.event.inputs.sentry-release == 'true' }} uses: getsentry/action-release@v1 env: MAKE_SENTRY_RELEASE: ${{ secrets.SENTRY_PROJECT != '' }} @@ -106,8 +92,9 @@ jobs: with: environment: production ignore_missing: true + ignore_empty: true version: StabilityMatrix.Avalonia@${{ github.event.inputs.version }} - + release-windows: name: Release (win-x64) From bfcbdbda533b803c9f0064a1f950d6cf26d11c34 Mon Sep 17 00:00:00 2001 From: Ionite Date: Thu, 10 Aug 2023 16:45:56 -0400 Subject: [PATCH 03/11] Add contents write permission to release CI --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5abe1f55..cbbb9c89 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,8 @@ name: Release +permissions: + contents: write + on: workflow_dispatch: inputs: From 332d44068a60c47a210f36594bcd22644d79d080 Mon Sep 17 00:00:00 2001 From: Ionite Date: Thu, 31 Aug 2023 17:01:58 -0400 Subject: [PATCH 04/11] Update dotnet-tools.json --- .config/dotnet-tools.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index b1761c61..5b4bb470 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -13,6 +13,12 @@ "commands": [ "xstyler" ] + }, + "csharpier": { + "version": "0.25.0", + "commands": [ + "dotnet-csharpier" + ] } } -} \ No newline at end of file +} From 90c52c82fd3c5eb2e967c5c2f67b7f30c1303534 Mon Sep 17 00:00:00 2001 From: Ionite Date: Thu, 31 Aug 2023 17:22:38 -0400 Subject: [PATCH 05/11] Add .csharpierrc.json Raise default print width --- .config/.csharpierrc.json | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .config/.csharpierrc.json diff --git a/.config/.csharpierrc.json b/.config/.csharpierrc.json new file mode 100644 index 00000000..c821bbeb --- /dev/null +++ b/.config/.csharpierrc.json @@ -0,0 +1,4 @@ +{ + "printWidth": 120, + "preprocessorSymbolSets": ["", "DEBUG", "DEBUG,CODE_STYLE"] +} From d6ef45dbe1d40c515d7c805eaf24af72622f0f7e Mon Sep 17 00:00:00 2001 From: Jacob McSwain Date: Fri, 1 Sep 2023 14:38:00 -0500 Subject: [PATCH 06/11] Fix 7zzs binary permissions The AppImage release of v2.3.3 errors while installing A1111 with `An error occurred trying to start process '/home/user/Applications/Data/Assets/7zzs' with working directory '/home/user/Applications'. Permission denied` The permissions applied were `-r----x--t`. I found a typo in the permissions, but also the `UnixFileMode` (https://learn.microsoft.com/en-us/dotnet/api/system.io.unixfilemode) is an enum which doesn't seem to cast from typical values like 0777. I also noticed the permissions were intended to be _quite_ permissive. This change also prevents `group` and `all` writes. --- StabilityMatrix.Avalonia/Assets.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/StabilityMatrix.Avalonia/Assets.cs b/StabilityMatrix.Avalonia/Assets.cs index 8e11c868..c5d6def8 100644 --- a/StabilityMatrix.Avalonia/Assets.cs +++ b/StabilityMatrix.Avalonia/Assets.cs @@ -25,6 +25,11 @@ internal static class Assets public static AvaloniaResource LicensesJson => new( "avares://StabilityMatrix.Avalonia/Assets/licenses.json"); + private const UnixFileMode unix755 = UnixFileMode.UserRead | UnixFileMode.UserWrite | + UnixFileMode.UserExecute | UnixFileMode.GroupRead | + UnixFileMode.GroupExecute | UnixFileMode.OtherRead | + UnixFileMode.OtherExecute; + [SupportedOSPlatform("windows")] [SupportedOSPlatform("linux")] [SupportedOSPlatform("macos")] @@ -32,9 +37,9 @@ internal static class Assets (PlatformKind.Windows, new AvaloniaResource("avares://StabilityMatrix.Avalonia/Assets/win-x64/7za.exe")), (PlatformKind.Linux | PlatformKind.X64, - new AvaloniaResource("avares://StabilityMatrix.Avalonia/Assets/linux-x64/7zzs", (UnixFileMode) 0777)), + new AvaloniaResource("avares://StabilityMatrix.Avalonia/Assets/linux-x64/7zzs", unix755)), (PlatformKind.MacOS | PlatformKind.Arm, - new AvaloniaResource("avares://StabilityMatrix.Avalonia/Assets/macos-arm64/7zz", (UnixFileMode) 0x777))); + new AvaloniaResource("avares://StabilityMatrix.Avalonia/Assets/macos-arm64/7zz", unix755))); [SupportedOSPlatform("windows")] [SupportedOSPlatform("linux")] From d03e47aeeb51d90e9fedd97ea6890426bf30c4a3 Mon Sep 17 00:00:00 2001 From: Jacob McSwain Date: Fri, 1 Sep 2023 15:10:58 -0500 Subject: [PATCH 07/11] Fix other erroneous casts of UnixFileMode --- StabilityMatrix.Avalonia/Program.cs | 6 +++++- .../ViewModels/Dialogs/UpdateViewModel.cs | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/StabilityMatrix.Avalonia/Program.cs b/StabilityMatrix.Avalonia/Program.cs index c693b224..0c2ba386 100644 --- a/StabilityMatrix.Avalonia/Program.cs +++ b/StabilityMatrix.Avalonia/Program.cs @@ -107,7 +107,11 @@ public class Program // Ensure permissions are set for unix if (Compat.IsUnix) { - File.SetUnixFileMode(targetExe, (UnixFileMode) 0x755); + File.SetUnixFileMode(targetExe, // 0755 + UnixFileMode.UserRead | UnixFileMode.UserWrite | + UnixFileMode.UserExecute | UnixFileMode.GroupRead | + UnixFileMode.GroupExecute | UnixFileMode.OtherRead | + UnixFileMode.OtherExecute); } // Start the new app diff --git a/StabilityMatrix.Avalonia/ViewModels/Dialogs/UpdateViewModel.cs b/StabilityMatrix.Avalonia/ViewModels/Dialogs/UpdateViewModel.cs index 22a6b9ab..02e4d213 100644 --- a/StabilityMatrix.Avalonia/ViewModels/Dialogs/UpdateViewModel.cs +++ b/StabilityMatrix.Avalonia/ViewModels/Dialogs/UpdateViewModel.cs @@ -97,7 +97,11 @@ public partial class UpdateViewModel : ContentDialogViewModelBase // On unix, we need to set the executable bit if (Compat.IsUnix) { - File.SetUnixFileMode(UpdateHelper.ExecutablePath, (UnixFileMode) 0x755); + File.SetUnixFileMode(UpdateHelper.ExecutablePath, // 0755 + UnixFileMode.UserRead | UnixFileMode.UserWrite | + UnixFileMode.UserExecute | UnixFileMode.GroupRead | + UnixFileMode.GroupExecute | UnixFileMode.OtherRead | + UnixFileMode.OtherExecute); } UpdateText = "Update complete. Restarting Stability Matrix in 3 seconds..."; From ce55736ebdb310165f1818e0544bcf8f5978fd84 Mon Sep 17 00:00:00 2001 From: Ionite Date: Mon, 4 Sep 2023 03:23:46 -0400 Subject: [PATCH 08/11] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5102cdfa..d087af3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to Stability Matrix will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html). +## v2.3.4 +### Fixed +- (Linux) Fixed permission error on updates [#103](https://github.com/LykosAI/StabilityMatrix/pull/103) + ## v2.3.3 ### Fixed - Fixed GPU recognition for Nvidia Tesla GPUs From 3ed09521d5680f439c665510f1708b68fd325bad Mon Sep 17 00:00:00 2001 From: Ionite Date: Mon, 4 Sep 2023 03:47:21 -0400 Subject: [PATCH 09/11] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d087af3f..8124cac0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2 ## v2.3.4 ### Fixed -- (Linux) Fixed permission error on updates [#103](https://github.com/LykosAI/StabilityMatrix/pull/103) +- Fixed [#108](https://github.com/LykosAI/StabilityMatrix/issues/108) - (Linux) Fixed permission error on updates [#103](https://github.com/LykosAI/StabilityMatrix/pull/103) ## v2.3.3 ### Fixed From 712ce977aed17ba27d5628bfe44f1a9f1b4dce70 Mon Sep 17 00:00:00 2001 From: Ionite Date: Mon, 4 Sep 2023 16:49:34 -0400 Subject: [PATCH 10/11] Fix LogViewer AddLogViewer not using correct instance --- .../LogViewer/Extensions/ServicesExtension.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/StabilityMatrix.Avalonia.Diagnostics/LogViewer/Extensions/ServicesExtension.cs b/StabilityMatrix.Avalonia.Diagnostics/LogViewer/Extensions/ServicesExtension.cs index 9ab61604..8d75a331 100644 --- a/StabilityMatrix.Avalonia.Diagnostics/LogViewer/Extensions/ServicesExtension.cs +++ b/StabilityMatrix.Avalonia.Diagnostics/LogViewer/Extensions/ServicesExtension.cs @@ -15,7 +15,7 @@ public static class ServicesExtension { public static IServiceCollection AddLogViewer(this IServiceCollection services) { - services.AddSingleton(); + services.AddSingleton(Core.Logging.LogDataStore.Instance); services.AddSingleton(); return services; From dbc22de50c2d28387730cd7e0603fff7d6240650 Mon Sep 17 00:00:00 2001 From: Ionite Date: Mon, 4 Sep 2023 16:51:50 -0400 Subject: [PATCH 11/11] Remove double debugger logging in DataStoreLoggerTarget --- .../LogViewer/DataStoreLoggerTarget.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/StabilityMatrix.Avalonia.Diagnostics/LogViewer/DataStoreLoggerTarget.cs b/StabilityMatrix.Avalonia.Diagnostics/LogViewer/DataStoreLoggerTarget.cs index 608b7245..5df8d0e9 100644 --- a/StabilityMatrix.Avalonia.Diagnostics/LogViewer/DataStoreLoggerTarget.cs +++ b/StabilityMatrix.Avalonia.Diagnostics/LogViewer/DataStoreLoggerTarget.cs @@ -67,8 +67,6 @@ public class DataStoreLoggerTarget : TargetWithLayout Exception = logEvent.Exception?.Message ?? (logLevel == MsLogLevel.Error ? message : ""), Color = _config!.Colors[logLevel], }); - - Debug.WriteLine($"--- [{logLevel.ToString()[..3]}] {message} - {logEvent.Exception?.Message ?? "no error"}"); } #endregion