aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2024-05-26 20:59:00 -0500
committerGitHub <noreply@github.com>2024-05-26 20:59:00 -0500
commite2e8fb86f74fdbd1c39820a7ac3adc91d4a5c2a8 (patch)
treea6d1ec0e9c8bcef57951924073a905329392ebdd /docs
parentff841bc6411be74e99b0b71754d23614a59c7187 (diff)
parentf7fefd065aec5ba3a9b4e679e36a5997924ec591 (diff)
downloadslskd-e2e8fb86f74fdbd1c39820a7ac3adc91d4a5c2a8.tar.gz
Merge pull request #1128 from slskd/file-perms
Add the ability to configure Unix file permissions to be applied to newly downloaded files
Diffstat (limited to 'docs')
-rw-r--r--docs/config.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/docs/config.md b/docs/config.md
index f81fe8c0..5c4eb2bb 100644
--- a/docs/config.md
+++ b/docs/config.md
@@ -73,6 +73,30 @@ If an attacker were to gain access to the application and retrieve the YAML file
remote_configuration: false
```
+# Permissions
+
+On [Unix-like](https://en.wikipedia.org/wiki/Unix-like) operating systems, slskd creates downloaded files with permissions dictated by the [umask](https://en.wikipedia.org/wiki/Umask) of the process, usually 022, which translates to a file mode of 644; read/write for the owner and read for the group and all others.
+
+Users wishing to create files with different permissions can change the umask value before launching the application (e.g. `umask 000 & ./slskd`), and the file mode will be changed accordingly.
+
+When running within a docker container the environment variable `SLSKD_UMASK` can be used to change the umask for the process within the container, and this will in turn change the resulting file mode on a mounted volume.
+
+Users can optionally configure alternative permissions for files by setting the file permission mode option. It's not possible to supersede the configured umask value; setting a mode of 777, for example, will have no effect with a umask of 022.
+
+These options have no effect on Windows.
+
+| Command-Line | Environment Variable | Description |
+| ------------------------ | -----------------------------| -------------------------------------------------------------------------------- |
+| n/a | `SLSKD_UMASK` | When running within the slskd Docker container, the umask for the process |
+| `--file-permission-mode` | `SLSKD_FILE_PERMISSION_MODE` | The permissions to apply to newly created files (chmod syntax, non-Windows only) |
+
+#### **YAML**
+```yaml
+permissions:
+ file:
+ mode: 644 # not for Windows, chmod syntax, e.g. 644, 777. can't escalate beyond umask
+```
+
# Application Directory Configuration
The application directory configuration option determines the location of the YAML file, the default locations of the download and incomplete directories, and the location of application working data, such as logs and SQLite databases.