Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ For dev or build tags, use the same logical version string embedded in the tag.

## [Unreleased]

- Soulseek obfuscation configuration now rejects disabling regular-port
advertisement before runtime construction instead of terminating during
application startup.
- The web footer and README now offer direct PayPal and Ko-fi links for
supporting slskdN development.
- GitLab CI configuration now keeps the Arch package-smoke sudoers command as
Expand Down
7 changes: 7 additions & 0 deletions src/slskd/Core/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2707,6 +2707,13 @@ public IEnumerable<ValidationResult> Validate(ValidationContext validationContex
[nameof(ListenPort)]));
}

if (Enabled && !AdvertiseRegularPort)
{
results.Add(new ValidationResult(
"Soulseek obfuscation requires the regular peer port to remain advertised for legacy compatibility.",
[nameof(AdvertiseRegularPort)]));
}

if (Enabled && mode == SoulseekObfuscationMode.Only)
{
results.Add(new ValidationResult(
Expand Down
25 changes: 25 additions & 0 deletions tests/slskd.Tests.Unit/SoulseekOptionsValidationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,31 @@ public void Options_RejectsObfuscationOnlyModeWithRegularFallback()
AssertRejectsUnsupportedOnlyMode(results);
}

[Fact]
public void Options_RejectsEnabledObfuscationWithoutRegularPortAdvertisement()
{
var options = new Options
{
Soulseek = new Options.SoulseekOptions
{
Obfuscation = new Options.SoulseekOptions.ObfuscationOptions
{
Enabled = true,
Mode = SoulseekObfuscationMode.Compatibility.ToString(),
AdvertiseRegularPort = false,
},
},
};

var results = options.Validate(new ValidationContext(options)).ToList();

Assert.Contains(
results,
result => result.ErrorMessage!.Contains(
"regular peer port to remain advertised",
System.StringComparison.Ordinal));
}

[Fact]
public void SoulseekObfuscationPlan_ReportsConfiguredActiveRuntime()
{
Expand Down
Loading