Skip to content

Commit

Permalink
Merge branch 'main' into monitor-incoming-trades
Browse files Browse the repository at this point in the history
  • Loading branch information
Abrynos committed May 4, 2024
2 parents 0e430dd + 1988b18 commit c82463f
Show file tree
Hide file tree
Showing 54 changed files with 14 additions and 589 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
show-progress: false

- name: Run Qodana scan
uses: JetBrains/[email protected].1
uses: JetBrains/[email protected].3
with:
args: --config,.github/qodana.yaml,--property=idea.headless.enable.statistics=false
pr-mode: false
Expand All @@ -33,6 +33,6 @@ jobs:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}

- name: Report Qodana results to GitHub
uses: github/codeql-action/[email protected].2
uses: github/codeql-action/[email protected].3
with:
sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json
9 changes: 3 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -479,15 +479,12 @@ jobs:

- name: Generate SHA-512 checksums and signature
shell: sh
working-directory: out
run: |
set -eu
(
cd "out"
sha512sum *.zip > SHA512SUMS
gpg -a -b -o SHA512SUMS.sign SHA512SUMS
)
sha512sum *.zip > SHA512SUMS
gpg -a -b -o SHA512SUMS.sign SHA512SUMS
- name: Upload SHA512SUMS
uses: actions/[email protected]
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ jobs:

- name: Reset wiki to follow origin
shell: sh
working-directory: wiki
run: |
set -eu
cd wiki
git fetch --depth=1 origin master
git reset --hard origin/master
Expand All @@ -52,11 +51,10 @@ jobs:

- name: Commit the changes to wiki
shell: sh
working-directory: wiki
run: |
set -eu
cd wiki
git add -A "locale"
if ! git diff --cached --quiet; then
Expand Down
2 changes: 1 addition & 1 deletion ASF-ui
82 changes: 0 additions & 82 deletions ArchiSteamFarm.Tests/Utilities.cs

This file was deleted.

1 change: 0 additions & 1 deletion ArchiSteamFarm/ArchiSteamFarm.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<PackageReference Include="System.Composition" />
<PackageReference Include="System.Linq.Async" />
<PackageReference Include="System.Security.Cryptography.ProtectedData" />
<PackageReference Include="zxcvbn-core" />
</ItemGroup>

<ItemGroup>
Expand Down
38 changes: 0 additions & 38 deletions ArchiSteamFarm/Core/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
using JetBrains.Annotations;
using Microsoft.IdentityModel.JsonWebTokens;
using SteamKit2;
using Zxcvbn;

namespace ArchiSteamFarm.Core;

Expand All @@ -57,9 +56,6 @@ public static class Utilities {

private static readonly FrozenSet<char> DirectorySeparators = new HashSet<char>(2) { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }.ToFrozenSet();

// normally we'd just use words like "steam" and "farm", but the library we're currently using is a bit iffy about banned words, so we need to also add combinations such as "steamfarm"
private static readonly FrozenSet<string> ForbiddenPasswordPhrases = new HashSet<string>(10, StringComparer.OrdinalIgnoreCase) { "archisteamfarm", "archi", "steam", "farm", "archisteam", "archifarm", "steamfarm", "asf", "asffarm", "password" }.ToFrozenSet(StringComparer.OrdinalIgnoreCase);

[PublicAPI]
public static string GenerateChecksumFor(byte[] source) {
ArgumentNullException.ThrowIfNull(source);
Expand Down Expand Up @@ -293,40 +289,6 @@ internal static void OnProgressChanged(string fileName, byte progressPercentage)
ASF.ArchiLogger.LogGenericDebug($"{fileName} {progressPercentage}%...");
}

internal static (bool IsWeak, string? Reason) TestPasswordStrength(string password, IEnumerable<string>? additionallyForbiddenPhrases = null) {
ArgumentException.ThrowIfNullOrEmpty(password);

HashSet<string> forbiddenPhrases = ForbiddenPasswordPhrases.ToHashSet(StringComparer.OrdinalIgnoreCase);

if (additionallyForbiddenPhrases != null) {
forbiddenPhrases.UnionWith(additionallyForbiddenPhrases);
}

Result result = Zxcvbn.Core.EvaluatePassword(password, forbiddenPhrases);

IList<string>? suggestions = result.Feedback.Suggestions;

if (!string.IsNullOrEmpty(result.Feedback.Warning)) {
suggestions ??= new List<string>(1);

suggestions.Insert(0, result.Feedback.Warning);
}

if (suggestions != null) {
for (byte i = 0; i < suggestions.Count; i++) {
string suggestion = suggestions[i];

if ((suggestion.Length == 0) || (suggestion[^1] == '.')) {
continue;
}

suggestions[i] = $"{suggestion}.";
}
}

return (result.Score < 4, suggestions is { Count: > 0 } ? string.Join(' ', suggestions.Where(static suggestion => suggestion.Length > 0)) : null);
}

internal static async Task<bool> UpdateCleanup(string targetDirectory) {
ArgumentException.ThrowIfNullOrEmpty(targetDirectory);

Expand Down
13 changes: 0 additions & 13 deletions ArchiSteamFarm/Helpers/ArchiCryptoHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
// limitations under the License.

using System;
using System.Collections.Frozen;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
Expand All @@ -47,8 +46,6 @@ public static class ArchiCryptoHelper {

internal static bool HasDefaultCryptKey { get; private set; } = true;

private static readonly FrozenSet<string> ForbiddenCryptKeyPhrases = new HashSet<string>(3, StringComparer.OrdinalIgnoreCase) { "crypt", "key", "cryptkey" }.ToFrozenSet(StringComparer.OrdinalIgnoreCase);

private static IEnumerable<byte> SteamParentalCharacters => Enumerable.Range('0', 10).Select(static character => (byte) character);

private static IEnumerable<byte[]> SteamParentalCodes {
Expand Down Expand Up @@ -179,16 +176,6 @@ internal static void SetEncryptionKey(string key) {
return;
}

Utilities.InBackground(
() => {
(bool isWeak, string? reason) = Utilities.TestPasswordStrength(key, ForbiddenCryptKeyPhrases);

if (isWeak) {
ASF.ArchiLogger.LogGenericWarning(string.Format(CultureInfo.CurrentCulture, Strings.WarningWeakCryptKey, reason));
}
}
);

byte[] encryptionKey = Encoding.UTF8.GetBytes(key);

if (encryptionKey.Length < MinimumRecommendedCryptKeyBytes) {
Expand Down
18 changes: 0 additions & 18 deletions ArchiSteamFarm/Localization/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions ArchiSteamFarm/Localization/Strings.be-BY.resx
Original file line number Diff line number Diff line change
Expand Up @@ -552,9 +552,6 @@ StackTrace:






<data name="PatchingFiles" xml:space="preserve">
<value>Выпраўленне файлаў ASF...</value>
</data>
Expand Down
12 changes: 0 additions & 12 deletions ArchiSteamFarm/Localization/Strings.bg-BG.resx
Original file line number Diff line number Diff line change
Expand Up @@ -684,18 +684,6 @@
<value>{0} config file ще бъде прехвърлен на последния синтаксис...</value>
<comment>{0} will be replaced with the relative path to the affected config file</comment>
</data>
<data name="WarningWeakIPCPassword" xml:space="preserve">
<value>Вашата IPC парола изглежда много слаба. Помислете за избиране на по-сложна за увеличаване на сигурността. Детайли: {0}</value>
<comment>{0} will be replaced by additional details about the password being considered weak</comment>
</data>
<data name="WarningWeakSteamPassword" xml:space="preserve">
<value>Вашата Steam парола за {0} изглежда много слаба. Помислете за избиране на по-сложна за увеличаване на сигурността. Детайли: {1}</value>
<comment>{0} will be replaced by the affected bot name, {1} will be replaced by additional details about the password being considered weak</comment>
</data>
<data name="WarningWeakCryptKey" xml:space="preserve">
<value>Вашият криптиращ ключ изглежда много слаб. Помислете за избиране на по-сложна за увеличаване на сигурността. Детайли: {0}</value>
<comment>{0} will be replaced by additional details about the encryption key being considered weak</comment>
</data>
<data name="WarningTooShortCryptKey" xml:space="preserve">
<value>Вашият криптиращ ключ е много къс. Препоръчваме да ползвате някой, който е поне {0} байта (символа) голям.</value>
<comment>{0} will be replaced by the number of bytes (characters) recommended</comment>
Expand Down
3 changes: 0 additions & 3 deletions ArchiSteamFarm/Localization/Strings.bs-Latn.resx
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,6 @@









Expand Down
12 changes: 0 additions & 12 deletions ArchiSteamFarm/Localization/Strings.cs-CZ.resx
Original file line number Diff line number Diff line change
Expand Up @@ -687,18 +687,6 @@ StackTrace:
<value>{0} konfigurační soubor bude převeden na nejnovější syntaxi...</value>
<comment>{0} will be replaced with the relative path to the affected config file</comment>
</data>
<data name="WarningWeakIPCPassword" xml:space="preserve">
<value>Vaše IPC heslo se zdá být slabé. Zvažte výběr silnějšího hesla pro zvýšení bezpečnosti. Detaily: {0}</value>
<comment>{0} will be replaced by additional details about the password being considered weak</comment>
</data>
<data name="WarningWeakSteamPassword" xml:space="preserve">
<value>Vaše Steam heslo pro '{0}' se zdá být slabé. Pro větší zabezpečení zvažte změnu hesla na silnější variantu. Detaily: {1}</value>
<comment>{0} will be replaced by the affected bot name, {1} will be replaced by additional details about the password being considered weak</comment>
</data>
<data name="WarningWeakCryptKey" xml:space="preserve">
<value>Váš šifrovací klíč se zdá být slabý. Zvažte výběr silnější varianty pro zvýšení bezpečnosti. Detaily: {0}</value>
<comment>{0} will be replaced by additional details about the encryption key being considered weak</comment>
</data>
<data name="WarningTooShortCryptKey" xml:space="preserve">
<value>Váš šifrovací klíč je příliš krátký. Doporučujeme použít ten, který je alespoň {0} bajtů (znaků) dlouhý.</value>
<comment>{0} will be replaced by the number of bytes (characters) recommended</comment>
Expand Down
3 changes: 0 additions & 3 deletions ArchiSteamFarm/Localization/Strings.da-DK.resx
Original file line number Diff line number Diff line change
Expand Up @@ -652,9 +652,6 @@ Processens oppetid: {1}</value>






<data name="WarningRunningAsRoot" xml:space="preserve">
<value>Du forsøger at køre ASF som administrator (root). Dette medfører en betydelig sikkerhedsrisiko for din maskine, og da ASF ikke kræver root-adgang for dens drift, vi anbefaler at køre det som ikke-administrator bruger hvis det er muligt.</value>
</data>
Expand Down
12 changes: 0 additions & 12 deletions ArchiSteamFarm/Localization/Strings.de-DE.resx
Original file line number Diff line number Diff line change
Expand Up @@ -691,18 +691,6 @@ Prozesslaufzeit: {1}</value>
<value>Die Konfigurationsdatei {0} wird zur neuesten Version migriert...</value>
<comment>{0} will be replaced with the relative path to the affected config file</comment>
</data>
<data name="WarningWeakIPCPassword" xml:space="preserve">
<value>Ihr IPC-Passwort scheint schwach zu sein. Für erhöhte Sicherheit sollten Sie überlegen, ein Stärkeres auszusuchen. Details: {0} Ihr</value>
<comment>{0} will be replaced by additional details about the password being considered weak</comment>
</data>
<data name="WarningWeakSteamPassword" xml:space="preserve">
<value>Ihr Steam-Passwort für '{0}' scheint schwach zu sein. Für erhöhte Sicherheit sollten Sie überlegen, ein Stärkeres auszusuchen. Details: {1}</value>
<comment>{0} will be replaced by the affected bot name, {1} will be replaced by additional details about the password being considered weak</comment>
</data>
<data name="WarningWeakCryptKey" xml:space="preserve">
<value>Ihr kryptografischer Schlüssel scheint schwach zu sein. Für erhöhte Sicherheit sollten Sie überlegen, einen Stärkeren auszusuchen. Details: {0}</value>
<comment>{0} will be replaced by additional details about the encryption key being considered weak</comment>
</data>
<data name="WarningTooShortCryptKey" xml:space="preserve">
<value>Ihr kryptografischer Schlüssel ist zu kurz. Wir empfehlen einen zu verwenden, der mindestens {0} Bytes (Zeichen) lang ist.</value>
<comment>{0} will be replaced by the number of bytes (characters) recommended</comment>
Expand Down
12 changes: 0 additions & 12 deletions ArchiSteamFarm/Localization/Strings.el-GR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -687,18 +687,6 @@ StackTrace:
<value>{0} αρχείο ρυθμίσεων θα μεταφερθεί στην τελευταία σύνταξη...</value>
<comment>{0} will be replaced with the relative path to the affected config file</comment>
</data>
<data name="WarningWeakIPCPassword" xml:space="preserve">
<value>Ο κωδικός πρόσβασης IPC φαίνεται να είναι αδύναμος. Εξετάστε το ενδεχόμενο να επιλέξετε έναν ισχυρότερο για αυξημένη ασφάλεια. Λεπτομέρειες: {0}</value>
<comment>{0} will be replaced by additional details about the password being considered weak</comment>
</data>
<data name="WarningWeakSteamPassword" xml:space="preserve">
<value>Ο κωδικός πρόσβασης Steam για το '{0}' φαίνεται να είναι αδύναμος. Εξετάστε το ενδεχόμενο να επιλέξετε έναν ισχυρότερο για αυξημένη ασφάλεια. Λεπτομέρειες: {1}</value>
<comment>{0} will be replaced by the affected bot name, {1} will be replaced by additional details about the password being considered weak</comment>
</data>
<data name="WarningWeakCryptKey" xml:space="preserve">
<value>Το κλειδί κρυπτογράφησής σας φαίνεται να είναι αδύναμο. Εξετάστε το ενδεχόμενο να επιλέξετε ένα ισχυρότερο για αυξημένη ασφάλεια. Λεπτομέρειες: {0}</value>
<comment>{0} will be replaced by additional details about the encryption key being considered weak</comment>
</data>
<data name="WarningTooShortCryptKey" xml:space="preserve">
<value>Το κλειδί κρυπτογράφησης σας είναι πολύ μικρό. Σας συνιστούμε να χρησιμοποιήσετε ένα που είναι τουλάχιστον {0} bytes (χαρακτήρες).</value>
<comment>{0} will be replaced by the number of bytes (characters) recommended</comment>
Expand Down
12 changes: 0 additions & 12 deletions ArchiSteamFarm/Localization/Strings.es-ES.resx
Original file line number Diff line number Diff line change
Expand Up @@ -689,18 +689,6 @@ Tiempo de actividad del proceso: {1}</value>
<value>El archivo de configuración {0} será migrado a la sintaxis más reciente...</value>
<comment>{0} will be replaced with the relative path to the affected config file</comment>
</data>
<data name="WarningWeakIPCPassword" xml:space="preserve">
<value>Parece que tu contraseña IPC es débil. Considera elegir una más fuerte para mayor seguridad. Detalles: {0}</value>
<comment>{0} will be replaced by additional details about the password being considered weak</comment>
</data>
<data name="WarningWeakSteamPassword" xml:space="preserve">
<value>Parece que tu contraseña de Steam para '{0}' es débil. Considera elegir una más fuerte para mayor seguridad. Detalles: {1}</value>
<comment>{0} will be replaced by the affected bot name, {1} will be replaced by additional details about the password being considered weak</comment>
</data>
<data name="WarningWeakCryptKey" xml:space="preserve">
<value>Parece que tu clave de cifrado es débil. Considera elegir una más fuerte para mayor seguridad. Detalles: {0}</value>
<comment>{0} will be replaced by additional details about the encryption key being considered weak</comment>
</data>
<data name="WarningTooShortCryptKey" xml:space="preserve">
<value>Tu clave de cifrado es muy corta. Recomendamos usar una que tenga al menos {0} bytes (caracteres) de largo.</value>
<comment>{0} will be replaced by the number of bytes (characters) recommended</comment>
Expand Down
Loading

0 comments on commit c82463f

Please sign in to comment.