Compare commits

..

39 Commits

Author SHA1 Message Date
JustArchi
8ad552b0da Slightly improve ASF's algorithm for picking users to match 2020-06-21 00:44:24 +02:00
JustArchi
c16c25da77 Translations update 2020-06-21 00:19:15 +02:00
JustArchi
aa1fc829b7 Misc 2020-06-21 00:15:06 +02:00
JustArchi
e5eea110f1 Skip fair bots with huge inventories when active matching 2020-06-21 00:06:17 +02:00
JustArchi
2e5828779f Update Bug_report.md 2020-06-20 17:55:40 +02:00
JustArchi
cc2e73ae5a Misc 2020-06-20 17:12:18 +02:00
dependabot-preview[bot]
b89840f103 Bump Swashbuckle.AspNetCore from 5.4.1 to 5.5.0
Bumps [Swashbuckle.AspNetCore](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) from 5.4.1 to 5.5.0.
- [Release notes](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/releases)
- [Commits](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/compare/v5.4.1...v5.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-19 10:25:06 +00:00
dependabot-preview[bot]
12b32472ba Bump Swashbuckle.AspNetCore.Newtonsoft from 5.4.1 to 5.5.0
Bumps [Swashbuckle.AspNetCore.Newtonsoft](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) from 5.4.1 to 5.5.0.
- [Release notes](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/releases)
- [Commits](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/compare/v5.4.1...v5.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-19 10:03:24 +00:00
dependabot-preview[bot]
86ac2ade1e Bump Swashbuckle.AspNetCore.Annotations from 5.4.1 to 5.5.0
Bumps [Swashbuckle.AspNetCore.Annotations](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) from 5.4.1 to 5.5.0.
- [Release notes](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/releases)
- [Commits](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/compare/v5.4.1...v5.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-19 09:38:34 +00:00
JustArchi
a180c46b5d Update config.yml 2020-06-19 10:12:41 +02:00
JustArchi
34555f8bb5 Bump 2020-06-18 23:42:14 +02:00
JustArchi
4db8826e4d Translations update 2020-06-18 23:40:54 +02:00
Vitaliy
69358541bf Add Summer Sale 2020 to blacklist (#1853) 2020-06-18 19:38:09 +02:00
dependabot-preview[bot]
896c92b678 Bump ASF-ui from 9f21342 to ab1d058
Bumps [ASF-ui](https://github.com/JustArchiNET/ASF-ui) from `9f21342` to `ab1d058`.
- [Release notes](https://github.com/JustArchiNET/ASF-ui/releases)
- [Commits](9f21342fa2...ab1d0580cd)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-18 01:21:51 +00:00
JustArchi
6ef52c5184 Bump 2020-06-16 10:11:23 +02:00
JustArchi
5b098b79a5 Translations update 2020-06-16 10:09:13 +02:00
JustArchi
2cab6c82e4 Closes #1849 2020-06-16 10:04:51 +02:00
dependabot-preview[bot]
91d3012581 Bump wiki from 3e4e676 to 01c86ed
Bumps [wiki](https://github.com/JustArchiNET/ArchiSteamFarm.wiki) from `3e4e676` to `01c86ed`.
- [Release notes](https://github.com/JustArchiNET/ArchiSteamFarm.wiki/releases)
- [Commits](3e4e6768f9...01c86ed121)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-16 01:29:23 +00:00
dependabot-preview[bot]
354b60db53 Bump ASF-ui from 74be05f to 9f21342
Bumps [ASF-ui](https://github.com/JustArchiNET/ASF-ui) from `74be05f` to `9f21342`.
- [Release notes](https://github.com/JustArchiNET/ASF-ui/releases)
- [Commits](74be05f734...9f21342fa2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-16 01:22:44 +00:00
JustArchi
fd89c42e48 Bump 2020-06-15 23:42:27 +02:00
JustArchi
79a862dd0e Translations update 2020-06-15 23:32:38 +02:00
JustArchi
54a20246db Use CrossProcessFileBasedSemaphore exclusively
Our reference implementation actually doesn't release the wait handle on process exit, which defeats the purpose. Use file-based semaphore on all OSes as it works reliably.
2020-06-15 23:28:52 +02:00
JustArchi
822bfc239f Move ToLongRunningTask into ASF core and start making use of it 2020-06-15 16:55:57 +02:00
JustArchi
f80bf929f7 Update SharedInfo.cs 2020-06-15 16:31:26 +02:00
JustArchi
e201d88e7a Modify AppInfosPerSingleRequest for STD 2020-06-15 16:25:28 +02:00
JustArchi
ce5443ca9a Closes #1848 2020-06-15 15:55:59 +02:00
JustArchi
4b570f7928 Handle token in cc.sh, misc 2020-06-15 13:45:17 +02:00
JustArchi
b5152eb852 Modify cc.sh and run.sh for plugin scenario 2020-06-15 13:21:56 +02:00
dependabot-preview[bot]
c5315be572 Bump wiki from b825f6d to bb4eadc
Bumps [wiki](https://github.com/JustArchiNET/ArchiSteamFarm.wiki) from `b825f6d` to `bb4eadc`.
- [Release notes](https://github.com/JustArchiNET/ArchiSteamFarm.wiki/releases)
- [Commits](b825f6ddbb...bb4eadc9f3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-15 01:29:11 +00:00
dependabot-preview[bot]
b4a2c76736 Bump ASF-ui from 17c5a77 to ca16eb4
Bumps [ASF-ui](https://github.com/JustArchiNET/ASF-ui) from `17c5a77` to `ca16eb4`.
- [Release notes](https://github.com/JustArchiNET/ASF-ui/releases)
- [Commits](17c5a777b9...ca16eb4672)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-15 01:22:17 +00:00
JustArchi
53726a6a26 Bump 2020-06-14 15:25:50 +02:00
JustArchi
84ec2b7b26 Don't use a volume for plugins 2020-06-14 01:51:50 +02:00
JustArchi
336a8b5150 Update build 2020-06-14 01:42:53 +02:00
JustArchi
4a6480d223 Misc docker fixes 2020-06-14 01:36:04 +02:00
Sandro
017b26986b Fix Docker Image building with Steam Token Dumper, unify different Arches into one Dockerfile (#1845)
* Pass STEAM_TOKEN_DUMPER_TOKEN as --build-arg

* Unify different ARCHs Dockerfiles
2020-06-14 01:17:08 +02:00
JustArchi
6287bc85fe @abrynos improvements 2020-06-13 21:55:24 +02:00
JustArchi
2a54c7101f Bump 2020-06-13 21:47:19 +02:00
JustArchi
6804f5b5f7 Fix for multiple licenses for the same package 2020-06-13 21:45:37 +02:00
JustArchi
574e8739c1 Bump 2020-06-13 20:23:55 +02:00
33 changed files with 192 additions and 375 deletions

View File

@@ -40,7 +40,7 @@ Feel free to remove our notice and fill the template below with your details.
### Full log.txt recorded during reproducing the problem
```
```text
Paste here, in-between triple backtick tags
Ensure that your log is complete and was NOT recorded in Debug mode, as debug log may contain sensitive information that should not be shared publicly, as per our wiki statement. Standard ASF log does not include sensitive information.

View File

@@ -6,7 +6,7 @@ contact_links:
- name: Localization improvement
url: https://github.com/JustArchiNET/ArchiSteamFarm/wiki/Localization
about: Please use our crowdin platform.
- name: Questions and technical issues
- name: Support question or technical issue
url: https://github.com/JustArchiNET/ArchiSteamFarm/blob/master/SUPPORT.md
about: Please review our support guidelines.
- name: Negative feedback, complaints and demands

View File

@@ -62,7 +62,7 @@ jobs:
run: dotnet build ArchiSteamFarm.CustomPlugins.PeriodicGC -c "${{ env.CONFIGURATION }}" -p:UseAppHost=false --nologo
- name: Build ArchiSteamFarm.OfficialPlugins.SteamTokenDumper
run: dotnet build ArchiSteamFarm.OfficialPlugins.SteamTokenDumper -c "${{ env.CONFIGURATION }}" -p:UseAppHost=false --nologo
run: dotnet build "${{ env.STEAM_TOKEN_DUMPER_NAME }}" -c "${{ env.CONFIGURATION }}" -p:UseAppHost=false --nologo
- name: Run ArchiSteamFarm.Tests
run: dotnet test ArchiSteamFarm.Tests -c "${{ env.CONFIGURATION }}" -p:UseAppHost=false --nologo
@@ -71,9 +71,9 @@ jobs:
if: startsWith(matrix.os, 'macos-') || startsWith(matrix.os, 'ubuntu-')
shell: sh
run: |
if [ -n "${STEAM_TOKEN_DUMPER_TOKEN-}" ] && [ -f "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs" ]; then
sed "s/STEAM_TOKEN_DUMPER_TOKEN/${STEAM_TOKEN_DUMPER_TOKEN}/g" "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs" > "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs.new";
mv "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs.new" "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs"
if [ -n "${STEAM_TOKEN_DUMPER_TOKEN-}" ] && [ -f "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs" ]; then
sed "s/STEAM_TOKEN_DUMPER_TOKEN/${STEAM_TOKEN_DUMPER_TOKEN}/g" "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs" > "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs.new";
mv "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs.new" "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs"
fi
- name: Prepare ArchiSteamFarm.OfficialPlugins.SteamTokenDumper on Windows
if: startsWith(matrix.os, 'windows-')
@@ -83,8 +83,8 @@ jobs:
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue'
if ((Test-Path env:STEAM_TOKEN_DUMPER_TOKEN) -and (Test-Path 'ArchiSteamFarm.OfficialPlugins.SteamTokenDumper\SharedInfo.cs' -PathType Leaf)) {
(Get-Content 'ArchiSteamFarm.OfficialPlugins.SteamTokenDumper\SharedInfo.cs').Replace('STEAM_TOKEN_DUMPER_TOKEN', "$env:STEAM_TOKEN_DUMPER_TOKEN") | Set-Content 'ArchiSteamFarm.OfficialPlugins.SteamTokenDumper\SharedInfo.cs'
if ((Test-Path env:STEAM_TOKEN_DUMPER_TOKEN) -and (Test-Path "$env:STEAM_TOKEN_DUMPER_NAME\SharedInfo.cs" -PathType Leaf)) {
(Get-Content "$env:STEAM_TOKEN_DUMPER_NAME\SharedInfo.cs").Replace('STEAM_TOKEN_DUMPER_TOKEN', "$env:STEAM_TOKEN_DUMPER_TOKEN") | Set-Content "$env:STEAM_TOKEN_DUMPER_NAME\SharedInfo.cs"
}
- name: Publish ArchiSteamFarm.OfficialPlugins.SteamTokenDumper for .NET Core
run: dotnet publish "${{ env.STEAM_TOKEN_DUMPER_NAME }}" -c "${{ env.CONFIGURATION }}" -f "${{ env.NET_CORE_VERSION }}" -o "out/${{ env.STEAM_TOKEN_DUMPER_NAME }}/${{ env.NET_CORE_VERSION }}" -p:UseAppHost=false --nologo

View File

@@ -38,12 +38,12 @@ script:
dotnet build ArchiSteamFarm -c "$CONFIGURATION" -p:UseAppHost=false --nologo
dotnet build ArchiSteamFarm.CustomPlugins.ExamplePlugin -c "$CONFIGURATION" -p:UseAppHost=false --nologo
dotnet build ArchiSteamFarm.CustomPlugins.PeriodicGC -c "$CONFIGURATION" -p:UseAppHost=false --nologo
dotnet build ArchiSteamFarm.OfficialPlugins.SteamTokenDumper -c "$CONFIGURATION" -p:UseAppHost=false --nologo
dotnet build "$STEAM_TOKEN_DUMPER_NAME" -c "$CONFIGURATION" -p:UseAppHost=false --nologo
dotnet test ArchiSteamFarm.Tests -c "$CONFIGURATION" -p:UseAppHost=false --nologo
if [ -n "${STEAM_TOKEN_DUMPER_TOKEN-}" ] && [ -f "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs" ]; then
sed "s/STEAM_TOKEN_DUMPER_TOKEN/${STEAM_TOKEN_DUMPER_TOKEN}/g" "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs" > "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs.new";
mv "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs.new" "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs"
if [ -n "${STEAM_TOKEN_DUMPER_TOKEN-}" ] && [ -f "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs" ]; then
sed "s/STEAM_TOKEN_DUMPER_TOKEN/${STEAM_TOKEN_DUMPER_TOKEN}/g" "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs" > "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs.new";
mv "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs.new" "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs"
fi
dotnet publish "$STEAM_TOKEN_DUMPER_NAME" -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}" -p:UseAppHost=false --nologo

2
ASF-ui

Submodule ASF-ui updated: 17c5a777b9...452d296a0f

View File

@@ -22,14 +22,13 @@
namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper {
internal static class SharedInfo {
internal const byte ApiVersion = 1;
internal const byte AppInfosPerSingleRequest = byte.MaxValue;
internal const string ConfigurationPropertyEnabled = nameof(SteamTokenDumperPlugin) + "Enabled";
internal const ushort ItemsPerSingleRequest = 2048; // Should be synchronized with TimeoutForLongRunningTasksInSeconds
internal const byte MaximumHoursBetweenRefresh = 8; // Per single bot account, makes sense to be 2 or 3 times less than MinimumHoursBetweenUploads
internal const byte MaximumMinutesBeforeFirstUpload = 60; // Must be greater or equal to MinimumMinutesBeforeFirstUpload
internal const byte MinimumHoursBetweenUploads = 24;
internal const byte MinimumMinutesBeforeFirstUpload = 10; // Must be less or equal to MaximumMinutesBeforeFirstUpload
internal const string ServerURL = "https://asf-token-dumper.xpaw.me";
internal const byte TimeoutForLongRunningTasksInSeconds = 60; // Should be synchronized with ItemsPerSingleRequest
internal const string Token = "STEAM_TOKEN_DUMPER_TOKEN";
internal static bool HasValidToken => Token.Length == 128;

View File

@@ -1,40 +0,0 @@
// _ _ _ ____ _ _____
// / \ _ __ ___ | |__ (_)/ ___| | |_ ___ __ _ _ __ ___ | ___|__ _ _ __ _ __ ___
// / _ \ | '__|/ __|| '_ \ | |\___ \ | __|/ _ \ / _` || '_ ` _ \ | |_ / _` || '__|| '_ ` _ \
// / ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
// /_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
// |
// Copyright 2015-2020 Ł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.Threading.Tasks;
using JetBrains.Annotations;
using SteamKit2;
namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper {
internal static class StaticHelpers {
[NotNull]
internal static Task<T> ToLongRunningTask<T>([NotNull] this AsyncJob<T> job) where T : CallbackMsg {
if (job == null) {
throw new ArgumentNullException(nameof(job));
}
job.Timeout = TimeSpan.FromSeconds(SharedInfo.TimeoutForLongRunningTasksInSeconds);
return job.ToTask();
}
}
}

View File

@@ -197,7 +197,7 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper {
throw new ArgumentNullException(nameof(GlobalCache));
}
Dictionary<uint, ulong> packageTokens = callback.LicenseList.ToDictionary(license => license.PackageID, license => license.AccessToken);
Dictionary<uint, ulong> packageTokens = callback.LicenseList.GroupBy(license => license.PackageID).ToDictionary(group => group.Key, group => group.OrderByDescending(license => license.TimeCreated).First().AccessToken);
await GlobalCache.UpdatePackageTokens(packageTokens).ConfigureAwait(false);
await Refresh(bot, packageTokens.Keys).ConfigureAwait(false);
@@ -250,11 +250,11 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper {
bot.ArchiLogger.LogGenericInfo($"Retrieving a total of {appIDsToRefresh.Count} app access tokens...");
HashSet<uint> appIDsThisRound = new HashSet<uint>(Math.Min(appIDsToRefresh.Count, SharedInfo.ItemsPerSingleRequest));
HashSet<uint> appIDsThisRound = new HashSet<uint>(Math.Min(appIDsToRefresh.Count, SharedInfo.AppInfosPerSingleRequest));
using (HashSet<uint>.Enumerator enumerator = appIDsToRefresh.GetEnumerator()) {
while (true) {
while ((appIDsThisRound.Count < SharedInfo.ItemsPerSingleRequest) && enumerator.MoveNext()) {
while ((appIDsThisRound.Count < SharedInfo.AppInfosPerSingleRequest) && enumerator.MoveNext()) {
appIDsThisRound.Add(enumerator.Current);
}
@@ -262,18 +262,28 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper {
break;
}
if (!bot.IsConnectedAndLoggedOn) {
return;
}
bot.ArchiLogger.LogGenericInfo($"Retrieving {appIDsThisRound.Count} app access tokens...");
SteamApps.PICSTokensCallback response;
try {
response = await bot.SteamApps.PICSGetAccessTokens(appIDsThisRound, Enumerable.Empty<uint>());
response = await bot.SteamApps.PICSGetAccessTokens(appIDsThisRound, Enumerable.Empty<uint>()).ToLongRunningTask().ConfigureAwait(false);
} catch (Exception e) {
bot.ArchiLogger.LogGenericWarningException(e);
return;
}
if (response == null) {
bot.ArchiLogger.LogGenericWarning(string.Format(Strings.WarningFailedWithError, nameof(response)));
return;
}
bot.ArchiLogger.LogGenericInfo($"Finished retrieving {appIDsThisRound.Count} app access tokens.");
appIDsThisRound.Clear();
@@ -289,7 +299,7 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper {
using (HashSet<uint>.Enumerator enumerator = appIDsToRefresh.GetEnumerator()) {
while (true) {
while ((appIDsThisRound.Count < SharedInfo.ItemsPerSingleRequest) && enumerator.MoveNext()) {
while ((appIDsThisRound.Count < SharedInfo.AppInfosPerSingleRequest) && enumerator.MoveNext()) {
appIDsThisRound.Add(enumerator.Current);
}
@@ -297,12 +307,16 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper {
break;
}
if (!bot.IsConnectedAndLoggedOn) {
return;
}
bot.ArchiLogger.LogGenericInfo($"Retrieving {appIDsThisRound.Count} app infos...");
AsyncJobMultiple<SteamApps.PICSProductInfoCallback>.ResultSet response;
try {
response = await bot.SteamApps.PICSGetProductInfo(appIDsThisRound.Select(appID => new SteamApps.PICSRequest { ID = appID, AccessToken = GlobalCache.GetAppToken(appID), Public = false }), Enumerable.Empty<SteamApps.PICSRequest>());
response = await bot.SteamApps.PICSGetProductInfo(appIDsThisRound.Select(appID => new SteamApps.PICSRequest { ID = appID, AccessToken = GlobalCache.GetAppToken(appID), Public = false }), Enumerable.Empty<SteamApps.PICSRequest>()).ToLongRunningTask().ConfigureAwait(false);
} catch (Exception e) {
bot.ArchiLogger.LogGenericWarningException(e);
@@ -320,6 +334,7 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper {
appIDsThisRound.Clear();
Dictionary<uint, uint> appChangeNumbers = new Dictionary<uint, uint>();
HashSet<Task<SteamApps.DepotKeyCallback>> depotTasks = new HashSet<Task<SteamApps.DepotKeyCallback>>();
foreach (SteamApps.PICSProductInfoCallback.PICSProductInfo app in response.Results.SelectMany(result => result.Apps.Values)) {

View File

@@ -218,7 +218,7 @@ namespace ArchiSteamFarm {
SteamUnifiedMessages.ServiceMethodResponse response;
try {
response = await UnifiedPlayerService.SendMessage(x => x.AddFriend(request));
response = await UnifiedPlayerService.SendMessage(x => x.AddFriend(request)).ToLongRunningTask().ConfigureAwait(false);
} catch (Exception e) {
ArchiLogger.LogGenericWarningException(e);
@@ -253,7 +253,7 @@ namespace ArchiSteamFarm {
SteamUnifiedMessages.ServiceMethodResponse response;
try {
response = await UnifiedClanChatRoomsService.SendMessage(x => x.GetClanChatRoomInfo(request));
response = await UnifiedClanChatRoomsService.SendMessage(x => x.GetClanChatRoomInfo(request)).ToLongRunningTask().ConfigureAwait(false);
} catch (Exception e) {
ArchiLogger.LogGenericWarningException(e);
@@ -284,7 +284,7 @@ namespace ArchiSteamFarm {
SteamUnifiedMessages.ServiceMethodResponse response;
try {
response = await UnifiedPlayerService.SendMessage(x => x.GetGameBadgeLevels(request));
response = await UnifiedPlayerService.SendMessage(x => x.GetGameBadgeLevels(request)).ToLongRunningTask().ConfigureAwait(false);
} catch (Exception e) {
ArchiLogger.LogGenericWarningException(e);
@@ -316,7 +316,7 @@ namespace ArchiSteamFarm {
SteamUnifiedMessages.ServiceMethodResponse response;
try {
response = await UnifiedChatRoomService.SendMessage(x => x.GetMyChatRoomGroups(request));
response = await UnifiedChatRoomService.SendMessage(x => x.GetMyChatRoomGroups(request)).ToLongRunningTask().ConfigureAwait(false);
} catch (Exception e) {
ArchiLogger.LogGenericWarningException(e);
@@ -348,7 +348,7 @@ namespace ArchiSteamFarm {
SteamUnifiedMessages.ServiceMethodResponse response;
try {
response = await UnifiedEconService.SendMessage(x => x.GetTradeOfferAccessToken(request));
response = await UnifiedEconService.SendMessage(x => x.GetTradeOfferAccessToken(request)).ToLongRunningTask().ConfigureAwait(false);
} catch (Exception e) {
ArchiLogger.LogGenericWarningException(e);
@@ -386,7 +386,7 @@ namespace ArchiSteamFarm {
SteamUnifiedMessages.ServiceMethodResponse response;
try {
response = await UnifiedChatRoomService.SendMessage(x => x.JoinChatRoomGroup(request));
response = await UnifiedChatRoomService.SendMessage(x => x.JoinChatRoomGroup(request)).ToLongRunningTask().ConfigureAwait(false);
} catch (Exception e) {
ArchiLogger.LogGenericWarningException(e);
@@ -477,7 +477,7 @@ namespace ArchiSteamFarm {
Client.Send(request);
try {
return await new AsyncJob<RedeemGuestPassResponseCallback>(Client, request.SourceJobID);
return await new AsyncJob<RedeemGuestPassResponseCallback>(Client, request.SourceJobID).ToLongRunningTask().ConfigureAwait(false);
} catch (Exception e) {
ArchiLogger.LogGenericException(e);
@@ -510,7 +510,7 @@ namespace ArchiSteamFarm {
Client.Send(request);
try {
return await new AsyncJob<PurchaseResponseCallback>(Client, request.SourceJobID);
return await new AsyncJob<PurchaseResponseCallback>(Client, request.SourceJobID).ToLongRunningTask().ConfigureAwait(false);
} catch (Exception e) {
ArchiLogger.LogGenericException(e);
@@ -540,7 +540,7 @@ namespace ArchiSteamFarm {
SteamUnifiedMessages.ServiceMethodResponse response;
try {
response = await UnifiedPlayerService.SendMessage(x => x.RemoveFriend(request));
response = await UnifiedPlayerService.SendMessage(x => x.RemoveFriend(request)).ToLongRunningTask().ConfigureAwait(false);
} catch (Exception e) {
ArchiLogger.LogGenericWarningException(e);
@@ -592,7 +592,7 @@ namespace ArchiSteamFarm {
SteamUnifiedMessages.ServiceMethodResponse response;
try {
response = await UnifiedFriendMessagesService.SendMessage(x => x.SendMessage(request));
response = await UnifiedFriendMessagesService.SendMessage(x => x.SendMessage(request)).ToLongRunningTask().ConfigureAwait(false);
} catch (Exception e) {
ArchiLogger.LogGenericWarningException(e);
@@ -628,7 +628,7 @@ namespace ArchiSteamFarm {
SteamUnifiedMessages.ServiceMethodResponse response;
try {
response = await UnifiedChatRoomService.SendMessage(x => x.SendChatMessage(request));
response = await UnifiedChatRoomService.SendMessage(x => x.SendChatMessage(request)).ToLongRunningTask().ConfigureAwait(false);
} catch (Exception e) {
ArchiLogger.LogGenericWarningException(e);
@@ -663,7 +663,7 @@ namespace ArchiSteamFarm {
SteamUnifiedMessages.ServiceMethodResponse response;
try {
response = await UnifiedFriendMessagesService.SendMessage(x => x.SendMessage(request));
response = await UnifiedFriendMessagesService.SendMessage(x => x.SendMessage(request)).ToLongRunningTask().ConfigureAwait(false);
} catch (Exception e) {
ArchiLogger.LogGenericWarningException(e);

View File

@@ -27,9 +27,9 @@
<PackageReference Include="NLog" Version="4.7.2" />
<PackageReference Include="NLog.Web.AspNetCore" Version="4.9.2" />
<PackageReference Include="SteamKit2" Version="2.3.0-beta.2" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.4.1" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="5.4.1" />
<PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" Version="5.4.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="5.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" Version="5.5.0" />
<PackageReference Include="System.Composition" Version="1.4.1" />
<PackageReference Include="System.Linq.Async" Version="4.1.1" />
</ItemGroup>

View File

@@ -50,12 +50,13 @@ namespace ArchiSteamFarm {
[PublicAPI]
public const string SteamStoreURL = "https://" + SteamStoreHost;
internal const ushort MaxItemsInSingleInventoryRequest = 5000;
private const string IEconService = "IEconService";
private const string IPlayerService = "IPlayerService";
private const string ISteamApps = "ISteamApps";
private const string ISteamUserAuth = "ISteamUserAuth";
private const string ITwoFactorService = "ITwoFactorService";
private const ushort MaxItemsInSingleInventoryRequest = 5000;
private const byte MinSessionValidityInSeconds = GlobalConfig.DefaultConnectionTimeout / 6;
private const string SteamCommunityHost = "steamcommunity.com";
private const string SteamHelpHost = "help.steampowered.com";

View File

@@ -671,11 +671,27 @@ namespace ArchiSteamFarm {
}
}
SteamApps.PICSTokensCallback tokenCallback = null;
for (byte i = 0; (i < WebBrowser.MaxTries) && (tokenCallback == null) && IsConnectedAndLoggedOn; i++) {
try {
tokenCallback = await SteamApps.PICSGetAccessTokens(appID, null).ToLongRunningTask().ConfigureAwait(false);
} catch (Exception e) {
ArchiLogger.LogGenericWarningException(e);
}
}
if (tokenCallback == null) {
return (optimisticDiscovery ? appID : 0, DateTime.MinValue, true);
}
SteamApps.PICSRequest request = new SteamApps.PICSRequest(appID, tokenCallback.AppTokens.TryGetValue(appID, out ulong accessToken) ? accessToken : 0, false);
AsyncJobMultiple<SteamApps.PICSProductInfoCallback>.ResultSet productInfoResultSet = null;
for (byte i = 0; (i < WebBrowser.MaxTries) && (productInfoResultSet == null) && IsConnectedAndLoggedOn; i++) {
try {
productInfoResultSet = await SteamApps.PICSGetProductInfo(appID, null, false);
productInfoResultSet = await SteamApps.PICSGetProductInfo(request.ToEnumerable(), Enumerable.Empty<SteamApps.PICSRequest>()).ToLongRunningTask().ConfigureAwait(false);
} catch (Exception e) {
ArchiLogger.LogGenericWarningException(e);
}
@@ -845,7 +861,7 @@ namespace ArchiSteamFarm {
for (byte i = 0; (i < WebBrowser.MaxTries) && (productInfoResultSet == null) && IsConnectedAndLoggedOn; i++) {
try {
productInfoResultSet = await SteamApps.PICSGetProductInfo(Enumerable.Empty<SteamApps.PICSRequest>(), packageRequests);
productInfoResultSet = await SteamApps.PICSGetProductInfo(Enumerable.Empty<SteamApps.PICSRequest>(), packageRequests).ToLongRunningTask().ConfigureAwait(false);
} catch (Exception e) {
ArchiLogger.LogGenericWarningException(e);
}
@@ -1119,7 +1135,7 @@ namespace ArchiSteamFarm {
SteamUser.WebAPIUserNonceCallback callback;
try {
callback = await SteamUser.RequestWebAPIUserNonce();
callback = await SteamUser.RequestWebAPIUserNonce().ToLongRunningTask().ConfigureAwait(false);
} catch (Exception e) {
ArchiLogger.LogGenericWarningException(e);
await Connect(true).ConfigureAwait(false);
@@ -1733,7 +1749,7 @@ namespace ArchiSteamFarm {
try {
if (DateTime.UtcNow.Subtract(ArchiHandler.LastPacketReceived).TotalSeconds > ASF.GlobalConfig.ConnectionTimeout) {
await SteamFriends.RequestProfileInfo(SteamID);
await SteamFriends.RequestProfileInfo(SteamID).ToLongRunningTask().ConfigureAwait(false);
}
HeartBeatFailures = 0;
@@ -2376,7 +2392,7 @@ namespace ArchiSteamFarm {
Dictionary<uint, ulong> packageAccessTokens = new Dictionary<uint, ulong>();
Dictionary<uint, uint> packagesToRefresh = new Dictionary<uint, uint>();
foreach (SteamApps.LicenseListCallback.License license in callback.LicenseList) {
foreach (SteamApps.LicenseListCallback.License license in callback.LicenseList.GroupBy(license => license.PackageID, (packageID, licenses) => licenses.OrderByDescending(license => license.TimeCreated).First())) {
OwnedPackageIDs[license.PackageID] = (license.PaymentMethod, license.TimeCreated);
if (!ASF.GlobalDatabase.PackageAccessTokensReadOnly.TryGetValue(license.PackageID, out ulong packageAccessToken) || (packageAccessToken != license.AccessToken)) {

View File

@@ -46,7 +46,7 @@ namespace ArchiSteamFarm {
private const byte HoursToIgnore = 24; // How many hours we ignore unreleased appIDs and don't bother checking them again
[PublicAPI]
public static readonly ImmutableHashSet<uint> SalesBlacklist = ImmutableHashSet.Create<uint>(267420, 303700, 335590, 368020, 425280, 480730, 566020, 639900, 762800, 876740, 991980, 1195670);
public static readonly ImmutableHashSet<uint> SalesBlacklist = ImmutableHashSet.Create<uint>(267420, 303700, 335590, 368020, 425280, 480730, 566020, 639900, 762800, 876740, 991980, 1195670, 1343890);
private static readonly ConcurrentDictionary<uint, DateTime> GloballyIgnoredAppIDs = new ConcurrentDictionary<uint, DateTime>(); // Reserved for unreleased games

View File

@@ -576,7 +576,7 @@ namespace ArchiSteamFarm {
SteamApps.FreeLicenseCallback callback;
try {
callback = await Bot.SteamApps.RequestFreeLicense(gameID);
callback = await Bot.SteamApps.RequestFreeLicense(gameID).ToLongRunningTask().ConfigureAwait(false);
} catch (Exception e) {
Bot.ArchiLogger.LogGenericWarningException(e);
response.AppendLine(FormatBotResponse(string.Format(Strings.BotAddLicense, "app/" + gameID, EResult.Timeout)));

View File

@@ -166,9 +166,15 @@ namespace ArchiSteamFarm.Helpers {
OS.UnixSetFileAccess(directoryPath, OS.EUnixPermission.Combined777);
} else {
DirectoryInfo directoryInfo = new DirectoryInfo(directoryPath);
DirectorySecurity directorySecurity = new DirectorySecurity(FilePath, AccessControlSections.All);
directoryInfo.SetAccessControl(directorySecurity);
try {
DirectorySecurity directorySecurity = new DirectorySecurity(directoryPath, AccessControlSections.All);
directoryInfo.SetAccessControl(directorySecurity);
} catch (PrivilegeNotHeldException e) {
// Non-critical, user might have no rights to manage the resource
ASF.ArchiLogger.LogGenericDebuggingException(e);
}
}
}
@@ -179,9 +185,15 @@ namespace ArchiSteamFarm.Helpers {
OS.UnixSetFileAccess(FilePath, OS.EUnixPermission.Combined777);
} else {
FileInfo fileInfo = new FileInfo(FilePath);
FileSecurity fileSecurity = new FileSecurity(FilePath, AccessControlSections.All);
fileInfo.SetAccessControl(fileSecurity);
try {
FileSecurity fileSecurity = new FileSecurity(FilePath, AccessControlSections.All);
fileInfo.SetAccessControl(fileSecurity);
} catch (PrivilegeNotHeldException e) {
// Non-critical, user might have no rights to manage the resource
ASF.ArchiLogger.LogGenericDebuggingException(e);
}
}
} catch (IOException) {
// Ignored, if the file was already created in the meantime by another instance, this is fine

View File

@@ -1,53 +0,0 @@
// _ _ _ ____ _ _____
// / \ _ __ ___ | |__ (_)/ ___| | |_ ___ __ _ _ __ ___ | ___|__ _ _ __ _ __ ___
// / _ \ | '__|/ __|| '_ \ | |\___ \ | __|/ _ \ / _` || '_ ` _ \ | |_ / _` || '__|| '_ ` _ \
// / ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
// /_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
// |
// Copyright 2015-2020 Ł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.Threading;
using System.Threading.Tasks;
using JetBrains.Annotations;
namespace ArchiSteamFarm.Helpers {
internal sealed class CrossProcessSemaphore : ICrossProcessSemaphore {
private readonly Semaphore GlobalSemaphore;
internal CrossProcessSemaphore([NotNull] string name) {
if (string.IsNullOrEmpty(name)) {
throw new ArgumentNullException(nameof(name));
}
GlobalSemaphore = new Semaphore(1, 1, name);
}
public void Dispose() => GlobalSemaphore.Dispose();
void ICrossProcessSemaphore.Release() => GlobalSemaphore.Release();
[NotNull]
Task ICrossProcessSemaphore.WaitAsync() {
GlobalSemaphore.WaitOne();
return Task.CompletedTask;
}
[NotNull]
Task<bool> ICrossProcessSemaphore.WaitAsync(int millisecondsTimeout) => Task.FromResult(GlobalSemaphore.WaitOne(millisecondsTimeout));
}
}

View File

@@ -71,14 +71,7 @@ namespace ArchiSteamFarm {
string resourceName = GetOsResourceName(objectName);
try {
return new CrossProcessSemaphore(resourceName);
} catch (PlatformNotSupportedException e) {
// CrossProcessSemaphore is currently available only for Windows platforms, we use alternative synchronization for other OSes
ASF.ArchiLogger.LogGenericDebuggingException(e);
return new CrossProcessFileBasedSemaphore(resourceName);
}
return new CrossProcessFileBasedSemaphore(resourceName);
}
internal static void Init(bool systemRequired, GlobalConfig.EOptimizationMode optimizationMode) {

View File

@@ -34,8 +34,8 @@ using Newtonsoft.Json;
namespace ArchiSteamFarm {
internal sealed class Statistics : IAsyncDisposable {
private const ushort MaxItemsForFairBots = ArchiWebHandler.MaxItemsInSingleInventoryRequest * WebBrowser.MaxTries; // Determines which fair bots we'll deprioritize when matching due to excessive number of inventory requests they need to make, which are likely to fail in the process or cause excessive delays
private const byte MaxMatchedBotsHard = 40; // Determines how many bots we can attempt to match in total, where match attempt is equal to analyzing bot's inventory
private const byte MaxMatchedBotsSoft = MaxMatchedBotsHard / 2; // Determines how many consecutive empty matches we need to get before we decide to skip bots from the same category
private const byte MaxMatchingRounds = 10; // Determines maximum amount of matching rounds we're going to consider before leaving the rest of work for the next batch
private const byte MinAnnouncementCheckTTL = 6; // Minimum amount of hours we must wait before checking eligibility for Announcement, should be lower than MinPersonaStateTTL
private const byte MinHeartBeatTTL = 10; // Minimum amount of minutes we must wait before sending next HeartBeat
@@ -394,17 +394,11 @@ namespace ArchiSteamFarm {
return false;
}
bool skipAnyBots = false;
byte emptyMatches = 0;
byte totalMatches = 0;
HashSet<(uint RealAppID, Steam.Asset.EType Type, Steam.Asset.ERarity Rarity)> skippedSetsThisRound = new HashSet<(uint RealAppID, Steam.Asset.EType Type, Steam.Asset.ERarity Rarity)>();
foreach (ListedUser listedUser in listedUsers.Where(listedUser => (listedUser.SteamID != Bot.SteamID) && acceptedMatchableTypes.Any(listedUser.MatchableTypes.Contains) && (!triedSteamIDs.TryGetValue(listedUser.SteamID, out (byte Tries, ISet<ulong> GivenAssetIDs, ISet<ulong> ReceivedAssetIDs) attempt) || (attempt.Tries < byte.MaxValue)) && !Bot.IsBlacklistedFromTrades(listedUser.SteamID)).OrderBy(listedUser => triedSteamIDs.TryGetValue(listedUser.SteamID, out (byte Tries, ISet<ulong> GivenAssetIDs, ISet<ulong> ReceivedAssetIDs) attempt) ? attempt.Tries : 0).ThenByDescending(listedUser => listedUser.MatchEverything).ThenByDescending(listedUser => listedUser.Score)) {
if (listedUser.MatchEverything && skipAnyBots) {
continue;
}
foreach (ListedUser listedUser in listedUsers.Where(listedUser => (listedUser.SteamID != Bot.SteamID) && acceptedMatchableTypes.Any(listedUser.MatchableTypes.Contains) && (!triedSteamIDs.TryGetValue(listedUser.SteamID, out (byte Tries, ISet<ulong> GivenAssetIDs, ISet<ulong> ReceivedAssetIDs) attempt) || (attempt.Tries < byte.MaxValue)) && !Bot.IsBlacklistedFromTrades(listedUser.SteamID)).OrderBy(listedUser => triedSteamIDs.TryGetValue(listedUser.SteamID, out (byte Tries, ISet<ulong> GivenAssetIDs, ISet<ulong> ReceivedAssetIDs) attempt) ? attempt.Tries : 0).ThenByDescending(listedUser => listedUser.MatchEverything).ThenByDescending(listedUser => listedUser.MatchEverything || (listedUser.ItemsCount < MaxItemsForFairBots)).ThenByDescending(listedUser => listedUser.Score)) {
HashSet<(uint RealAppID, Steam.Asset.EType Type, Steam.Asset.ERarity Rarity)> wantedSets = ourTradableState.Keys.Where(set => !skippedSetsThisRound.Contains(set) && listedUser.MatchableTypes.Contains(set.Type)).ToHashSet();
if (wantedSets.Count == 0) {
@@ -626,8 +620,6 @@ namespace ArchiSteamFarm {
triedSteamIDs[listedUser.SteamID] = (++previousAttempt.Tries, previousAttempt.GivenAssetIDs, previousAttempt.ReceivedAssetIDs);
emptyMatches = 0;
Bot.ArchiLogger.LogGenericTrace(Bot.SteamID + " <- " + string.Join(", ", itemsToReceive.Select(item => item.RealAppID + "/" + item.Type + "-" + item.ClassID + " #" + item.Amount)) + " | " + string.Join(", ", itemsToGive.Select(item => item.RealAppID + "/" + item.Type + "-" + item.ClassID + " #" + item.Amount)) + " -> " + listedUser.SteamID);
(bool success, HashSet<ulong> mobileTradeOfferIDs) = await Bot.ArchiWebHandler.SendTradeOffer(listedUser.SteamID, itemsToGive, itemsToReceive, listedUser.TradeToken, true).ConfigureAwait(false);
@@ -661,15 +653,6 @@ namespace ArchiSteamFarm {
triedSteamIDs[listedUser.SteamID] = (byte.MaxValue, null, null);
}
if (++emptyMatches >= MaxMatchedBotsSoft) {
if (skipAnyBots) {
break;
}
skipAnyBots = true;
emptyMatches = 0;
}
continue;
}
@@ -691,11 +674,17 @@ namespace ArchiSteamFarm {
Bot.ArchiLogger.LogGenericInfo(string.Format(Strings.ActivelyMatchingItemsRound, skippedSetsThisRound.Count));
return skippedSetsThisRound.Count > 0;
// 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 (skippedSetsThisRound.Count > 0) || triedSteamIDs.Values.All(data => data.Tries < 2);
}
[SuppressMessage("ReSharper", "ClassCannotBeInstantiated")]
private sealed class ListedUser {
#pragma warning disable 649
[JsonProperty(PropertyName = "items_count", Required = Required.Always)]
internal readonly ushort ItemsCount;
#pragma warning restore 649
internal readonly HashSet<Steam.Asset.EType> MatchableTypes = new HashSet<Steam.Asset.EType>();
#pragma warning disable 649
@@ -715,11 +704,6 @@ namespace ArchiSteamFarm {
private readonly ushort GamesCount;
#pragma warning restore 649
#pragma warning disable 649
[JsonProperty(PropertyName = "items_count", Required = Required.Always)]
private readonly ushort ItemsCount;
#pragma warning restore 649
internal bool MatchEverything { get; private set; }
#pragma warning disable IDE0051

View File

@@ -71,7 +71,7 @@ namespace ArchiSteamFarm {
}
try {
picsChanges = await refreshBot.SteamApps.PICSGetChangesSince(LastChangeNumber, true, true);
picsChanges = await refreshBot.SteamApps.PICSGetChangesSince(LastChangeNumber, true, true).ToLongRunningTask().ConfigureAwait(false);
} catch (Exception e) {
refreshBot.ArchiLogger.LogGenericWarningException(e);
}

View File

@@ -32,9 +32,12 @@ using AngleSharp.XPath;
using Humanizer;
using Humanizer.Localisation;
using JetBrains.Annotations;
using SteamKit2;
namespace ArchiSteamFarm {
public static class Utilities {
private const byte TimeoutForLongRunningTasksInSeconds = 60;
// Normally we wouldn't need to use this singleton, but we want to ensure decent randomness across entire program's lifetime
private static readonly Random Random = new Random();
@@ -259,6 +262,30 @@ namespace ArchiSteamFarm {
[PublicAPI]
public static string ToHumanReadable(this TimeSpan timeSpan) => timeSpan.Humanize(3, maxUnit: TimeUnit.Year, minUnit: TimeUnit.Second);
[NotNull]
[PublicAPI]
public static Task<T> ToLongRunningTask<T>([NotNull] this AsyncJob<T> job) where T : CallbackMsg {
if (job == null) {
throw new ArgumentNullException(nameof(job));
}
job.Timeout = TimeSpan.FromSeconds(TimeoutForLongRunningTasksInSeconds);
return job.ToTask();
}
[NotNull]
[PublicAPI]
public static Task<AsyncJobMultiple<T>.ResultSet> ToLongRunningTask<T>([NotNull] this AsyncJobMultiple<T> job) where T : CallbackMsg {
if (job == null) {
throw new ArgumentNullException(nameof(job));
}
job.Timeout = TimeSpan.FromSeconds(TimeoutForLongRunningTasksInSeconds);
return job.ToTask();
}
internal static void DeleteEmptyDirectoriesRecursively(string directory) {
if (string.IsNullOrEmpty(directory)) {
ASF.ArchiLogger.LogNullError(nameof(directory));

View File

@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>4.2.2.3</Version>
<Version>4.2.2.9</Version>
</PropertyGroup>
<PropertyGroup>

View File

@@ -7,6 +7,7 @@ RUN echo "node: $(node --version)" && \
npm run deploy
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-dotnet
ARG ASF_ARCH=x64
ARG STEAM_TOKEN_DUMPER_TOKEN
ENV CONFIGURATION Release
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
@@ -24,13 +25,14 @@ RUN dotnet --info && \
if [ -f "ArchiSteamFarm/Localization/Strings.zh-CN.resx" ]; then ln -s "Strings.zh-CN.resx" "ArchiSteamFarm/Localization/Strings.zh-Hans.resx"; fi && \
if [ -f "ArchiSteamFarm/Localization/Strings.zh-TW.resx" ]; then ln -s "Strings.zh-TW.resx" "ArchiSteamFarm/Localization/Strings.zh-Hant.resx"; fi && \
if [ -n "${STEAM_TOKEN_DUMPER_TOKEN-}" ] && [ -f "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs" ]; then sed -i "s/STEAM_TOKEN_DUMPER_TOKEN/${STEAM_TOKEN_DUMPER_TOKEN}/g" "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs"; fi && \
dotnet publish "${STEAM_TOKEN_DUMPER_NAME}" -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}" -p:SelfContained=false -p:UseAppHost=false -r linux-arm64 --nologo && \
dotnet clean ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -p:SelfContained=false -p:UseAppHost=false -r linux-arm64 --nologo && \
dotnet publish ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/result" -p:ASFVariant=docker -p:SelfContained=false -p:UseAppHost=false -r linux-arm64 --nologo && \
dotnet publish "${STEAM_TOKEN_DUMPER_NAME}" -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}" -p:SelfContained=false -p:UseAppHost=false -r "linux-${ASF_ARCH}" --nologo && \
dotnet clean ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -p:SelfContained=false -p:UseAppHost=false -r "linux-${ASF_ARCH}" --nologo && \
dotnet publish ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/result" -p:ASFVariant=docker -p:SelfContained=false -p:UseAppHost=false -r "linux-${ASF_ARCH}" --nologo && \
if [ -d "ArchiSteamFarm/overlay/generic" ]; then cp "ArchiSteamFarm/overlay/generic/"* "out/result"; fi && \
if [ -f "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}/${STEAM_TOKEN_DUMPER_NAME}.dll" ]; then mkdir -p "out/result/plugins/${STEAM_TOKEN_DUMPER_NAME}"; cp "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}/${STEAM_TOKEN_DUMPER_NAME}.dll" "out/result/plugins/${STEAM_TOKEN_DUMPER_NAME}"; fi
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim-arm64v8 AS runtime
ARG DOTNET_ARCH=
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim${DOTNET_ARCH} AS runtime
ENV ASPNETCORE_URLS=
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE 1
@@ -38,6 +40,6 @@ LABEL maintainer="JustArchi <JustArchi@JustArchi.net>"
EXPOSE 1242
WORKDIR /app
COPY --from=build-dotnet /app/out/result .
VOLUME ["/app/config", "/app/logs", "/app/plugins"]
VOLUME ["/app/config", "/app/logs"]
HEALTHCHECK CMD ["pidof", "-q", "dotnet"]
ENTRYPOINT ["./ArchiSteamFarm.sh", "--no-restart", "--process-required", "--system-required"]

View File

@@ -7,6 +7,7 @@ RUN echo "node: $(node --version)" && \
npm run deploy
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-dotnet
ARG ASF_ARCH=x64
ARG STEAM_TOKEN_DUMPER_TOKEN
ENV CONFIGURATION Release
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
@@ -24,13 +25,14 @@ RUN dotnet --info && \
if [ -f "ArchiSteamFarm/Localization/Strings.zh-CN.resx" ]; then ln -s "Strings.zh-CN.resx" "ArchiSteamFarm/Localization/Strings.zh-Hans.resx"; fi && \
if [ -f "ArchiSteamFarm/Localization/Strings.zh-TW.resx" ]; then ln -s "Strings.zh-TW.resx" "ArchiSteamFarm/Localization/Strings.zh-Hant.resx"; fi && \
if [ -n "${STEAM_TOKEN_DUMPER_TOKEN-}" ] && [ -f "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs" ]; then sed -i "s/STEAM_TOKEN_DUMPER_TOKEN/${STEAM_TOKEN_DUMPER_TOKEN}/g" "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs"; fi && \
dotnet publish "${STEAM_TOKEN_DUMPER_NAME}" -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}" -p:SelfContained=false -p:UseAppHost=false -r linux-arm64 --nologo && \
dotnet clean ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -p:SelfContained=false -p:UseAppHost=false -r linux-arm64 --nologo && \
dotnet publish ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/result" -p:ASFVariant=linux-arm64 -p:PublishSingleFile=true -p:PublishTrimmed=true -r linux-arm64 --nologo && \
if [ -d "ArchiSteamFarm/overlay/linux-arm64" ]; then cp "ArchiSteamFarm/overlay/linux-arm64/"* "out/result"; fi && \
dotnet publish "${STEAM_TOKEN_DUMPER_NAME}" -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}" -p:SelfContained=false -p:UseAppHost=false -r "linux-${ASF_ARCH}" --nologo && \
dotnet clean ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -p:SelfContained=false -p:UseAppHost=false -r "linux-${ASF_ARCH}" --nologo && \
dotnet publish ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/result" "-p:ASFVariant=linux-${ASF_ARCH}" -p:PublishSingleFile=true -p:PublishTrimmed=true -r "linux-${ASF_ARCH}" --nologo && \
if [ -d "ArchiSteamFarm/overlay/linux-${ASF_ARCH}" ]; then cp "ArchiSteamFarm/overlay/linux-${ASF_ARCH}/"* "out/result"; fi && \
if [ -f "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}/${STEAM_TOKEN_DUMPER_NAME}.dll" ]; then mkdir -p "out/result/plugins/${STEAM_TOKEN_DUMPER_NAME}"; cp "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}/${STEAM_TOKEN_DUMPER_NAME}.dll" "out/result/plugins/${STEAM_TOKEN_DUMPER_NAME}"; fi
FROM mcr.microsoft.com/dotnet/core/runtime-deps:3.1-buster-slim-arm64v8 AS runtime
ARG DOTNET_ARCH=
FROM mcr.microsoft.com/dotnet/core/runtime-deps:3.1-buster-slim${DOTNET_ARCH} AS runtime
ENV ASPNETCORE_URLS=
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE 1
@@ -38,6 +40,6 @@ LABEL maintainer="JustArchi <JustArchi@JustArchi.net>"
EXPOSE 1242
WORKDIR /app
COPY --from=build-dotnet /app/out/result .
VOLUME ["/app/config", "/app/logs", "/app/plugins"]
VOLUME ["/app/config", "/app/logs"]
HEALTHCHECK CMD ["pidof", "-q", "ArchiSteamFarm"]
ENTRYPOINT ["./ArchiSteamFarm-Service.sh", "--no-restart", "--process-required", "--system-required"]

View File

@@ -1,43 +0,0 @@
FROM node:lts AS build-node
WORKDIR /app
COPY ASF-ui .
RUN echo "node: $(node --version)" && \
echo "npm: $(npm --version)" && \
npm ci && \
npm run deploy
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-dotnet
ARG STEAM_TOKEN_DUMPER_TOKEN
ENV CONFIGURATION Release
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE 1
ENV NET_CORE_VERSION netcoreapp3.1
ENV STEAM_TOKEN_DUMPER_NAME ArchiSteamFarm.OfficialPlugins.SteamTokenDumper
WORKDIR /app
COPY --from=build-node /app/dist ASF-ui/dist
COPY ArchiSteamFarm ArchiSteamFarm
COPY ArchiSteamFarm.OfficialPlugins.SteamTokenDumper ArchiSteamFarm.OfficialPlugins.SteamTokenDumper
COPY resources resources
COPY Directory.Build.props Directory.Build.props
RUN dotnet --info && \
# TODO: Remove workaround for https://github.com/microsoft/msbuild/issues/3897 when it's no longer needed
if [ -f "ArchiSteamFarm/Localization/Strings.zh-CN.resx" ]; then ln -s "Strings.zh-CN.resx" "ArchiSteamFarm/Localization/Strings.zh-Hans.resx"; fi && \
if [ -f "ArchiSteamFarm/Localization/Strings.zh-TW.resx" ]; then ln -s "Strings.zh-TW.resx" "ArchiSteamFarm/Localization/Strings.zh-Hant.resx"; fi && \
if [ -n "${STEAM_TOKEN_DUMPER_TOKEN-}" ] && [ -f "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs" ]; then sed -i "s/STEAM_TOKEN_DUMPER_TOKEN/${STEAM_TOKEN_DUMPER_TOKEN}/g" "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs"; fi && \
dotnet publish "${STEAM_TOKEN_DUMPER_NAME}" -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}" -p:SelfContained=false -p:UseAppHost=false -r linux-arm --nologo && \
dotnet clean ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -p:SelfContained=false -p:UseAppHost=false -r linux-arm --nologo && \
dotnet publish ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/result" -p:ASFVariant=linux-arm -p:PublishSingleFile=true -p:PublishTrimmed=true -r linux-arm --nologo && \
if [ -d "ArchiSteamFarm/overlay/linux-arm" ]; then cp "ArchiSteamFarm/overlay/linux-arm/"* "out/result"; fi && \
if [ -f "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}/${STEAM_TOKEN_DUMPER_NAME}.dll" ]; then mkdir -p "out/result/plugins/${STEAM_TOKEN_DUMPER_NAME}"; cp "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}/${STEAM_TOKEN_DUMPER_NAME}.dll" "out/result/plugins/${STEAM_TOKEN_DUMPER_NAME}"; fi
FROM mcr.microsoft.com/dotnet/core/runtime-deps:3.1-buster-slim-arm32v7 AS runtime
ENV ASPNETCORE_URLS=
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE 1
LABEL maintainer="JustArchi <JustArchi@JustArchi.net>"
EXPOSE 1242
WORKDIR /app
COPY --from=build-dotnet /app/out/result .
VOLUME ["/app/config", "/app/logs", "/app/plugins"]
HEALTHCHECK CMD ["pidof", "-q", "ArchiSteamFarm"]
ENTRYPOINT ["./ArchiSteamFarm-Service.sh", "--no-restart", "--process-required", "--system-required"]

View File

@@ -1,43 +0,0 @@
FROM node:lts AS build-node
WORKDIR /app
COPY ASF-ui .
RUN echo "node: $(node --version)" && \
echo "npm: $(npm --version)" && \
npm ci && \
npm run deploy
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-dotnet
ARG STEAM_TOKEN_DUMPER_TOKEN
ENV CONFIGURATION Release
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE 1
ENV NET_CORE_VERSION netcoreapp3.1
ENV STEAM_TOKEN_DUMPER_NAME ArchiSteamFarm.OfficialPlugins.SteamTokenDumper
WORKDIR /app
COPY --from=build-node /app/dist ASF-ui/dist
COPY ArchiSteamFarm ArchiSteamFarm
COPY ArchiSteamFarm.OfficialPlugins.SteamTokenDumper ArchiSteamFarm.OfficialPlugins.SteamTokenDumper
COPY resources resources
COPY Directory.Build.props Directory.Build.props
RUN dotnet --info && \
# TODO: Remove workaround for https://github.com/microsoft/msbuild/issues/3897 when it's no longer needed
if [ -f "ArchiSteamFarm/Localization/Strings.zh-CN.resx" ]; then ln -s "Strings.zh-CN.resx" "ArchiSteamFarm/Localization/Strings.zh-Hans.resx"; fi && \
if [ -f "ArchiSteamFarm/Localization/Strings.zh-TW.resx" ]; then ln -s "Strings.zh-TW.resx" "ArchiSteamFarm/Localization/Strings.zh-Hant.resx"; fi && \
if [ -n "${STEAM_TOKEN_DUMPER_TOKEN-}" ] && [ -f "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs" ]; then sed -i "s/STEAM_TOKEN_DUMPER_TOKEN/${STEAM_TOKEN_DUMPER_TOKEN}/g" "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs"; fi && \
dotnet publish "${STEAM_TOKEN_DUMPER_NAME}" -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}" -p:SelfContained=false -p:UseAppHost=false -r linux-x64 --nologo && \
dotnet clean ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -p:SelfContained=false -p:UseAppHost=false -r linux-x64 --nologo && \
dotnet publish ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/result" -p:ASFVariant=linux-x64 -p:PublishSingleFile=true -p:PublishTrimmed=true -r linux-x64 --nologo && \
if [ -d "ArchiSteamFarm/overlay/linux-x64" ]; then cp "ArchiSteamFarm/overlay/linux-x64/"* "out/result"; fi && \
if [ -f "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}/${STEAM_TOKEN_DUMPER_NAME}.dll" ]; then mkdir -p "out/result/plugins/${STEAM_TOKEN_DUMPER_NAME}"; cp "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}/${STEAM_TOKEN_DUMPER_NAME}.dll" "out/result/plugins/${STEAM_TOKEN_DUMPER_NAME}"; fi
FROM mcr.microsoft.com/dotnet/core/runtime-deps:3.1-buster-slim AS runtime
ENV ASPNETCORE_URLS=
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE 1
LABEL maintainer="JustArchi <JustArchi@JustArchi.net>"
EXPOSE 1242
WORKDIR /app
COPY --from=build-dotnet /app/out/result .
VOLUME ["/app/config", "/app/logs", "/app/plugins"]
HEALTHCHECK CMD ["pidof", "-q", "ArchiSteamFarm"]
ENTRYPOINT ["./ArchiSteamFarm-Service.sh", "--no-restart", "--process-required", "--system-required"]

View File

@@ -1,43 +0,0 @@
FROM node:lts AS build-node
WORKDIR /app
COPY ASF-ui .
RUN echo "node: $(node --version)" && \
echo "npm: $(npm --version)" && \
npm ci && \
npm run deploy
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-dotnet
ARG STEAM_TOKEN_DUMPER_TOKEN
ENV CONFIGURATION Release
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE 1
ENV NET_CORE_VERSION netcoreapp3.1
ENV STEAM_TOKEN_DUMPER_NAME ArchiSteamFarm.OfficialPlugins.SteamTokenDumper
WORKDIR /app
COPY --from=build-node /app/dist ASF-ui/dist
COPY ArchiSteamFarm ArchiSteamFarm
COPY ArchiSteamFarm.OfficialPlugins.SteamTokenDumper ArchiSteamFarm.OfficialPlugins.SteamTokenDumper
COPY resources resources
COPY Directory.Build.props Directory.Build.props
RUN dotnet --info && \
# TODO: Remove workaround for https://github.com/microsoft/msbuild/issues/3897 when it's no longer needed
if [ -f "ArchiSteamFarm/Localization/Strings.zh-CN.resx" ]; then ln -s "Strings.zh-CN.resx" "ArchiSteamFarm/Localization/Strings.zh-Hans.resx"; fi && \
if [ -f "ArchiSteamFarm/Localization/Strings.zh-TW.resx" ]; then ln -s "Strings.zh-TW.resx" "ArchiSteamFarm/Localization/Strings.zh-Hant.resx"; fi && \
if [ -n "${STEAM_TOKEN_DUMPER_TOKEN-}" ] && [ -f "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs" ]; then sed -i "s/STEAM_TOKEN_DUMPER_TOKEN/${STEAM_TOKEN_DUMPER_TOKEN}/g" "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs"; fi && \
dotnet publish "${STEAM_TOKEN_DUMPER_NAME}" -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}" -p:SelfContained=false -p:UseAppHost=false -r linux-arm --nologo && \
dotnet clean ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -p:SelfContained=false -p:UseAppHost=false -r linux-arm --nologo && \
dotnet publish ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/result" -p:ASFVariant=docker -p:SelfContained=false -p:UseAppHost=false -r linux-arm --nologo && \
if [ -d "ArchiSteamFarm/overlay/generic" ]; then cp "ArchiSteamFarm/overlay/generic/"* "out/result"; fi && \
if [ -f "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}/${STEAM_TOKEN_DUMPER_NAME}.dll" ]; then mkdir -p "out/result/plugins/${STEAM_TOKEN_DUMPER_NAME}"; cp "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}/${STEAM_TOKEN_DUMPER_NAME}.dll" "out/result/plugins/${STEAM_TOKEN_DUMPER_NAME}"; fi
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim-arm32v7 AS runtime
ENV ASPNETCORE_URLS=
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE 1
LABEL maintainer="JustArchi <JustArchi@JustArchi.net>"
EXPOSE 1242
WORKDIR /app
COPY --from=build-dotnet /app/out/result .
VOLUME ["/app/config", "/app/logs", "/app/plugins"]
HEALTHCHECK CMD ["pidof", "-q", "dotnet"]
ENTRYPOINT ["./ArchiSteamFarm.sh", "--no-restart", "--process-required", "--system-required"]

View File

@@ -1,43 +0,0 @@
FROM node:lts AS build-node
WORKDIR /app
COPY ASF-ui .
RUN echo "node: $(node --version)" && \
echo "npm: $(npm --version)" && \
npm ci && \
npm run deploy
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-dotnet
ARG STEAM_TOKEN_DUMPER_TOKEN
ENV CONFIGURATION Release
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE 1
ENV NET_CORE_VERSION netcoreapp3.1
ENV STEAM_TOKEN_DUMPER_NAME ArchiSteamFarm.OfficialPlugins.SteamTokenDumper
WORKDIR /app
COPY --from=build-node /app/dist ASF-ui/dist
COPY ArchiSteamFarm ArchiSteamFarm
COPY ArchiSteamFarm.OfficialPlugins.SteamTokenDumper ArchiSteamFarm.OfficialPlugins.SteamTokenDumper
COPY resources resources
COPY Directory.Build.props Directory.Build.props
RUN dotnet --info && \
# TODO: Remove workaround for https://github.com/microsoft/msbuild/issues/3897 when it's no longer needed
if [ -f "ArchiSteamFarm/Localization/Strings.zh-CN.resx" ]; then ln -s "Strings.zh-CN.resx" "ArchiSteamFarm/Localization/Strings.zh-Hans.resx"; fi && \
if [ -f "ArchiSteamFarm/Localization/Strings.zh-TW.resx" ]; then ln -s "Strings.zh-TW.resx" "ArchiSteamFarm/Localization/Strings.zh-Hant.resx"; fi && \
if [ -n "${STEAM_TOKEN_DUMPER_TOKEN-}" ] && [ -f "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs" ]; then sed -i "s/STEAM_TOKEN_DUMPER_TOKEN/${STEAM_TOKEN_DUMPER_TOKEN}/g" "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs"; fi && \
dotnet publish "${STEAM_TOKEN_DUMPER_NAME}" -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}" -p:SelfContained=false -p:UseAppHost=false -r linux-x64 --nologo && \
dotnet clean ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -p:SelfContained=false -p:UseAppHost=false -r linux-x64 --nologo && \
dotnet publish ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/result" -p:ASFVariant=docker -p:SelfContained=false -p:UseAppHost=false -r linux-x64 --nologo && \
if [ -d "ArchiSteamFarm/overlay/generic" ]; then cp "ArchiSteamFarm/overlay/generic/"* "out/result"; fi && \
if [ -f "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}/${STEAM_TOKEN_DUMPER_NAME}.dll" ]; then mkdir -p "out/result/plugins/${STEAM_TOKEN_DUMPER_NAME}"; cp "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}/${STEAM_TOKEN_DUMPER_NAME}.dll" "out/result/plugins/${STEAM_TOKEN_DUMPER_NAME}"; fi
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS runtime
ENV ASPNETCORE_URLS=
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE 1
LABEL maintainer="JustArchi <JustArchi@JustArchi.net>"
EXPOSE 1242
WORKDIR /app
COPY --from=build-dotnet /app/out/result .
VOLUME ["/app/config", "/app/logs", "/app/plugins"]
HEALTHCHECK CMD ["pidof", "-q", "dotnet"]
ENTRYPOINT ["./ArchiSteamFarm.sh", "--no-restart", "--process-required", "--system-required"]

View File

@@ -127,7 +127,7 @@ build_script:
}
dotnet build ArchiSteamFarm.OfficialPlugins.SteamTokenDumper -c "$env:CONFIGURATION" -p:UseAppHost=false --nologo
dotnet build "$env:STEAM_TOKEN_DUMPER_NAME" -c "$env:CONFIGURATION" -p:UseAppHost=false --nologo
if ($LastExitCode -ne 0) {
@@ -157,8 +157,8 @@ after_test:
$ProgressPreference = 'SilentlyContinue'
if ((Test-Path env:STEAM_TOKEN_DUMPER_TOKEN) -and (Test-Path 'ArchiSteamFarm.OfficialPlugins.SteamTokenDumper\SharedInfo.cs' -PathType Leaf)) {
(Get-Content 'ArchiSteamFarm.OfficialPlugins.SteamTokenDumper\SharedInfo.cs').Replace('STEAM_TOKEN_DUMPER_TOKEN', "$env:STEAM_TOKEN_DUMPER_TOKEN") | Set-Content 'ArchiSteamFarm.OfficialPlugins.SteamTokenDumper\SharedInfo.cs'
if ((Test-Path env:STEAM_TOKEN_DUMPER_TOKEN) -and (Test-Path "$env:STEAM_TOKEN_DUMPER_NAME\SharedInfo.cs" -PathType Leaf)) {
(Get-Content "$env:STEAM_TOKEN_DUMPER_NAME\SharedInfo.cs").Replace('STEAM_TOKEN_DUMPER_TOKEN', "$env:STEAM_TOKEN_DUMPER_TOKEN") | Set-Content "$env:STEAM_TOKEN_DUMPER_NAME\SharedInfo.cs"
}

21
cc.sh
View File

@@ -4,10 +4,13 @@ set -eu
TARGET_FRAMEWORK="netcoreapp3.1"
MAIN_PROJECT="ArchiSteamFarm"
STEAM_TOKEN_DUMPER_NAME="${MAIN_PROJECT}.OfficialPlugins.SteamTokenDumper"
TESTS_PROJECT="${MAIN_PROJECT}.Tests"
SOLUTION="${MAIN_PROJECT}.sln"
CONFIGURATION="Release"
OUT="out"
OUT_ASF="${OUT}/result"
OUT_STD="${OUT}/${STEAM_TOKEN_DUMPER_NAME}"
ASF_UI=1
CLEAN=0
@@ -88,7 +91,7 @@ if [ "$ASF_UI" -eq 1 ]; then
npm run-script deploy --no-progress --prefix ASF-ui
# ASF's output www folder needs cleaning as well
rm -rf "${OUT}/www"
rm -rf "${OUT_ASF}/www"
else
echo "WARNING: ASF-ui dependencies are missing, skipping build of ASF-ui..."
fi
@@ -109,7 +112,21 @@ if [ "$TEST" -eq 1 ]; then
dotnet test "$TESTS_PROJECT" $DOTNET_FLAGS
fi
dotnet publish "$MAIN_PROJECT" -o "$OUT" $DOTNET_FLAGS
dotnet publish "$MAIN_PROJECT" -o "$OUT_ASF" $DOTNET_FLAGS
if [ -n "${STEAM_TOKEN_DUMPER_TOKEN-}" ] && [ -f "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs" ]; then
git checkout -- "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs"
sed "s/STEAM_TOKEN_DUMPER_TOKEN/${STEAM_TOKEN_DUMPER_TOKEN}/g" "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs" > "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs.new";
mv "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs.new" "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs"
dotnet publish "$STEAM_TOKEN_DUMPER_NAME" -o "$OUT_STD" $DOTNET_FLAGS
git checkout -- "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs"
mkdir -p "${OUT_ASF}/plugins/${STEAM_TOKEN_DUMPER_NAME}"
cp "${OUT_STD}/${STEAM_TOKEN_DUMPER_NAME}.dll" "${OUT_ASF}/plugins/${STEAM_TOKEN_DUMPER_NAME}"
else
echo "WARNING: STEAM_TOKEN_DUMPER_TOKEN is missing, skipping build of ${STEAM_TOKEN_DUMPER_NAME}..."
fi
echo
echo "SUCCESS: Compilation finished successfully! :)"

14
hooks/build Normal file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env sh
# This hook is used by Docker Hub as an instruction on how to build the ASF release
# See: https://docs.docker.com/docker-hub/builds/advanced
set -eu
asf_arch="$(echo "$DOCKER_TAG" | cut -d '-' -f 2)"
case "$asf_arch" in
"arm") dotnet_arch="-arm32v7" ;;
"arm64") dotnet_arch="-arm64v8" ;;
*) dotnet_arch=""; asf_arch="x64" ;;
esac
docker build -f "$DOCKERFILE_PATH" -t "$IMAGE_NAME" --build-arg "STEAM_TOKEN_DUMPER_TOKEN=${STEAM_TOKEN_DUMPER_TOKEN-}" --build-arg "ASF_ARCH=${asf_arch}" --build-arg "DOTNET_ARCH=${dotnet_arch}" .

18
run.sh
View File

@@ -1,20 +1,20 @@
#!/usr/bin/env sh
set -eu
BINARY_PATH="$(dirname "$(readlink -f "$0")")/out"
BINARY_DIR="$(dirname "$(readlink -f "$0")")/out/result"
CONFIG_PATH="config/ASF.json"
if [ ! -d "$BINARY_PATH" ]; then
echo "ERROR: $BINARY_PATH could not be found!"
if [ ! -d "$BINARY_DIR" ]; then
echo "ERROR: $BINARY_DIR could not be found!"
exit 1
fi
cd "$BINARY_PATH"
cd "$BINARY_DIR"
BINARY="$(pwd)/ArchiSteamFarm.dll"
BINARY_PATH="$(pwd)/ArchiSteamFarm.dll"
if [ ! -f "$BINARY" ]; then
echo "ERROR: $BINARY could not be found!"
if [ ! -f "$BINARY_PATH" ]; then
echo "ERROR: $BINARY_PATH could not be found!"
exit 1
fi
@@ -74,9 +74,9 @@ dotnet --info
if [ -f "$CONFIG_PATH" ] && grep -Eq '"Headless":\s+?true' "$CONFIG_PATH"; then
# We're running ASF in headless mode so we don't need STDIN
dotnet "$BINARY" $BINARY_ARGS & # Start ASF in the background, trap will work properly due to non-blocking call
dotnet "$BINARY_PATH" $BINARY_ARGS & # Start ASF in the background, trap will work properly due to non-blocking call
wait $! # This will forward dotnet error code, set -e will abort the script if it's non-zero
else
# We're running ASF in non-headless mode, so we need STDIN to be operative
dotnet "$BINARY" $BINARY_ARGS # Start ASF in the foreground, trap won't work until process exit
dotnet "$BINARY_PATH" $BINARY_ARGS # Start ASF in the foreground, trap won't work until process exit
fi

2
wiki

Submodule wiki updated: b825f6ddbb...93cf188ae6