Compare commits

..

59 Commits

Author SHA1 Message Date
JustArchi
91c28c60de Madness to the rescue!
I need a hero
I'm holding out for a hero 'til the end of the night
He's gotta be strong, and he's gotta be fast
And he's gotta be fresh from the fight
2022-10-27 11:25:48 +02:00
JustArchi
ea7b944114 Include http errors in GetInventoryAsync()
And stop actively matching on first 429
2022-10-27 10:46:00 +02:00
renovate[bot]
2420f39718 Update ASF-ui digest to 3fd9239 2022-10-27 05:48:42 +00:00
ArchiBot
bb1f55d809 Automatic translations update 2022-10-27 02:40:59 +00:00
renovate[bot]
49858fa18e Update ASF-ui digest to 931fede 2022-10-26 16:56:22 +00:00
renovate[bot]
4be3a59704 Update dependency NLog.Web.AspNetCore to v5.1.5 2022-10-26 03:46:34 +00:00
ArchiBot
0d8cb84b06 Automatic translations update 2022-10-26 02:43:03 +00:00
ArchiBot
0b36b92d62 Automatic translations update 2022-10-23 02:49:31 +00:00
renovate[bot]
98938db3d2 Update ASF-ui digest to 466d60e 2022-10-22 21:05:06 +00:00
renovate[bot]
cf3e319489 Update actions/upload-artifact action to v3.1.1 2022-10-22 04:36:59 +00:00
renovate[bot]
a7619f7ff5 Update ASF-ui digest to b3d124c 2022-10-21 23:09:51 +00:00
renovate[bot]
5bb32c4e94 Update crowdin/github-action action to v1.4.16 2022-10-21 08:39:26 +00:00
renovate[bot]
1421152e27 Update actions/download-artifact action to v3.0.1 2022-10-21 02:55:32 +00:00
ArchiBot
354b58970e Automatic translations update 2022-10-21 02:38:05 +00:00
renovate[bot]
9d30f68a85 Update ASF-ui digest to cf4a35f 2022-10-20 14:43:43 +00:00
ArchiBot
bf5188530d Automatic translations update 2022-10-20 02:50:03 +00:00
renovate[bot]
98b121a7bd Update ASF-ui digest to f2f6a53 2022-10-19 04:39:03 +00:00
ArchiBot
557f0304a2 Automatic translations update 2022-10-19 02:49:40 +00:00
renovate[bot]
b0632a6c8d Update crazy-max/ghaction-import-gpg action to v5.2.0 2022-10-18 22:39:20 +00:00
renovate[bot]
ce37888609 Update peter-evans/dockerhub-description action to v3.1.1 2022-10-18 12:48:17 +00:00
renovate[bot]
7aa862731f Update docker/setup-buildx-action action to v2.2.1 2022-10-18 09:37:22 +00:00
ArchiBot
1abfd37d71 Automatic translations update 2022-10-18 02:50:37 +00:00
renovate[bot]
77e12476e0 Update ASF-ui digest to 30ff9f6 2022-10-17 19:51:56 +00:00
renovate[bot]
4b170a5c12 Update docker/setup-buildx-action action to v2.2.0 2022-10-17 16:45:38 +00:00
renovate[bot]
07f659d22c Update crowdin/github-action action to v1.4.15 2022-10-17 13:55:10 +00:00
ArchiBot
c72d7009dc Automatic translations update 2022-10-17 02:50:32 +00:00
ArchiBot
9f33fa5e72 Automatic translations update 2022-10-16 02:51:19 +00:00
renovate[bot]
9a55ab7518 Update ASF-ui digest to 31907d9 2022-10-14 10:17:24 +00:00
renovate[bot]
5985d07719 Update ASF-ui digest to 2e6b6af 2022-10-13 21:24:08 +00:00
renovate[bot]
fac5204ad2 Update actions/setup-dotnet action to v3.0.2 2022-10-13 18:16:11 +00:00
renovate[bot]
1a298143b7 Update actions/setup-node action to v3.5.1 2022-10-13 14:37:29 +00:00
renovate[bot]
00d3f9ced3 Update docker/setup-buildx-action action to v2.1.0 2022-10-12 17:03:13 +00:00
renovate[bot]
d810c64120 Update docker/login-action action to v2.1.0 2022-10-12 13:16:01 +00:00
JustArchi
47d89415b4 Bump 2022-10-12 13:53:20 +02:00
JustArchi
96296028c1 Closes #2719 2022-10-12 13:49:19 +02:00
renovate[bot]
6644ec18de Update docker/build-push-action action to v3.2.0 2022-10-12 08:06:39 +00:00
renovate[bot]
2b7fed251c Update ASF-ui digest to 05cb196 2022-10-12 05:55:06 +00:00
ArchiBot
9cffd3a133 Automatic translations update 2022-10-12 02:50:13 +00:00
renovate[bot]
7581d58aa5 Update dotnet monorepo to v3.1.30 2022-10-11 21:29:10 +00:00
renovate[bot]
24b8b2f9b8 Update ASF-ui digest to 3b6f343 2022-10-11 17:58:26 +00:00
JustArchi
f3bb15670b Handle extreme edge case of ASF_USER=root 2022-10-11 17:16:12 +02:00
JustArchi
5dbe523f59 Bump 2022-10-11 17:03:37 +02:00
JustArchi
319f1218de Closes #2717
chown operation done by ASF is not mandatory for following with the rest of the script. It can fail e.g. for read-only filesystems, which is completely fine, worst case user will have to deal with the mess he has created himself.
2022-10-11 16:30:38 +02:00
renovate[bot]
ee9d145e6b Update ASF-ui digest to b6109e3 2022-10-11 04:33:03 +00:00
ArchiBot
0a70e069e0 Automatic translations update 2022-10-11 02:48:08 +00:00
renovate[bot]
8fdd8e91a6 Update ASF-ui digest to 78152a3 2022-10-10 22:39:46 +00:00
JustArchi
533bf45f35 Thanks netf 2022-10-10 22:57:34 +02:00
JustArchi
6227f84931 Misc cleanup 2022-10-10 22:50:36 +02:00
JustArchi
e6579e4355 Enhance STD plugin errors
- 403: Stop submission for now
- 409: Purge cache and continue
2022-10-10 22:38:35 +02:00
Sebastian Göls
321e02c0ff Add endpoints to manage IPC bans (#2715)
* Add endpoints to manage IPC bans

* Remove debug code

* Misc.

* Simplify unban logic

* Add explanatory comment to new string resource
2022-10-10 19:28:07 +02:00
renovate[bot]
406a5f1fd1 Update ASF-ui digest to 026fc41 2022-10-10 04:41:56 +00:00
ArchiBot
40822dff89 Automatic translations update 2022-10-10 02:49:43 +00:00
Sebastian Göls
f72345aaa2 Ignore in-tree www directory (#2716) 2022-10-09 23:12:49 +02:00
JustArchi
32cdb45e9f Misc 2022-10-09 18:51:34 +02:00
ArchiBot
72cabc51d8 Automatic translations update 2022-10-09 02:49:29 +00:00
renovate[bot]
e62f850a3a Update ASF-ui digest to 1507d9e 2022-10-08 04:11:24 +00:00
ArchiBot
8b62c6c4d2 Automatic translations update 2022-10-08 02:39:06 +00:00
renovate[bot]
f7534cf7ec Update wiki digest to e62d741 2022-10-07 19:18:37 +00:00
JustArchi
8797a7ed78 Bump 2022-10-07 19:39:48 +02:00
67 changed files with 515 additions and 118 deletions

View File

@@ -24,7 +24,7 @@ jobs:
submodules: recursive
- name: Setup .NET Core
uses: actions/setup-dotnet@v3.0.1
uses: actions/setup-dotnet@v3.0.2
with:
dotnet-version: ${{ env.DOTNET_SDK_VERSION }}
@@ -39,7 +39,7 @@ jobs:
- name: Upload latest strings for translation on Crowdin
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.configuration == 'Release' && startsWith(matrix.os, 'ubuntu-') }}
uses: crowdin/github-action@1.4.14
uses: crowdin/github-action@1.4.16
with:
crowdin_branch_name: main
config: '.github/crowdin.yml'

View File

@@ -22,10 +22,10 @@ jobs:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.0.0
uses: docker/setup-buildx-action@v2.2.1
- name: Build ${{ matrix.configuration }} Docker image from ${{ matrix.file }}
uses: docker/build-push-action@v3.1.1
uses: docker/build-push-action@v3.2.0
with:
context: .
file: ${{ matrix.file }}

View File

@@ -20,17 +20,17 @@ jobs:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.0.0
uses: docker/setup-buildx-action@v2.2.1
- name: Login to ghcr.io
uses: docker/login-action@v2.0.0
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
uses: docker/login-action@v2.0.0
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -55,7 +55,7 @@ jobs:
echo "DH_REPOSITORY=$(echo ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV"
- name: Build and publish Docker image from Dockerfile.Service
uses: docker/build-push-action@v3.1.1
uses: docker/build-push-action@v3.2.0
with:
context: .
file: Dockerfile.Service

View File

@@ -21,17 +21,17 @@ jobs:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.0.0
uses: docker/setup-buildx-action@v2.2.1
- name: Login to ghcr.io
uses: docker/login-action@v2.0.0
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
uses: docker/login-action@v2.0.0
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -55,7 +55,7 @@ jobs:
echo "DH_REPOSITORY=$(echo ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV"
- name: Build and publish Docker image from Dockerfile
uses: docker/build-push-action@v3.1.1
uses: docker/build-push-action@v3.2.0
with:
context: .
platforms: ${{ env.PLATFORMS }}
@@ -70,7 +70,7 @@ jobs:
push: true
- name: Update DockerHub repository description
uses: peter-evans/dockerhub-description@v3.1.0
uses: peter-evans/dockerhub-description@v3.1.1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

View File

@@ -21,17 +21,17 @@ jobs:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.0.0
uses: docker/setup-buildx-action@v2.2.1
- name: Login to ghcr.io
uses: docker/login-action@v2.0.0
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
uses: docker/login-action@v2.0.0
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -56,7 +56,7 @@ jobs:
echo "DH_REPOSITORY=$(echo ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV"
- name: Build and publish Docker image from Dockerfile
uses: docker/build-push-action@v3.1.1
uses: docker/build-push-action@v3.2.0
with:
context: .
platforms: ${{ env.PLATFORMS }}

View File

@@ -30,7 +30,7 @@ jobs:
submodules: recursive
- name: Setup .NET Core
uses: actions/setup-dotnet@v3.0.1
uses: actions/setup-dotnet@v3.0.2
with:
dotnet-version: ${{ env.DOTNET_SDK_VERSION }}
@@ -38,7 +38,7 @@ jobs:
run: dotnet --info
- name: Setup Node.js with npm
uses: actions/setup-node@v3.5.0
uses: actions/setup-node@v3.5.1
with:
check-latest: true
node-version: ${{ env.NODE_JS_VERSION }}
@@ -317,50 +317,50 @@ jobs:
Get-Job | Receive-Job -Wait
- name: Upload ASF-generic
uses: actions/upload-artifact@v3.1.0
uses: actions/upload-artifact@v3.1.1
with:
name: ${{ matrix.os }}_ASF-generic
path: out/ASF-generic.zip
- name: Upload ASF-generic-netf
if: startsWith(matrix.os, 'windows-')
uses: actions/upload-artifact@v3.1.0
uses: actions/upload-artifact@v3.1.1
with:
name: ${{ matrix.os }}_ASF-generic-netf
path: out/ASF-generic-netf.zip
- name: Upload ASF-linux-arm
uses: actions/upload-artifact@v3.1.0
uses: actions/upload-artifact@v3.1.1
with:
name: ${{ matrix.os }}_ASF-linux-arm
path: out/ASF-linux-arm.zip
- name: Upload ASF-linux-arm64
uses: actions/upload-artifact@v3.1.0
uses: actions/upload-artifact@v3.1.1
with:
name: ${{ matrix.os }}_ASF-linux-arm64
path: out/ASF-linux-arm64.zip
- name: Upload ASF-linux-x64
uses: actions/upload-artifact@v3.1.0
uses: actions/upload-artifact@v3.1.1
with:
name: ${{ matrix.os }}_ASF-linux-x64
path: out/ASF-linux-x64.zip
- name: Upload ASF-osx-arm64
uses: actions/upload-artifact@v3.1.0
uses: actions/upload-artifact@v3.1.1
with:
name: ${{ matrix.os }}_ASF-osx-arm64
path: out/ASF-osx-arm64.zip
- name: Upload ASF-osx-x64
uses: actions/upload-artifact@v3.1.0
uses: actions/upload-artifact@v3.1.1
with:
name: ${{ matrix.os }}_ASF-osx-x64
path: out/ASF-osx-x64.zip
- name: Upload ASF-win-x64
uses: actions/upload-artifact@v3.1.0
uses: actions/upload-artifact@v3.1.1
with:
name: ${{ matrix.os }}_ASF-win-x64
path: out/ASF-win-x64.zip
@@ -378,55 +378,55 @@ jobs:
# However, that is currently impossible due to https://github.com/dotnet/msbuild/issues/3897
# Therefore, we'll (sadly) pull artifacts from Windows machine only for now
- name: Download ASF-generic artifact from windows-latest
uses: actions/download-artifact@v3.0.0
uses: actions/download-artifact@v3.0.1
with:
name: windows-latest_ASF-generic
path: out
- name: Download ASF-generic-netf artifact from windows-latest
uses: actions/download-artifact@v3.0.0
uses: actions/download-artifact@v3.0.1
with:
name: windows-latest_ASF-generic-netf
path: out
- name: Download ASF-linux-arm artifact from windows-latest
uses: actions/download-artifact@v3.0.0
uses: actions/download-artifact@v3.0.1
with:
name: windows-latest_ASF-linux-arm
path: out
- name: Download ASF-linux-arm64 artifact from windows-latest
uses: actions/download-artifact@v3.0.0
uses: actions/download-artifact@v3.0.1
with:
name: windows-latest_ASF-linux-arm64
path: out
- name: Download ASF-linux-x64 artifact from windows-latest
uses: actions/download-artifact@v3.0.0
uses: actions/download-artifact@v3.0.1
with:
name: windows-latest_ASF-linux-x64
path: out
- name: Download ASF-osx-arm64 artifact from windows-latest
uses: actions/download-artifact@v3.0.0
uses: actions/download-artifact@v3.0.1
with:
name: windows-latest_ASF-osx-arm64
path: out
- name: Download ASF-osx-x64 artifact from windows-latest
uses: actions/download-artifact@v3.0.0
uses: actions/download-artifact@v3.0.1
with:
name: windows-latest_ASF-osx-x64
path: out
- name: Download ASF-win-x64 artifact from windows-latest
uses: actions/download-artifact@v3.0.0
uses: actions/download-artifact@v3.0.1
with:
name: windows-latest_ASF-win-x64
path: out
- name: Import GPG key for signing
uses: crazy-max/ghaction-import-gpg@v5.1.0
uses: crazy-max/ghaction-import-gpg@v5.2.0
with:
gpg_private_key: ${{ secrets.ARCHIBOT_GPG_PRIVATE_KEY }}
@@ -443,13 +443,13 @@ jobs:
)
- name: Upload SHA512SUMS
uses: actions/upload-artifact@v3.1.0
uses: actions/upload-artifact@v3.1.1
with:
name: SHA512SUMS
path: out/SHA512SUMS
- name: Upload SHA512SUMS.sign
uses: actions/upload-artifact@v3.1.0
uses: actions/upload-artifact@v3.1.1
with:
name: SHA512SUMS.sign
path: out/SHA512SUMS.sign

View File

@@ -26,7 +26,7 @@ jobs:
git reset --hard origin/master
- name: Download latest translations from Crowdin
uses: crowdin/github-action@1.4.14
uses: crowdin/github-action@1.4.16
with:
upload_sources: false
download_translations: true
@@ -38,7 +38,7 @@ jobs:
token: ${{ secrets.ASF_CROWDIN_API_TOKEN }}
- name: Import GPG key for signing
uses: crazy-max/ghaction-import-gpg@v5.1.0
uses: crazy-max/ghaction-import-gpg@v5.2.0
with:
gpg_private_key: ${{ secrets.ARCHIBOT_GPG_PRIVATE_KEY }}
git_config_global: true

3
.gitignore vendored
View File

@@ -7,6 +7,9 @@
# Ignore all files in custom in-tree config directory (if exists)
ArchiSteamFarm/config
# Ignore all files in custom in-tree www directory (if exists)
ArchiSteamFarm/www
# Ignore private SNK key (if exists)
resources/ArchiSteamFarm.snk

2
ASF-ui

Submodule ASF-ui updated: e895aaef3a...3fd92393cb

View File

@@ -170,8 +170,19 @@ internal sealed class GlobalCache : SerializableFile {
}
LastChangeNumber = currentChangeNumber;
Reset();
}
internal void Reset(bool clear = false) {
AppChangeNumbers.Clear();
if (clear) {
AppTokens.Clear();
DepotKeys.Clear();
PackageTokens.Clear();
}
Utilities.InBackground(Save);
}

View File

@@ -544,21 +544,40 @@ internal sealed class SteamTokenDumperPlugin : OfficialPlugin, IASF, IBot, IBotC
if (response.StatusCode.IsClientErrorCode()) {
ASF.ArchiLogger.LogGenericWarning(string.Format(CultureInfo.CurrentCulture, ArchiSteamFarm.Localization.Strings.WarningFailedWithError, response.StatusCode));
switch (response.StatusCode) {
// SteamDB told us to stop submitting data for now
case HttpStatusCode.Forbidden:
// ReSharper disable once SuspiciousLockOverSynchronizationPrimitive - this is not a mistake, we need extra synchronization, and we can re-use the semaphore object for that
lock (SubmissionSemaphore) {
SubmissionTimer.Change(Timeout.InfiniteTimeSpan, Timeout.InfiniteTimeSpan);
}
break;
// SteamDB told us to reset our cache
case HttpStatusCode.Conflict:
GlobalCache.Reset(true);
break;
// SteamDB told us to try again later
#if NETFRAMEWORK
if (response.StatusCode == (HttpStatusCode) 429) {
case (HttpStatusCode) 429:
#else
if (response.StatusCode == HttpStatusCode.TooManyRequests) {
case HttpStatusCode.TooManyRequests:
#endif
#pragma warning disable CA5394 // This call isn't used in a security-sensitive manner
TimeSpan startIn = TimeSpan.FromMinutes(Random.Shared.Next(SharedInfo.MinimumMinutesBeforeFirstUpload, SharedInfo.MaximumMinutesBeforeFirstUpload));
TimeSpan startIn = TimeSpan.FromMinutes(Random.Shared.Next(SharedInfo.MinimumMinutesBeforeFirstUpload, SharedInfo.MaximumMinutesBeforeFirstUpload));
#pragma warning restore CA5394 // This call isn't used in a security-sensitive manner
// ReSharper disable once SuspiciousLockOverSynchronizationPrimitive - this is not a mistake, we need extra synchronization, and we can re-use the semaphore object for that
lock (SubmissionSemaphore) {
SubmissionTimer.Change(startIn, TimeSpan.FromHours(SharedInfo.HoursBetweenUploads));
}
// ReSharper disable once SuspiciousLockOverSynchronizationPrimitive - this is not a mistake, we need extra synchronization, and we can re-use the semaphore object for that
lock (SubmissionSemaphore) {
SubmissionTimer.Change(startIn, TimeSpan.FromHours(SharedInfo.HoursBetweenUploads));
}
ASF.ArchiLogger.LogGenericInfo(string.Format(CultureInfo.CurrentCulture, Strings.SubmissionFailedTooManyRequests, startIn.ToHumanReadable()));
ASF.ArchiLogger.LogGenericInfo(string.Format(CultureInfo.CurrentCulture, Strings.SubmissionFailedTooManyRequests, startIn.ToHumanReadable()));
break;
}
return;

View File

@@ -39,8 +39,8 @@
<PackageReference Include="Microsoft.AspNetCore.WebSockets" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" />
<Reference Include="System.Net.Http" HintPath="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Net.Http.dll" />
<Reference Include="System.Security" HintPath="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Security.dll" />
<Reference Include="System.Net.Http" HintPath="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8.1\System.Net.Http.dll" />
<Reference Include="System.Security" HintPath="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8.1\System.Security.dll" />
</ItemGroup>
<ItemGroup>

View File

@@ -407,6 +407,7 @@ internal sealed class RemoteCommunication : IAsyncDisposable, IDisposable {
byte maxTradeHoldDuration = ASF.GlobalConfig?.MaxTradeHoldDuration ?? GlobalConfig.DefaultMaxTradeHoldDuration;
byte totalMatches = 0;
bool rateLimited = false;
HashSet<(uint RealAppID, Asset.EType Type, Asset.ERarity Rarity)> skippedSetsThisRound = new();
@@ -443,6 +444,16 @@ internal sealed class RemoteCommunication : IAsyncDisposable, IDisposable {
} catch (HttpRequestException e) {
Bot.ArchiLogger.LogGenericWarningException(e);
#if NETFRAMEWORK
if (e.StatusCode == (HttpStatusCode) 429) {
#else
if (e.StatusCode == HttpStatusCode.TooManyRequests) {
#endif
rateLimited = true;
break;
}
continue;
} catch (Exception e) {
Bot.ArchiLogger.LogGenericException(e);
@@ -702,6 +713,6 @@ internal sealed class RemoteCommunication : IAsyncDisposable, IDisposable {
Bot.ArchiLogger.LogGenericInfo(string.Format(CultureInfo.CurrentCulture, Strings.ActivelyMatchingItemsRound, skippedSetsThisRound.Count));
// Keep matching when we either traded something this round (so it makes sense for a refresh) or if we didn't try all available bots yet (so it makes sense to keep going)
return ((totalMatches > 0) && ((skippedSetsThisRound.Count > 0) || triedSteamIDs.Values.All(static data => data.Tries < 2)), skippedSetsThisRound.Count > 0);
return (!rateLimited && (totalMatches > 0) && ((skippedSetsThisRound.Count > 0) || triedSteamIDs.Values.All(static data => data.Tries < 2)), skippedSetsThisRound.Count > 0);
}
}

View File

@@ -0,0 +1,77 @@
// _ _ _ ____ _ _____
// / \ _ __ ___ | |__ (_)/ ___| | |_ ___ __ _ _ __ ___ | ___|__ _ _ __ _ __ ___
// / _ \ | '__|/ __|| '_ \ | |\___ \ | __|/ _ \ / _` || '_ ` _ \ | |_ / _` || '__|| '_ ` _ \
// / ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
// /_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
// |
// Copyright 2015-2022 Łukasz "JustArchi" Domeradzki
// Contact: JustArchi@JustArchi.net
// |
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// |
// http://www.apache.org/licenses/LICENSE-2.0
// |
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Net;
using ArchiSteamFarm.IPC.Integration;
using ArchiSteamFarm.IPC.Responses;
using ArchiSteamFarm.Localization;
using Microsoft.AspNetCore.Mvc;
namespace ArchiSteamFarm.IPC.Controllers.Api;
[Route("Api/IPC")]
public sealed class IPCController : ArchiController {
/// <summary>
/// Clears the list of all IP addresses currently blocked by ASFs IPC module
/// </summary>
[HttpDelete("Bans")]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.OK)]
public ActionResult<GenericResponse> BansDelete() {
ApiAuthenticationMiddleware.ClearFailedAuthorizations();
return Ok(new GenericResponse(true));
}
/// <summary>
/// Removes an IP address from the list of addresses currently blocked by ASFs IPC module
/// </summary>
[HttpDelete("Bans/{ipAddress:required}")]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.OK)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)]
public ActionResult<GenericResponse> BansDeleteSpecific(string ipAddress) {
if (string.IsNullOrEmpty(ipAddress)) {
throw new ArgumentNullException(nameof(ipAddress));
}
if (!IPAddress.TryParse(ipAddress, out IPAddress? remoteAddress)) {
return BadRequest(new GenericResponse(false, string.Format(CultureInfo.CurrentCulture, Strings.ErrorIsInvalid, nameof(ipAddress))));
}
bool result = ApiAuthenticationMiddleware.UnbanIP(remoteAddress);
if (!result) {
return BadRequest(new GenericResponse(false, string.Format(CultureInfo.CurrentCulture, Strings.ErrorIPNotBanned, ipAddress)));
}
return Ok(new GenericResponse(true));
}
/// <summary>
/// Gets all IP addresses currently blocked by ASFs IPC module
/// </summary>
[HttpGet("Bans")]
[ProducesResponseType(typeof(GenericResponse<ISet<string>>), (int) HttpStatusCode.OK)]
public ActionResult<GenericResponse<ISet<string>>> BansGet() => Ok(new GenericResponse<ISet<string>>(ApiAuthenticationMiddleware.GetCurrentlyBannedIPs().Select(static ip => ip.ToString()).ToHashSet()));
}

View File

@@ -24,6 +24,7 @@ using MvcNewtonsoftJsonOptions = Microsoft.AspNetCore.Mvc.MvcJsonOptions;
#endif
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Net;
@@ -88,7 +89,19 @@ internal sealed class ApiAuthenticationMiddleware {
await context.Response.WriteJsonAsync(new GenericResponse<StatusCodeResponse>(false, statusCodeResponse), jsonOptions.Value.SerializerSettings).ConfigureAwait(false);
}
private static void ClearFailedAuthorizations(object? state = null) => FailedAuthorizations.Clear();
internal static void ClearFailedAuthorizations(object? state = null) => FailedAuthorizations.Clear();
internal static IEnumerable<IPAddress> GetCurrentlyBannedIPs() => FailedAuthorizations.Where(static kv => kv.Value >= MaxFailedAuthorizationAttempts).Select(static kv => kv.Key);
internal static bool UnbanIP(IPAddress ipAddress) {
ArgumentNullException.ThrowIfNull(ipAddress);
if (!FailedAuthorizations.TryGetValue(ipAddress, out byte attempts) || (attempts < MaxFailedAuthorizationAttempts)) {
return false;
}
return FailedAuthorizations.TryRemove(ipAddress, out _);
}
private async Task<(HttpStatusCode StatusCode, bool Permanent)> GetAuthenticationStatus(HttpContext context) {
ArgumentNullException.ThrowIfNull(context);

View File

@@ -981,6 +981,15 @@ namespace ArchiSteamFarm.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to The IP address {0} is not banned!.
/// </summary>
public static string ErrorIPNotBanned {
get {
return ResourceManager.GetString("ErrorIPNotBanned", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to {0} is empty!.
/// </summary>

View File

@@ -479,4 +479,6 @@
<data name="PatchingFiles" xml:space="preserve">
<value>Выпраўленне файлаў ASF...</value>
</data>
</root>

View File

@@ -733,4 +733,6 @@
<data name="PatchingFiles" xml:space="preserve">
<value>Пачват се ASF файлове...</value>
</data>
</root>

View File

@@ -736,4 +736,6 @@ StackTrace:
<data name="PatchingFiles" xml:space="preserve">
<value>Aktualizace ASF souborů...</value>
</data>
</root>

View File

@@ -670,4 +670,6 @@ Processens oppetid: {1}</value>
<data name="PatchingFiles" xml:space="preserve">
<value>Retter ASF-filer...</value>
</data>
</root>

View File

@@ -722,7 +722,7 @@ Prozesslaufzeit: {1}</value>
<value>Sie nutzen ASF in einer nicht unterstützten Umgebung und verwenden das Argument --ignore-unsupported-environment. Bitte beachten Sie, dass wir für dieses Szenario keinerlei Unterstützung anbieten und Sie das Risiko vollständig bei Ihnen liegt. Sie wurden gewarnt.</value>
</data>
<data name="FetchingChecksumFromRemoteServer" xml:space="preserve">
<value>Rufe Prüfsumme vom ASF-Server ab...</value>
<value>Rufe Prüfsumme vom Server ab...</value>
</data>
<data name="VerifyingChecksumWithRemoteServer" xml:space="preserve">
<value>Verifiziere Prüfsumme der heruntergeladenen Datei mit der des ASF Servers...</value>
@@ -736,4 +736,12 @@ Prozesslaufzeit: {1}</value>
<data name="PatchingFiles" xml:space="preserve">
<value>Aktualisiere ASF-Dateien...</value>
</data>
<data name="UserInputCryptkey" xml:space="preserve">
<value>Bitte gib deinen kryptographischen Schlüssel ein: </value>
<comment>Please note that this translation should end with space</comment>
</data>
<data name="ErrorIPNotBanned" xml:space="preserve">
<value>Die IP-Adresse {0} ist nicht gesperrt!</value>
<comment>{0} will be replaced by an IP address which was requested to be unbanned from using IPC</comment>
</data>
</root>

View File

@@ -736,4 +736,6 @@ StackTrace:
<data name="PatchingFiles" xml:space="preserve">
<value>Διόρθωση αρχείων ASF...</value>
</data>
</root>

View File

@@ -735,4 +735,12 @@ Tiempo de actividad del proceso: {1}</value>
<data name="PatchingFiles" xml:space="preserve">
<value>Parchando archivos de ASF...</value>
</data>
<data name="UserInputCryptkey" xml:space="preserve">
<value>Por favor, introduce tu clave de cifrado: </value>
<comment>Please note that this translation should end with space</comment>
</data>
<data name="ErrorIPNotBanned" xml:space="preserve">
<value>¡La dirección IP {0} no está bloqueada!</value>
<comment>{0} will be replaced by an IP address which was requested to be unbanned from using IPC</comment>
</data>
</root>

View File

@@ -251,6 +251,8 @@

View File

@@ -736,4 +736,12 @@ Prosessin käyttöaika: {1}</value>
<data name="PatchingFiles" xml:space="preserve">
<value>Paikataan ASF-tiedostoja...</value>
</data>
<data name="UserInputCryptkey" xml:space="preserve">
<value>Ole hyvä ja syötä cryptkey-avaimesi: </value>
<comment>Please note that this translation should end with space</comment>
</data>
<data name="ErrorIPNotBanned" xml:space="preserve">
<value>IP-osoitetta {0} ei ole estetty!</value>
<comment>{0} will be replaced by an IP address which was requested to be unbanned from using IPC</comment>
</data>
</root>

View File

@@ -736,4 +736,6 @@ Durée de fonctionnement : {1}</value>
<data name="PatchingFiles" xml:space="preserve">
<value>Patch des fichiers ASF...</value>
</data>
</root>

View File

@@ -528,6 +528,8 @@ StackTrace:

View File

@@ -734,4 +734,6 @@ Ennyi ideje fut: {1}</value>
<data name="PatchingFiles" xml:space="preserve">
<value>ASF-fájlok patchelése...</value>
</data>
</root>

View File

@@ -540,6 +540,8 @@

View File

@@ -734,4 +734,6 @@ Tempo di attività: {1}</value>
<data name="PatchingFiles" xml:space="preserve">
<value>Patching dei file ASF...</value>
</data>
</root>

View File

@@ -648,4 +648,6 @@ Process uptime: {1}</value>
</root>

View File

@@ -255,6 +255,8 @@

View File

@@ -696,4 +696,6 @@ StackTrace:
</root>

View File

@@ -608,4 +608,6 @@ Proceso veikimo laikas: {1}</value>
</root>

View File

@@ -736,4 +736,6 @@ Darbspējas laiks: {1}</value>
<data name="PatchingFiles" xml:space="preserve">
<value>Atjauno ASF failus...</value>
</data>
</root>

View File

@@ -193,7 +193,10 @@ StackTrace:
<value>Voer de 2FA code in van je Steam authenticator app: </value>
<comment>Please note that this translation should end with space</comment>
</data>
<data name="UserInputSteamGuard" xml:space="preserve">
<value>Voer de SteamGuard authenticator-code in die naar je e-mail is verzonden: </value>
<comment>Please note that this translation should end with space</comment>
</data>
<data name="UserInputSteamLogin" xml:space="preserve">
<value>Voer je Steam gebruikersnaam in: </value>
<comment>Please note that this translation should end with space</comment>
@@ -263,21 +266,46 @@ StackTrace:
<value>Farmen is gereed voor de spellen: {0}</value>
<comment>{0} will be replaced by list of the games (IDs, numbers), separated by a comma</comment>
</data>
<data name="IdlingStatusForGame" xml:space="preserve">
<value>Farming status voor {0} ({1}): {2} kaart(en) resterend</value>
<comment>{0} will be replaced by game's ID (number), {1} will be replaced by game's name, {2} will be replaced by number of cards left to farm</comment>
</data>
<data name="IdlingStopped" xml:space="preserve">
<value>Farming gestopt!</value>
</data>
<data name="IgnoredPermanentPauseEnabled" xml:space="preserve">
<value>Dit verzoek wordt genegeerd aangezien permanente pauze is ingeschakeld!</value>
</data>
<data name="NothingToIdle" xml:space="preserve">
<value>Er is niets om te farmen op dit account!</value>
</data>
<data name="NowIdling" xml:space="preserve">
<value>Nu aan het farmen: {0} ({1})</value>
<comment>{0} will be replaced by game's ID (number), {1} will be replaced by game's name</comment>
</data>
<data name="NowIdlingList" xml:space="preserve">
<value>Nu aan het farmen: {0}</value>
<comment>{0} will be replaced by list of the games (IDs, numbers), separated by a comma</comment>
</data>
<data name="PlayingNotAvailable" xml:space="preserve">
<value>Spelen is op dit moment niet mogelijk, we proberen het later nog een keer!</value>
</data>
<data name="StillIdling" xml:space="preserve">
<value>Nog steeds aan het farmen: {0} ({1})</value>
<comment>{0} will be replaced by game's ID (number), {1} will be replaced by game's name</comment>
</data>
<data name="StillIdlingList" xml:space="preserve">
<value>Nog steeds aan het farmen: {0}</value>
<comment>{0} will be replaced by list of the games (IDs, numbers), separated by a comma</comment>
</data>
<data name="StoppedIdling" xml:space="preserve">
<value>Gestopt met farmen: {0} ({1})</value>
<comment>{0} will be replaced by game's ID (number), {1} will be replaced by game's name</comment>
</data>
<data name="StoppedIdlingList" xml:space="preserve">
<value>Gestopt met farmen: {0}</value>
<comment>{0} will be replaced by list of the games (IDs, numbers), separated by a comma</comment>
</data>
<data name="UnknownCommand" xml:space="preserve">
<value>Onbekende opdracht!</value>
</data>
@@ -292,7 +320,9 @@ StackTrace:
<value>Gift accepteren: {0}...</value>
<comment>{0} will be replaced by giftID (number)</comment>
</data>
<data name="BotAccountLimited" xml:space="preserve">
<value>Dit account is gelimiteerd, farming proces is niet beschikbaar totdat de beperking is opgeheven!</value>
</data>
<data name="BotAddLicense" xml:space="preserve">
<value>ID: {0} | Status: {1}</value>
<comment>{0} will be replaced by game's ID (number), {1} will be replaced by status string</comment>
@@ -314,10 +344,18 @@ StackTrace:
<value>2FA Code: {0}</value>
<comment>{0} will be replaced by generated 2FA token (string)</comment>
</data>
<data name="BotAutomaticIdlingNowPaused" xml:space="preserve">
<value>Automatisch farmen is gepauzeerd!</value>
</data>
<data name="BotAutomaticIdlingNowResumed" xml:space="preserve">
<value>Automatisch farmen is hervat!</value>
</data>
<data name="BotAutomaticIdlingPausedAlready" xml:space="preserve">
<value>Automatisch farmen is al gepauzeerd!</value>
</data>
<data name="BotAutomaticIdlingResumedAlready" xml:space="preserve">
<value>Automatisch farmen is al hervat!</value>
</data>
<data name="BotConnected" xml:space="preserve">
<value>Verbonden met Steam!</value>
</data>
@@ -357,7 +395,9 @@ StackTrace:
<data name="BotLootingSuccess" xml:space="preserve">
<value>Ruilaanbod succesvol verzonden!</value>
</data>
<data name="BotSendingTradeToYourself" xml:space="preserve">
<value>Je kan jezelf geen ruil aanbieden!</value>
</data>
<data name="BotNoASFAuthenticator" xml:space="preserve">
<value>Deze bot heeft ASF 2FA nog niet ingeschakeld! Ben je vergeten om je authenticator als ASF 2FA te importeren?</value>
</data>
@@ -372,7 +412,10 @@ StackTrace:
<value>Al in bezit: {0} | {1}</value>
<comment>{0} will be replaced by game's ID (number), {1} will be replaced by game's name</comment>
</data>
<data name="BotPointsBalance" xml:space="preserve">
<value>Punten saldo: {0}</value>
<comment>{0} will be replaced by the points balance value (integer)</comment>
</data>
<data name="BotRateLimitExceeded" xml:space="preserve">
<value>Aanvraaglimiet overschreden, we zullen het na een cooldown van {0} opnieuw proberen...</value>
<comment>{0} will be replaced by translated TimeSpan string (such as "25 minutes")</comment>
@@ -391,8 +434,12 @@ StackTrace:
<data name="BotRemovedExpiredLoginKey" xml:space="preserve">
<value>Verlopen inlogcode verwijderd!</value>
</data>
<data name="BotStatusNotIdling" xml:space="preserve">
<value>Bot is niet aan het farmen.</value>
</data>
<data name="BotStatusLimited" xml:space="preserve">
<value>Bot is gelimiteerd en kan geen kaarten verzamelen.</value>
</data>
<data name="BotStatusConnecting" xml:space="preserve">
<value>Bot is aan het verbinden met het Steam netwerk.</value>
</data>
@@ -424,8 +471,12 @@ StackTrace:
<data name="BotConnectionLost" xml:space="preserve">
<value>Verbinding met Steam netwerk verbroken. Opnieuw verbinden...</value>
</data>
<data name="BotAccountFree" xml:space="preserve">
<value>Account is niet meer bezet: farming proces hervat!</value>
</data>
<data name="BotAccountOccupied" xml:space="preserve">
<value>Account is momenteel in gebruik: ASF zal het farmen hervatten wanneer het account weer beschikbaar is...</value>
</data>
<data name="BotConnecting" xml:space="preserve">
<value>Verbinden...</value>
</data>
@@ -459,8 +510,14 @@ StackTrace:
<data name="ErrorInvalidCurrentCulture" xml:space="preserve">
<value>De door jou ingevoerde CurrentCulture is ongeldig. ASF zal de standaardtaal blijven gebruiken!</value>
</data>
<data name="TranslationIncomplete" xml:space="preserve">
<value>ASF zal proberen de {0} taalcultuur te gebruiken, maar de vertaling in die taal is slechts {1} compleet. Misschien kun je ons helpen de ASF-vertaling voor jouw taal te verbeteren?</value>
<comment>{0} will be replaced by culture code, such as "en-US", {1} will be replaced by completeness percentage, such as "78.5%"</comment>
</data>
<data name="IdlingGameNotPossible" xml:space="preserve">
<value>Farmen {0} ({1}) is tijdelijk uitgeschakeld, omdat ASF momenteel niet in staat is om dit spel te spelen.</value>
<comment>{0} will be replaced by game's ID (number), {1} will be replaced by game's name</comment>
</data>
<data name="WarningIdlingGameMismatch" xml:space="preserve">
<value>ASF heeft een foutieve ID gedetecteerd voor {0} ({1}) en zal in plaats daarvan ID {2} gaan gebruiken.</value>
<comment>{0} will be replaced by game's ID (number), {1} will be replaced by game's name, {2} will be replaced by game's ID (number)</comment>
@@ -469,8 +526,12 @@ StackTrace:
<value>{0} V{1}</value>
<comment>{0} will be replaced by program's name (e.g. "ASF"), {1} will be replaced by program's version (e.g. "1.0.0.0"). This string typically has nothing to translate and you should leave it as it is, unless you need to change the format, e.g. in RTL languages.</comment>
</data>
<data name="BotAccountLocked" xml:space="preserve">
<value>Dit account is vergrendeld. Farming is permanent niet beschikbaar!</value>
</data>
<data name="BotStatusLocked" xml:space="preserve">
<value>Bot is gelimiteerd en kan geen kaarten verzamelen.</value>
</data>
<data name="ErrorFunctionOnlyInHeadlessMode" xml:space="preserve">
<value>Deze functie is alleen beschikbaar in de headless mode!</value>
</data>
@@ -481,7 +542,9 @@ StackTrace:
<data name="ErrorAccessDenied" xml:space="preserve">
<value>Toegang geweigerd!</value>
</data>
<data name="WarningPreReleaseVersion" xml:space="preserve">
<value>Je gebruikt een nieuwere versie dan de laatste versie van je update kanaal. Hou er rekening mee dat pre-release versies alleen geschikt zijn voor gebruikers die weten hoe ze bugs moeten rapporteren, kunnen omgaan met problemen en feedback kunnen geven. Er wordt geen technische ondersteuning geboden.</value>
</data>
<data name="BotStats" xml:space="preserve">
<value>Huidig geheugengebruik: {0} MB.
Proces uptime: {1}</value>
@@ -558,7 +621,9 @@ Proces uptime: {1}</value>
<data name="NothingFound" xml:space="preserve">
<value>Niets gevonden!</value>
</data>
<data name="PluginsWarning" xml:space="preserve">
<value>Je hebt een of meer aangepaste plugins geladen in ASF. Neem in geval van problemen contact op met de ontwikkelaars van deze plugins, aangezien we geen ondersteuning voor aangepaste instellingen kunnen bieden.</value>
</data>
<data name="PleaseWait" xml:space="preserve">
<value>Een ogenblik geduld...</value>
</data>
@@ -582,7 +647,10 @@ Proces uptime: {1}</value>
<value>{0} bevestiging(en) succesvol uitgevoerd!</value>
<comment>{0} will be replaced by number of confirmations</comment>
</data>
<data name="BotExtraIdlingCooldown" xml:space="preserve">
<value>{0} wachten ter controle of alles in orde is om het farmen te starten...</value>
<comment>{0} will be replaced by translated TimeSpan string (such as "1 minute")</comment>
</data>
<data name="UpdateCleanup" xml:space="preserve">
<value>Oude bestanden verwijderen na de update...</value>
</data>
@@ -604,11 +672,24 @@ Proces uptime: {1}</value>
<value>Resultaat: {0}</value>
<comment>{0} will be replaced by generic result of various functions that use this string</comment>
</data>
<data name="WarningUnsupportedEnvironment" xml:space="preserve">
<value>Je probeert {0} variant van ASF toe te voegen in een niet-ondersteunde omgeving: {1}. Voeg --ignore-unsupported-environment argument als je echt weet wat je aan het doen bent.</value>
</data>
<data name="WarningUnknownCommandLineArgument" xml:space="preserve">
<value>Onbekend opdrachtregelargument: {0}</value>
<comment>{0} will be replaced by unrecognized command that has been provided</comment>
</data>
<data name="ErrorConfigDirectoryNotFound" xml:space="preserve">
<value>Configuratiemap kon niet gevonden worden!</value>
</data>
<data name="BotIdlingSelectedGames" xml:space="preserve">
<value>Speelt geselecteerde af: {0} {1}</value>
<comment>{0} will be replaced by internal name of the config property (e.g. "GamesPlayedWhileIdle"), {1} will be replaced by comma-separated list of appIDs that user has chosen</comment>
</data>
<data name="AutomaticFileMigration" xml:space="preserve">
<value>{0} configuratiebestand zal worden gemigreerd naar de laatste syntaxis...</value>
<comment>{0} will be replaced with the relative path to the affected config file</comment>
</data>
<data name="WarningWeakIPCPassword" xml:space="preserve">
<value>Uw IPC wachtwoord is zwak. Vanwege beveiliging redenen zal het veiliger zijn om een sterker wachtwoord te kiezen. Details: {0}</value>
<comment>{0} will be replaced by additional details about the password being considered weak</comment>
@@ -625,17 +706,41 @@ Proces uptime: {1}</value>
<value>Uw encryptiesleutel is te kort. We raden u aan om er één te gebruiken die minstens {0} bytes (tekens) lang is.</value>
<comment>{0} will be replaced by the number of bytes (characters) recommended</comment>
</data>
<data name="WarningDefaultCryptKeyUsedForHashing" xml:space="preserve">
<value>U gebruikt {0} instelling van {1} eigenschap, maar u heeft geen aangepaste --cryptkey opgegeven. U moet een aangepaste --cryptkey verstrekken voor meer veiligheid.</value>
<comment>{0} will be replaced by the name of a particular setting (e.g. "SCrypt"), {1} will be replaced by the name of the property (e.g. "IPCPassword")</comment>
</data>
<data name="WarningDefaultCryptKeyUsedForEncryption" xml:space="preserve">
<value>U gebruikt {0} instelling van {1} eigenschap, maar u heeft geen aangepaste --cryptkey opgegeven. Dit ondermijnt de bescherming volledig, omdat ASF zijn eigen (bekend) sleutel moet gebruiken. U moet een aangepaste --cryptkey opgeven om gebruik te maken van het beveiligingsvoordeel dat deze instelling biedt.</value>
<comment>{0} will be replaced by the name of a particular setting (e.g. "AES"), {1} will be replaced by the name of the property (e.g. "SteamPassword")</comment>
</data>
<data name="WarningRunningAsRoot" xml:space="preserve">
<value>U probeert ASF uit te voeren als administrator (root). Dit veroorzaakt een aanzienlijk beveiligingsrisico voor uw apparaat en ASF heeft geen root toegang nodig voor de werking ervan. We raden u aan om, indien mogelijk, als niet-beheerder-gebruiker uit te voeren.</value>
</data>
<data name="WarningRunningInUnsupportedEnvironment" xml:space="preserve">
<value>Je draait ASF in niet-ondersteunde omgeving, het bedienen --negeer geen ondersteunend milieuargument. Houd er rekening mee dat we geen enkele vorm van ondersteuning voor dit scenario bieden en dat je het helemaal op eigen risico doet. Je bent gewaarschuwd.</value>
</data>
<data name="FetchingChecksumFromRemoteServer" xml:space="preserve">
<value>Checksum van de externe server ophalen...</value>
</data>
<data name="VerifyingChecksumWithRemoteServer" xml:space="preserve">
<value>Controleert controlesom van de gedownloade binary tegen de binary van de remote server...</value>
</data>
<data name="ChecksumMissing" xml:space="preserve">
<value>Externe server weet niets over de release waar we naar bijwerken. Deze situatie is mogelijk als de vrijlating onlangs werd gepubliceerd - door als aanvullende veiligheidsmaatregel de actualiseringsprocedure onmiddellijk te weigeren.</value>
</data>
<data name="ChecksumWrong" xml:space="preserve">
<value>Externe server heeft geantwoord met een andere checksum, dit kan duiden op corrupte download of MITM aanval, de update procedure zal gestopt worden!</value>
</data>
<data name="PatchingFiles" xml:space="preserve">
<value>Verbeteren van de ASF files...</value>
</data>
<data name="UserInputCryptkey" xml:space="preserve">
<value>Voer je cryptkey in: </value>
<comment>Please note that this translation should end with space</comment>
</data>
<data name="ErrorIPNotBanned" xml:space="preserve">
<value>Het IP adres {0} is niet gebanned!</value>
<comment>{0} will be replaced by an IP address which was requested to be unbanned from using IPC</comment>
</data>
</root>

View File

@@ -736,4 +736,12 @@ Czas procesu: {1}</value>
<data name="PatchingFiles" xml:space="preserve">
<value>Łatanie plików ASF...</value>
</data>
<data name="UserInputCryptkey" xml:space="preserve">
<value>Wprowadź swój klucz szyfrowania: </value>
<comment>Please note that this translation should end with space</comment>
</data>
<data name="ErrorIPNotBanned" xml:space="preserve">
<value>Adres IP {0} nie jest zbanowany!</value>
<comment>{0} will be replaced by an IP address which was requested to be unbanned from using IPC</comment>
</data>
</root>

View File

@@ -736,4 +736,6 @@ Tempo de execução: {1}</value>
<data name="PatchingFiles" xml:space="preserve">
<value>Atualizando arquivos do ASF...</value>
</data>
</root>

View File

@@ -736,4 +736,6 @@ Tempo de execução: {1}</value>
<data name="PatchingFiles" xml:space="preserve">
<value>A atualizar os ficheiros do ASF...</value>
</data>
</root>

View File

@@ -736,4 +736,12 @@ PROCES UPTIME: {1}</value>
<data name="PatchingFiles" xml:space="preserve">
<value>PATCHIN ASF FILEZ...</value>
</data>
<data name="UserInputCryptkey" xml:space="preserve">
<value>PLZ ENTR UR CRYPTKEY: </value>
<comment>Please note that this translation should end with space</comment>
</data>
<data name="ErrorIPNotBanned" xml:space="preserve">
<value>TEH IP ADDRES {0} IZ NOT BANND!</value>
<comment>{0} will be replaced by an IP address which was requested to be unbanned from using IPC</comment>
</data>
</root>

View File

@@ -740,4 +740,8 @@ Process uptime: {1}</value>
<value>Please enter your cryptkey: </value>
<comment>Please note that this translation should end with space</comment>
</data>
<data name="ErrorIPNotBanned" xml:space="preserve">
<value>The IP address {0} is not banned!</value>
<comment>{0} will be replaced by an IP address which was requested to be unbanned from using IPC</comment>
</data>
</root>

View File

@@ -722,4 +722,6 @@ Proces: {1}</value>
<data name="PatchingFiles" xml:space="preserve">
<value>Se repara fișierele ASF...</value>
</data>
</root>

View File

@@ -736,4 +736,9 @@
<data name="PatchingFiles" xml:space="preserve">
<value>Изменение файлов ASF...</value>
</data>
<data name="UserInputCryptkey" xml:space="preserve">
<value>Пожалуйста, введите ваш криптоключ: </value>
<comment>Please note that this translation should end with space</comment>
</data>
</root>

View File

@@ -702,4 +702,6 @@ Interaktívna konzola je teraz aktívna, napíšte "c" pre vstup do príkazovéh
</root>

View File

@@ -668,4 +668,6 @@ Vrijeme rada procesa: {1}</value>
</root>

View File

@@ -499,6 +499,8 @@ StackTrace:

View File

@@ -477,4 +477,6 @@ StackTrace:
<data name="PatchingFiles" xml:space="preserve">
<value>กำลังแพตช์ไฟล์ ASF…</value>
</data>
</root>

View File

@@ -736,4 +736,12 @@ Süreç çalışma zamanı: {1}</value>
<data name="PatchingFiles" xml:space="preserve">
<value>ASF dosyaları yamalanıyor...</value>
</data>
<data name="UserInputCryptkey" xml:space="preserve">
<value>Lütfen şifreleme anahtarınızı girin: </value>
<comment>Please note that this translation should end with space</comment>
</data>
<data name="ErrorIPNotBanned" xml:space="preserve">
<value>IP adresi {0} is yasaklı değil!</value>
<comment>{0} will be replaced by an IP address which was requested to be unbanned from using IPC</comment>
</data>
</root>

View File

@@ -701,4 +701,6 @@
<data name="PatchingFiles" xml:space="preserve">
<value>Виправлення файлів ASF...</value>
</data>
</root>

View File

@@ -736,4 +736,12 @@ Thời gian hoạt động: {1}</value>
<data name="PatchingFiles" xml:space="preserve">
<value>Đang vá tệp ASF...</value>
</data>
<data name="UserInputCryptkey" xml:space="preserve">
<value>Vui lòng nhập cryptkey: </value>
<comment>Please note that this translation should end with space</comment>
</data>
<data name="ErrorIPNotBanned" xml:space="preserve">
<value>Địa chỉ IP {0} không bị cấm!</value>
<comment>{0} will be replaced by an IP address which was requested to be unbanned from using IPC</comment>
</data>
</root>

View File

@@ -736,4 +736,12 @@
<data name="PatchingFiles" xml:space="preserve">
<value>修补 ASF 文件……</value>
</data>
<data name="UserInputCryptkey" xml:space="preserve">
<value>请输入您的加密密钥:</value>
<comment>Please note that this translation should end with space</comment>
</data>
<data name="ErrorIPNotBanned" xml:space="preserve">
<value>IP 地址 {0} 未被封禁!</value>
<comment>{0} will be replaced by an IP address which was requested to be unbanned from using IPC</comment>
</data>
</root>

View File

@@ -582,6 +582,8 @@

View File

@@ -683,7 +683,7 @@
<value>無法找到設定檔所在目錄,正在中止!</value>
</data>
<data name="BotIdlingSelectedGames" xml:space="preserve">
<value>正在執行指定掛時數的程式 {0}{1}</value>
<value>正在掛 {0} 指定遊戲的時數{1}</value>
<comment>{0} will be replaced by internal name of the config property (e.g. "GamesPlayedWhileIdle"), {1} will be replaced by comma-separated list of appIDs that user has chosen</comment>
</data>
<data name="AutomaticFileMigration" xml:space="preserve">
@@ -735,4 +735,12 @@
<data name="PatchingFiles" xml:space="preserve">
<value>正在修補 ASF 檔案…</value>
</data>
<data name="UserInputCryptkey" xml:space="preserve">
<value>請輸入您的 cryptkey </value>
<comment>Please note that this translation should end with space</comment>
</data>
<data name="ErrorIPNotBanned" xml:space="preserve">
<value>IP 位址 {0} 並未被封鎖!</value>
<comment>{0} will be replaced by an IP address which was requested to be unbanned from using IPC</comment>
</data>
</root>

View File

@@ -317,6 +317,7 @@ internal static class Program {
return false;
}
// ReSharper disable once RedundantSuppressNullableWarningExpression - required for .NET Framework
ArchiCryptoHelper.SetEncryptionKey(cryptkey!);
}

View File

@@ -173,12 +173,16 @@ public sealed class ArchiWebHandler : IDisposable {
await Task.Delay(rateLimitingDelay).ConfigureAwait(false);
}
response = await UrlGetToJsonObjectWithSession<InventoryResponse>(request, requestOptions: WebBrowser.ERequestOptions.ReturnServerErrors | WebBrowser.ERequestOptions.AllowInvalidBodyOnErrors, rateLimitingDelay: rateLimitingDelay).ConfigureAwait(false);
response = await UrlGetToJsonObjectWithSession<InventoryResponse>(request, requestOptions: WebBrowser.ERequestOptions.ReturnClientErrors | WebBrowser.ERequestOptions.ReturnServerErrors | WebBrowser.ERequestOptions.AllowInvalidBodyOnErrors, rateLimitingDelay: rateLimitingDelay).ConfigureAwait(false);
if (response == null) {
throw new HttpRequestException(string.Format(CultureInfo.CurrentCulture, Strings.ErrorObjectIsNull, nameof(response)));
}
if (response.StatusCode.IsClientErrorCode()) {
throw new HttpRequestException(string.Format(CultureInfo.CurrentCulture, Strings.WarningFailedWithError, response.StatusCode), null, response.StatusCode);
}
if (response.StatusCode.IsServerErrorCode()) {
if (string.IsNullOrEmpty(response.Content?.Error)) {
// This is a generic server error without a reason, try again
@@ -189,7 +193,7 @@ public sealed class ArchiWebHandler : IDisposable {
// This is actually client error with a reason, so it doesn't make sense to retry
// ReSharper disable once RedundantSuppressNullableWarningExpression - required for .NET Framework
throw new HttpRequestException(string.Format(CultureInfo.CurrentCulture, Strings.WarningFailedWithError, response.Content!.Error));
throw new HttpRequestException(string.Format(CultureInfo.CurrentCulture, Strings.WarningFailedWithError, response.Content!.Error), null, response.StatusCode);
}
}
} finally {

View File

@@ -67,9 +67,9 @@ done
BINARY_PREFIX=""
if [ -n "${ASF_USER-}" ] && [ "$(id -u)" -eq 0 ] && id -u "$ASF_USER" >/dev/null 2>&1; then
if [ -n "${ASF_USER-}" ] && [ "$(id -u)" -eq 0 ] && id -u "$ASF_USER" >/dev/null 2>&1 && [ "$(id -u "$ASF_USER")" -gt 0 ]; then
# Fix permissions first to ensure ASF has read/write access to the directory specified by --path and its own
chown -hR "${ASF_USER}:${ASF_USER}" . "$SCRIPT_DIR"
chown -hR "${ASF_USER}:${ASF_USER}" . "$SCRIPT_DIR" || true
BINARY_PREFIX="su ${ASF_USER} -c"
fi

View File

@@ -33,12 +33,16 @@ RestrictAddressFamilies=AF_INET AF_INET6
RestrictNamespaces=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
SecureBits=noroot-locked
SystemCallArchitectures=native
SystemCallFilter=@system-service
SystemCallFilter=~@privileged
UMask=0077
# TODO: Requires systemd v247+ due to https://github.com/systemd/systemd/issues/16666
# Since we don't want to enforce OS upgrade for everybody just yet, it's commented out for now
# We'll likely enforce it when .NET switches to Debian 11+ requirement
#SecureBits=noroot-locked
[Unit]
After=network.target
Description=ArchiSteamFarm Service (on %I)

View File

@@ -67,9 +67,9 @@ done
BINARY_PREFIX=""
if [ -n "${ASF_USER-}" ] && [ "$(id -u)" -eq 0 ] && id -u "$ASF_USER" >/dev/null 2>&1; then
if [ -n "${ASF_USER-}" ] && [ "$(id -u)" -eq 0 ] && id -u "$ASF_USER" >/dev/null 2>&1 && [ "$(id -u "$ASF_USER")" -gt 0 ]; then
# Fix permissions first to ensure ASF has read/write access to the directory specified by --path and its own
chown -hR "${ASF_USER}:${ASF_USER}" . "$SCRIPT_DIR"
chown -hR "${ASF_USER}:${ASF_USER}" . "$SCRIPT_DIR" || true
BINARY_PREFIX="su ${ASF_USER} -c"
fi

View File

@@ -67,9 +67,9 @@ done
BINARY_PREFIX=""
if [ -n "${ASF_USER-}" ] && [ "$(id -u)" -eq 0 ] && id -u "$ASF_USER" >/dev/null 2>&1; then
if [ -n "${ASF_USER-}" ] && [ "$(id -u)" -eq 0 ] && id -u "$ASF_USER" >/dev/null 2>&1 && [ "$(id -u "$ASF_USER")" -gt 0 ]; then
# Fix permissions first to ensure ASF has read/write access to the directory specified by --path and its own
chown -hR "${ASF_USER}:${ASF_USER}" . "$SCRIPT_DIR"
chown -hR "${ASF_USER}:${ASF_USER}" . "$SCRIPT_DIR" || true
BINARY_PREFIX="su ${ASF_USER} -c"
fi

View File

@@ -67,9 +67,9 @@ done
BINARY_PREFIX=""
if [ -n "${ASF_USER-}" ] && [ "$(id -u)" -eq 0 ] && id -u "$ASF_USER" >/dev/null 2>&1; then
if [ -n "${ASF_USER-}" ] && [ "$(id -u)" -eq 0 ] && id -u "$ASF_USER" >/dev/null 2>&1 && [ "$(id -u "$ASF_USER")" -gt 0 ]; then
# Fix permissions first to ensure ASF has read/write access to the directory specified by --path and its own
chown -hR "${ASF_USER}:${ASF_USER}" . "$SCRIPT_DIR"
chown -hR "${ASF_USER}:${ASF_USER}" . "$SCRIPT_DIR" || true
BINARY_PREFIX="su ${ASF_USER} -c"
fi

View File

@@ -33,12 +33,16 @@ RestrictAddressFamilies=AF_INET AF_INET6
RestrictNamespaces=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
SecureBits=noroot-locked
SystemCallArchitectures=native
SystemCallFilter=@system-service
SystemCallFilter=~@privileged
UMask=0077
# TODO: Requires systemd v247+ due to https://github.com/systemd/systemd/issues/16666
# Since we don't want to enforce OS upgrade for everybody just yet, it's commented out for now
# We'll likely enforce it when .NET switches to Debian 11+ requirement
#SecureBits=noroot-locked
[Unit]
After=network.target
Description=ArchiSteamFarm Service (on %I)

View File

@@ -67,9 +67,9 @@ done
BINARY_PREFIX=""
if [ -n "${ASF_USER-}" ] && [ "$(id -u)" -eq 0 ] && id -u "$ASF_USER" >/dev/null 2>&1; then
if [ -n "${ASF_USER-}" ] && [ "$(id -u)" -eq 0 ] && id -u "$ASF_USER" >/dev/null 2>&1 && [ "$(id -u "$ASF_USER")" -gt 0 ]; then
# Fix permissions first to ensure ASF has read/write access to the directory specified by --path and its own
chown -hR "${ASF_USER}:${ASF_USER}" . "$SCRIPT_DIR"
chown -hR "${ASF_USER}:${ASF_USER}" . "$SCRIPT_DIR" || true
BINARY_PREFIX="su ${ASF_USER} -c"
fi

View File

@@ -67,9 +67,9 @@ done
BINARY_PREFIX=""
if [ -n "${ASF_USER-}" ] && [ "$(id -u)" -eq 0 ] && id -u "$ASF_USER" >/dev/null 2>&1; then
if [ -n "${ASF_USER-}" ] && [ "$(id -u)" -eq 0 ] && id -u "$ASF_USER" >/dev/null 2>&1 && [ "$(id -u "$ASF_USER")" -gt 0 ]; then
# Fix permissions first to ensure ASF has read/write access to the directory specified by --path and its own
chown -hR "${ASF_USER}:${ASF_USER}" . "$SCRIPT_DIR"
chown -hR "${ASF_USER}:${ASF_USER}" . "$SCRIPT_DIR" || true
BINARY_PREFIX="su ${ASF_USER} -c"
fi

View File

@@ -33,12 +33,16 @@ RestrictAddressFamilies=AF_INET AF_INET6
RestrictNamespaces=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
SecureBits=noroot-locked
SystemCallArchitectures=native
SystemCallFilter=@system-service
SystemCallFilter=~@privileged
UMask=0077
# TODO: Requires systemd v247+ due to https://github.com/systemd/systemd/issues/16666
# Since we don't want to enforce OS upgrade for everybody just yet, it's commented out for now
# We'll likely enforce it when .NET switches to Debian 11+ requirement
#SecureBits=noroot-locked
[Unit]
After=network.target
Description=ArchiSteamFarm Service (on %I)

View File

@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>5.3.2.0</Version>
<Version>5.3.2.3</Version>
</PropertyGroup>
<PropertyGroup>
@@ -44,6 +44,7 @@
<Using Include="JustArchiNET.Madness.FileMadness.File" Alias="File" />
<Using Include="JustArchiNET.Madness.HashCodeMadness.HashCode" Alias="HashCode" />
<Using Include="JustArchiNET.Madness.HMACSHA1Madness.HMACSHA1" Alias="HMACSHA1" />
<Using Include="JustArchiNET.Madness.HttpRequestExceptionMadness.HttpRequestException" Alias="HttpRequestException" />
<Using Include="JustArchiNET.Madness.OperatingSystemMadness.OperatingSystem" Alias="OperatingSystem" />
<Using Include="JustArchiNET.Madness.PathMadness.Path" Alias="Path" />
<Using Include="JustArchiNET.Madness.RandomMadness.Random" Alias="Random" />

View File

@@ -11,7 +11,7 @@
<PackageVersion Include="MSTest.TestFramework" Version="2.2.10" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.1" />
<PackageVersion Include="Nito.AsyncEx.Coordination" Version="5.1.2" />
<PackageVersion Include="NLog.Web.AspNetCore" Version="5.1.4" />
<PackageVersion Include="NLog.Web.AspNetCore" Version="5.1.5" />
<PackageVersion Include="SteamKit2" Version="2.4.1" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.4.0" />
<PackageVersion Include="Swashbuckle.AspNetCore.Annotations" Version="6.4.0" />
@@ -27,7 +27,7 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net481'">
<PackageVersion Include="JustArchiNET.Madness" Version="3.7.0" />
<PackageVersion Include="JustArchiNET.Madness" Version="3.8.0" />
<PackageVersion Include="Microsoft.AspNetCore.Cors" Version="2.2.0" />
<PackageVersion Include="Microsoft.AspNetCore.Diagnostics" Version="2.2.0" />
<PackageVersion Include="Microsoft.AspNetCore.HttpOverrides" Version="2.2.0" />
@@ -36,8 +36,8 @@
<PackageVersion Include="Microsoft.AspNetCore.ResponseCompression" Version="2.2.0" />
<PackageVersion Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.2.0" />
<PackageVersion Include="Microsoft.AspNetCore.WebSockets" Version="2.2.1" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="3.1.29" />
<PackageVersion Include="Microsoft.Extensions.Logging.Configuration" Version="3.1.29" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="3.1.30" />
<PackageVersion Include="Microsoft.Extensions.Logging.Configuration" Version="3.1.30" />
<PackageVersion Include="TA.System.Runtime.CompilerServices.RuntimeHelpers.GetSubArray" Version="1.0.1" />
</ItemGroup>
</Project>

2
wiki

Submodule wiki updated: a18f9a56f1...7062284646