aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2024-05-22 22:49:41 -0500
committerJP Dillingham <jpdillingham@gmail.com>2024-05-22 22:49:41 -0500
commitf7fefd065aec5ba3a9b4e679e36a5997924ec591 (patch)
treea6d1ec0e9c8bcef57951924073a905329392ebdd
parent29faa7d07a11862fd4fb51a84df98c9a53d70625 (diff)
downloadslskd-f7fefd065aec5ba3a9b4e679e36a5997924ec591.tar.gz
docs
-rw-r--r--docs/config.md26
1 files changed, 25 insertions, 1 deletions
diff --git a/docs/config.md b/docs/config.md
index bed6d2d6..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.
@@ -1090,4 +1114,4 @@ The application can be run in "command mode", causing it to execute a command an
| `-h\|--help` | Display available command-line arguments |
| `-e\|--envars` | Display available environment variables |
| `-g\|--generate-cert` | Generate an X509 certificate and password for HTTPS |
-| `-k\|--generate-secret <length>` | Generate a random secret of the specified length | \ No newline at end of file
+| `-k\|--generate-secret <length>` | Generate a random secret of the specified length |