Compare commits

...

12 Commits

Author SHA1 Message Date
Łukasz Domeradzki
23f9f58f6c Use more user-friendly warning 2025-12-14 02:26:34 +01:00
Łukasz Domeradzki
f0dfbc5ee4 Remove --system-required from docker, as there's no dbus there 2025-12-14 02:17:14 +01:00
Łukasz Domeradzki
8ac4efe392 Make --system-required work on Linux (systemd) (#3526)
* Initial POC

* Extract the parts that interest us from auto-generated file

* Add support for no dbus being available

* Add final bits
2025-12-14 01:46:22 +01:00
renovate[bot]
d4691ced51 chore(deps): update asf-ui digest to 9e1d5e3 2025-12-13 09:45:31 +00:00
renovate[bot]
d679bf9307 chore(deps): update asf-ui digest to cd1f819 2025-12-13 02:47:37 +00:00
renovate[bot]
564d0bf9a4 chore(deps): update github artifact actions (#3525)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-12 22:26:26 +01:00
renovate[bot]
2f848fe585 chore(deps): update dessant/lock-threads action to v6 (#3524)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-12 22:24:35 +01:00
renovate[bot]
bf34d2e91e chore(deps): update dependency scalar.aspnetcore to 2.11.6 2025-12-12 17:14:56 +00:00
renovate[bot]
83e4c7f63a chore(deps): update asf-ui digest to ab86669 2025-12-12 05:56:06 +00:00
ArchiBot
1e2e52943d Automatic translations update 2025-12-12 02:30:16 +00:00
Łukasz Domeradzki
4a9ecc52c1 Bump 2025-12-11 20:22:46 +01:00
Łukasz Domeradzki
10fc914ac1 Add Winter Sale 2025 to SalesBlacklist 2025-12-11 20:22:25 +01:00
13 changed files with 118 additions and 25 deletions

View File

@@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Lock inactive threads
uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 # v5.0.1
uses: dessant/lock-threads@7266a7ce5c1df01b1c6db85bf8cd86c737dadbe7 # v6.0.0
with:
discussion-inactive-days: 90
issue-inactive-days: 60

View File

@@ -43,7 +43,7 @@ jobs:
run: npm run-script deploy --no-progress --prefix ASF-ui
- name: Upload ASF-ui
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
compression-level: 1
if-no-files-found: error
@@ -95,7 +95,7 @@ jobs:
run: dotnet --info
- name: Download previously built ASF-ui
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: ASF-ui
path: ASF-ui/dist
@@ -367,7 +367,7 @@ jobs:
subject-path: out/ASF-${{ matrix.variant }}.zip
- name: Upload ASF-${{ matrix.variant }}
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
compression-level: 1
if-no-files-found: error
@@ -416,7 +416,7 @@ jobs:
- name: Upload ArchiSteamFarm.OfficialPlugins.Monitoring
if: ${{ matrix.os == 'ubuntu-latest' && matrix.variant == 'generic' }}
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
compression-level: 1
if-no-files-found: error
@@ -441,55 +441,55 @@ jobs:
show-progress: false
- name: Download ASF-generic artifact from ubuntu-latest
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: ubuntu-latest_ASF-generic
path: out
- name: Download ASF-linux-arm artifact from ubuntu-latest
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: ubuntu-latest_ASF-linux-arm
path: out
- name: Download ASF-linux-arm64 artifact from ubuntu-latest
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: ubuntu-latest_ASF-linux-arm64
path: out
- name: Download ASF-linux-x64 artifact from ubuntu-latest
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: ubuntu-latest_ASF-linux-x64
path: out
- name: Download ASF-osx-arm64 artifact from macos-latest
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: macos-latest_ASF-osx-arm64
path: out
- name: Download ASF-osx-x64 artifact from macos-latest
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: macos-latest_ASF-osx-x64
path: out
- name: Download ASF-win-arm64 artifact from windows-latest
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: windows-latest_ASF-win-arm64
path: out
- name: Download ASF-win-x64 artifact from windows-latest
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: windows-latest_ASF-win-x64
path: out
- name: Download ArchiSteamFarm.OfficialPlugins.Monitoring artifact
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: ArchiSteamFarm.OfficialPlugins.Monitoring
path: out
@@ -514,7 +514,7 @@ jobs:
subject-path: out/SHA512SUMS
- name: Upload SHA512SUMS
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
compression-level: 1
if-no-files-found: error
@@ -527,7 +527,7 @@ jobs:
subject-path: out/SHA512SUMS.sign
- name: Upload SHA512SUMS.sign
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
compression-level: 1
if-no-files-found: error

2
ASF-ui

Submodule ASF-ui updated: c703223091...9e1d5e33d4

View File

@@ -24,6 +24,7 @@
<PackageReference Include="SteamKit2" />
<PackageReference Include="System.Composition" />
<PackageReference Include="System.Security.Cryptography.ProtectedData" />
<PackageReference Include="Tmds.DBus.Protocol" />
</ItemGroup>
<ItemGroup>

View File

@@ -37,6 +37,8 @@ using System.Threading.Tasks;
using ArchiSteamFarm.Localization;
using ArchiSteamFarm.Storage;
using ArchiSteamFarm.Web;
using Microsoft.Win32.SafeHandles;
using Tmds.DBus.Protocol;
namespace ArchiSteamFarm.Core;
@@ -69,13 +71,20 @@ internal static class OS {
}
}
private static SafeHandle? InhibitLock;
private static Mutex? SingleInstance;
internal static void CoreInit(bool minimized, bool systemRequired) {
internal static async Task CoreInit(bool minimized, bool systemRequired) {
if (minimized) {
MinimizeConsoleWindow();
}
if (OperatingSystem.IsLinux()) {
if (systemRequired) {
await LinuxKeepSystemActive().ConfigureAwait(false);
}
}
if (OperatingSystem.IsWindows()) {
if (systemRequired) {
WindowsKeepSystemActive();
@@ -181,6 +190,12 @@ internal static class OS {
// Instead, we'll dispose the mutex which should automatically release it by the CLR
SingleInstance.Dispose();
SingleInstance = null;
// Release the inhibit lock as well, if needed
if (InhibitLock != null) {
InhibitLock.Dispose();
InhibitLock = null;
}
}
internal static bool VerifyEnvironment() {
@@ -261,6 +276,79 @@ internal static class OS {
NativeMethods.FlashWindowEx(ref flashInfo);
}
[SupportedOSPlatform("Linux")]
private static async Task LinuxKeepSystemActive() {
if (!OperatingSystem.IsLinux()) {
throw new PlatformNotSupportedException();
}
// Docs: https://systemd.io/INHIBITOR_LOCKS
string? systemAddress = Address.System;
if (string.IsNullOrEmpty(systemAddress)) {
ASF.ArchiLogger.LogGenericError(Strings.FormatWarningFailedWithError(nameof(systemAddress)));
return;
}
using Connection connection = new(systemAddress);
try {
await connection.ConnectAsync().ConfigureAwait(false);
} catch (ConnectException e) {
// Possible if no DBus is available at all
ASF.ArchiLogger.LogGenericDebuggingException(e);
ASF.ArchiLogger.LogGenericWarning(Strings.WarningNoSystemRequiredLinuxDependencies);
return;
}
MessageWriter writer = connection.GetMessageWriter();
writer.WriteMethodCallHeader(
"org.freedesktop.login1",
"/org/freedesktop/login1",
"org.freedesktop.login1.Manager",
"Inhibit",
"ssss"
);
// Colon-separated list of lock types
writer.WriteString("idle");
// Human-readable, descriptive string of who is taking the lock
writer.WriteString(SharedInfo.PublicIdentifier);
// Human-readable, descriptive string of why the lock is taken
writer.WriteString("--system-required");
// Mode
writer.WriteString("block");
MessageBuffer message = writer.CreateMessage();
try {
// Inhibit() returns a single value, a file descriptor that encapsulates the lock
InhibitLock = await connection.CallMethodAsync(
message, static (response, _) => {
Reader reader = response.GetBodyReader();
return reader.ReadHandle<SafeFileHandle>();
}
).ConfigureAwait(false);
} catch (DBusException e) {
// Possible if login manager does not support inhibit, although that should be super rare
ASF.ArchiLogger.LogGenericDebuggingException(e);
ASF.ArchiLogger.LogGenericWarning(Strings.WarningNoSystemRequiredLinuxDependencies);
return;
}
if (InhibitLock == null) {
ASF.ArchiLogger.LogGenericError(Strings.FormatWarningFailedWithError(nameof(InhibitLock)));
}
}
private static void MinimizeConsoleWindow() {
(_, int top) = Console.GetCursorPosition();

View File

@@ -800,4 +800,7 @@ Process uptime: {1}</value>
<value>Input: {0}</value>
<comment>{0} will be replaced by text input from the user.</comment>
</data>
<data name="WarningNoSystemRequiredLinuxDependencies" xml:space="preserve">
<value>You've declared --system-required, although your OS is missing required dependencies for that feature to work. Consider installing dbus, although you can also safely ignore this warning if you do not require inhibition to work properly.</value>
</data>
</root>

View File

@@ -278,7 +278,7 @@ internal static class Program {
return false;
}
OS.CoreInit(Minimized, SystemRequired);
await OS.CoreInit(Minimized, SystemRequired).ConfigureAwait(false);
Console.Title = SharedInfo.ProgramIdentifier;
ASF.ArchiLogger.LogGenericInfo(SharedInfo.ProgramIdentifier);

View File

@@ -56,7 +56,7 @@ public sealed class CardsFarmer : IAsyncDisposable, IDisposable {
private const byte HoursToIgnore = 1; // How many hours we ignore unreleased appIDs and don't bother checking them again
[PublicAPI]
public static readonly FrozenSet<uint> SalesBlacklist = [267420, 303700, 335590, 368020, 425280, 480730, 566020, 639900, 762800, 876740, 991980, 1195670, 1343890, 1465680, 1658760, 1797760, 2021850, 2243720, 2459330, 2640280, 2861690, 2861720, 3558920];
public static readonly FrozenSet<uint> SalesBlacklist = [267420, 303700, 335590, 368020, 425280, 480730, 566020, 639900, 762800, 876740, 991980, 1195670, 1343890, 1465680, 1658760, 1797760, 2021850, 2243720, 2459330, 2640280, 2861690, 2861720, 3558920, 3558940];
private static readonly ConcurrentDictionary<uint, DateTime> GloballyIgnoredAppIDs = new(); // Reserved for unreleased games

View File

@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>6.3.1.2</Version>
<Version>6.3.1.3</Version>
</PropertyGroup>
<PropertyGroup>

View File

@@ -16,10 +16,11 @@
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.14.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.14.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.14.0" />
<PackageVersion Include="Scalar.AspNetCore" Version="2.11.5" />
<PackageVersion Include="Scalar.AspNetCore" Version="2.11.6" />
<PackageVersion Include="SteamKit2" Version="3.3.1" />
<PackageVersion Include="System.Composition" Version="10.0.1" />
<PackageVersion Include="System.Composition.AttributedModel" Version="10.0.1" />
<PackageVersion Include="System.Security.Cryptography.ProtectedData" Version="10.0.1" />
<PackageVersion Include="Tmds.DBus.Protocol" Version="0.21.2" />
</ItemGroup>
</Project>

View File

@@ -114,4 +114,4 @@ EOF
WORKDIR /app
VOLUME ["/app/config", "/app/logs"]
HEALTHCHECK CMD ["pidof", "-q", "dotnet"]
ENTRYPOINT ["ArchiSteamFarm", "--no-restart", "--system-required"]
ENTRYPOINT ["ArchiSteamFarm", "--no-restart"]

View File

@@ -114,4 +114,4 @@ EOF
WORKDIR /app
VOLUME ["/app/config", "/app/logs"]
HEALTHCHECK CMD ["pidof", "-q", "ArchiSteamFarm"]
ENTRYPOINT ["ArchiSteamFarm", "--no-restart", "--system-required"]
ENTRYPOINT ["ArchiSteamFarm", "--no-restart"]

2
wiki

Submodule wiki updated: 8d546a5bfe...7854f32a69