From 6f652112800cc3de11c1ce0eaca3162b2179d02b Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 9 May 2024 22:30:17 -0500 Subject: docs, remove umask --- src/slskd/Core/Options.cs | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs index 3fef8a94..81e73403 100644 --- a/src/slskd/Core/Options.cs +++ b/src/slskd/Core/Options.cs @@ -613,22 +613,30 @@ namespace slskd /// public class FilesOptions : IValidatableObject { - public string Permissions { get; init; } - public string Umask { get; init; } + /// + /// Gets the permissions to apply to newly created files. + /// + /// + /// Applicable to non-Windows operating systems, only. + /// + [Argument(default, "file-permissions")] + [EnvironmentVariable("FILE_PERMISSIONS")] + [Description("the permissions to apply to newly created files (chmod syntax, non-Windows only)")] + public string Permissions { get; init; } = "644"; + /// + /// Extended validation. + /// + /// + /// public IEnumerable Validate(ValidationContext validationContext) { var regEx = new Regex("[0-7]{3}", RegexOptions.Compiled); var results = new List(); - if (!string.IsNullOrEmpty(Permissions) && !regEx.IsMatch(Permissions)) - { - results.Add(new ValidationResult($"Field {nameof(Permissions)} is invalid. Specify a three-character string consisting of only 0-7 (000-777, inclusive)")); - } - - if (!string.IsNullOrEmpty(Umask) && !regEx.IsMatch(Umask)) + if (!regEx.IsMatch(Permissions)) { - results.Add(new ValidationResult($"Field {nameof(Umask)} is invalid. Specify a three-character string consisting of only 0-7 (000-777, inclusive)")); + results.Add(new ValidationResult($"Field {nameof(Permissions)} is invalid. Specify a three-character string consisting of only 0-7 (chmod syntax, 000-777, inclusive)")); } return results; -- cgit v1.2.3