diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-10-31 19:52:59 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-10-31 19:52:59 -0500 |
| commit | cbd03ff1adc5d703a2023ae9532b3001542c0c2d (patch) | |
| tree | f86be6c9790273ca64ba59376de3b2b26c4879b0 /src/slskd/Core/Options.cs | |
| parent | 926446c443afca46b853a0b8f5fa85297b56ede2 (diff) | |
| parent | 2e127575c5231ea94a2f327084c5da29b8a9e895 (diff) | |
| download | slskd-cbd03ff1adc5d703a2023ae9532b3001542c0c2d.tar.gz | |
Merge branch 'bugs' of github.com:slskd/slskd into bugs
Diffstat (limited to 'src/slskd/Core/Options.cs')
| -rw-r--r-- | src/slskd/Core/Options.cs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs index 05eaed57..1f6ceac2 100644 --- a/src/slskd/Core/Options.cs +++ b/src/slskd/Core/Options.cs @@ -1453,6 +1453,7 @@ namespace slskd [EnvironmentVariable("LOKI")] [Description("optional; url to a Grafana Loki instance to which to log")] [RequiresRestart] + [Secret] public string Loki { get; init; } = null; /// <summary> @@ -2185,9 +2186,12 @@ namespace slskd { var role = tuple.Split('=').LastOrDefault(); - if (!Enum.TryParse(typeof(Role), value: role, ignoreCase: true, out _)) + var roleResult = new EnumAttribute(typeof(Role), ignoreCase: true) + .GetValidationResult(role, new ValidationContext(this) { MemberName = nameof(ApiKey), DisplayName = "API key role" }); + + if (roleResult != ValidationResult.Success) { - results.Add(new ValidationResult($"API key role must be one of: {string.Join(", ", Enum.GetNames(typeof(Role)))}")); + results.Add(new ValidationResult(roleResult.ErrorMessage)); } } else if (tuple.StartsWith("cidr=", StringComparison.OrdinalIgnoreCase)) @@ -2242,7 +2246,7 @@ namespace slskd [Argument(default, "jwt-ttl")] [EnvironmentVariable("JWT_TTL")] [Description("TTL for JWTs")] - [Range(3600, int.MaxValue)] + [Range(3600000, int.MaxValue)] [RequiresRestart] public int Ttl { get; init; } = 604800000; } @@ -2572,6 +2576,7 @@ namespace slskd /// Gets the fully qualified URL for the webhook. /// </summary> [NotNullOrWhiteSpace] + [Secret] public string Url { get; init; } /// <summary> @@ -2608,6 +2613,7 @@ namespace slskd /// <summary> /// Gets the header's value. /// </summary> + [Secret] public string Value { get; init; } } @@ -2648,6 +2654,7 @@ namespace slskd /// <summary> /// Gets the shell command to run. /// </summary> + [Secret] public string Command { get; init; } /// <summary> @@ -2661,6 +2668,7 @@ namespace slskd /// <remarks> /// Mutually exclusive with <see cref="Arglist"/>. /// </remarks> + [Secret] public string Args { get; init; } /// <summary> |
