From 2e278a5f0651ac70324557c12e0388fd1de3159d Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Fri, 17 May 2024 18:53:04 -0500 Subject: add permissions to docs --- docs/config.md | 53 ++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 15 deletions(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index f81fe8c0..9e08e8c4 100644 --- a/docs/config.md +++ b/docs/config.md @@ -272,11 +272,39 @@ relay: downloads: false ``` -# Limits and User Groups +# Upload/Download Configuration, Limits and User Groups -## Global Slot and Speed Limits +## Downloads -Global slot and speed behave as a hard limit, additive across all groups. These values should be set as high as practical for the application's environment; more granular controls should be defined at the group level. +A hard limit for download slots can be set to limit the number of concurrent downloads. Upon reaching the limit, additional downloads will be queued locally (and thus a remote queue position will not be obtained). There is no slot limit by default. + +A download speed limit can be set to limit the total amount of network bandwidth consumed by downloads. When configured, this bandwidth is split among all active downloads. There is no speed limit by default. + +A change to slot limits requires an application restart to take effect, while speed limits can be adjusted at runtime. + +Unix file permissions can be configured and applied to newly downloaded files. The permission syntax is the same as the syntax used by the [chmod](https://en.wikipedia.org/wiki/Chmod) utility, accepting a numeric string of 3 or 4 numbers, each from 0 to 7. Unix file permissions are only applied when the application is running on a unix-like operating system (effectively, everything except Windows). The default permissions are 644, translating to read/write permissions for the owner (the user under which the application runs), read only for the owner's group, and read only for all other users. + +| Command-Line | Environment Variable | Description | +| ------------------------------- | ------------------------------------| ----------------------------------------------------------- | +| `--download-slots` | `SLSKD_DOWNLOAD_SLOTS` | The limit for the total number of download slots | +| `--download-speed-limit` | `SLSKD_DOWNLOAD_SPEED_LIMIT` | The total download speed limit, in kibibytes | +| `--downloaded-file-permissions` | `SLSKD_DOWNLOADED_FILE_PERMISSIONS` | The Unix file permissions to be applied to downloaded files | + +#### **YAML** +```yaml +global: + download: + slots: 500 + speed_limit: 1000 # kibibytes + file: + permissions: 644 +``` + +## Uploads + +### Global Slot and Speed Limits + +Global upload slot and speed limits behave as hard limits, additive across all groups. These values should be set as high as practical for the application's environment; more granular controls should be defined at the group level. A change to slot limits requires an application restart to take effect, while speed limits can be adjusted at runtime. @@ -284,8 +312,6 @@ A change to slot limits requires an application restart to take effect, while sp | ------------------------ | ---------------------------- | ------------------------------------------------ | | `--upload-slots` | `SLSKD_UPLOAD_SLOTS` | The limit for the total number of upload slots | | `--upload-speed-limit` | `SLSKD_UPLOAD_SPEED_LIMIT` | The total upload speed limit, in kibibytes | -| `--download-slots` | `SLSKD_DOWNLOAD_SLOTS` | The limit for the total number of download slots | -| `--download-speed-limit` | `SLSKD_DOWNLOAD_SPEED_LIMIT` | The total download speed limit, in kibibytes | #### **YAML** ```yaml @@ -293,12 +319,9 @@ global: upload: slots: 20 speed_limit: 1000 # kibibytes - download: - slots: 500 - speed_limit: 1000 ``` -## Global Upload Limits +### Global Upload Limits Global upload limits define the number of queued, daily, and weekly uploads on a _per user_ basis. These limits behave as defaults and are applied if limits for a user's group have not been set. @@ -327,7 +350,7 @@ global: failures: 1000 ``` -## Groups +### Groups User groups are used to control upload slots, speed limits, and queue behavior on a per-user basis. @@ -362,7 +385,7 @@ limits: failures: 1000 ``` -## Built-In Groups +### Built-In Groups The `default` built-in group contains all users who have not been explicitly added to a user-defined group, are not privileged, and haven't been identified as leechers. @@ -415,7 +438,7 @@ groups: failures: 30 ``` -## User Blacklist +### User Blacklist A fourth built-in group, `blacklisted`, is used to disallow other users from various activities. @@ -441,7 +464,7 @@ groups: - ``` -## User Defined Groups +### User Defined Groups In the group configuration, any number of user-defined groups can be added under the `user_defined` key. @@ -467,7 +490,7 @@ groups: - alice ``` -## Example +### Example In the following example: @@ -506,7 +529,7 @@ groups: - bob ``` -## Managed Blacklist +# Managed Blacklist A managed blacklist (also called a blocklist) can be specified to disallow interaction with known undesireable actors. Users whose IP address metches an entry on this list are functionally the same as users added to the [User Blacklist](#user-blacklist) described above and are disallowed any interactions with shares or files. -- cgit v1.2.3 From 29faa7d07a11862fd4fb51a84df98c9a53d70625 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Tue, 21 May 2024 20:38:18 -0500 Subject: revert docs --- docs/config.md | 55 ++++++++++++++++--------------------------------------- 1 file changed, 16 insertions(+), 39 deletions(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 9e08e8c4..bed6d2d6 100644 --- a/docs/config.md +++ b/docs/config.md @@ -272,39 +272,11 @@ relay: downloads: false ``` -# Upload/Download Configuration, Limits and User Groups +# Limits and User Groups -## Downloads +## Global Slot and Speed Limits -A hard limit for download slots can be set to limit the number of concurrent downloads. Upon reaching the limit, additional downloads will be queued locally (and thus a remote queue position will not be obtained). There is no slot limit by default. - -A download speed limit can be set to limit the total amount of network bandwidth consumed by downloads. When configured, this bandwidth is split among all active downloads. There is no speed limit by default. - -A change to slot limits requires an application restart to take effect, while speed limits can be adjusted at runtime. - -Unix file permissions can be configured and applied to newly downloaded files. The permission syntax is the same as the syntax used by the [chmod](https://en.wikipedia.org/wiki/Chmod) utility, accepting a numeric string of 3 or 4 numbers, each from 0 to 7. Unix file permissions are only applied when the application is running on a unix-like operating system (effectively, everything except Windows). The default permissions are 644, translating to read/write permissions for the owner (the user under which the application runs), read only for the owner's group, and read only for all other users. - -| Command-Line | Environment Variable | Description | -| ------------------------------- | ------------------------------------| ----------------------------------------------------------- | -| `--download-slots` | `SLSKD_DOWNLOAD_SLOTS` | The limit for the total number of download slots | -| `--download-speed-limit` | `SLSKD_DOWNLOAD_SPEED_LIMIT` | The total download speed limit, in kibibytes | -| `--downloaded-file-permissions` | `SLSKD_DOWNLOADED_FILE_PERMISSIONS` | The Unix file permissions to be applied to downloaded files | - -#### **YAML** -```yaml -global: - download: - slots: 500 - speed_limit: 1000 # kibibytes - file: - permissions: 644 -``` - -## Uploads - -### Global Slot and Speed Limits - -Global upload slot and speed limits behave as hard limits, additive across all groups. These values should be set as high as practical for the application's environment; more granular controls should be defined at the group level. +Global slot and speed behave as a hard limit, additive across all groups. These values should be set as high as practical for the application's environment; more granular controls should be defined at the group level. A change to slot limits requires an application restart to take effect, while speed limits can be adjusted at runtime. @@ -312,6 +284,8 @@ A change to slot limits requires an application restart to take effect, while sp | ------------------------ | ---------------------------- | ------------------------------------------------ | | `--upload-slots` | `SLSKD_UPLOAD_SLOTS` | The limit for the total number of upload slots | | `--upload-speed-limit` | `SLSKD_UPLOAD_SPEED_LIMIT` | The total upload speed limit, in kibibytes | +| `--download-slots` | `SLSKD_DOWNLOAD_SLOTS` | The limit for the total number of download slots | +| `--download-speed-limit` | `SLSKD_DOWNLOAD_SPEED_LIMIT` | The total download speed limit, in kibibytes | #### **YAML** ```yaml @@ -319,9 +293,12 @@ global: upload: slots: 20 speed_limit: 1000 # kibibytes + download: + slots: 500 + speed_limit: 1000 ``` -### Global Upload Limits +## Global Upload Limits Global upload limits define the number of queued, daily, and weekly uploads on a _per user_ basis. These limits behave as defaults and are applied if limits for a user's group have not been set. @@ -350,7 +327,7 @@ global: failures: 1000 ``` -### Groups +## Groups User groups are used to control upload slots, speed limits, and queue behavior on a per-user basis. @@ -385,7 +362,7 @@ limits: failures: 1000 ``` -### Built-In Groups +## Built-In Groups The `default` built-in group contains all users who have not been explicitly added to a user-defined group, are not privileged, and haven't been identified as leechers. @@ -438,7 +415,7 @@ groups: failures: 30 ``` -### User Blacklist +## User Blacklist A fourth built-in group, `blacklisted`, is used to disallow other users from various activities. @@ -464,7 +441,7 @@ groups: - ``` -### User Defined Groups +## User Defined Groups In the group configuration, any number of user-defined groups can be added under the `user_defined` key. @@ -490,7 +467,7 @@ groups: - alice ``` -### Example +## Example In the following example: @@ -529,7 +506,7 @@ groups: - bob ``` -# Managed Blacklist +## Managed Blacklist A managed blacklist (also called a blocklist) can be specified to disallow interaction with known undesireable actors. Users whose IP address metches an entry on this list are functionally the same as users added to the [User Blacklist](#user-blacklist) described above and are disallowed any interactions with shares or files. @@ -1113,4 +1090,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 ` | Generate a random secret of the specified length | +| `-k\|--generate-secret ` | Generate a random secret of the specified length | \ No newline at end of file -- cgit v1.2.3 From f7fefd065aec5ba3a9b4e679e36a5997924ec591 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 22 May 2024 22:49:41 -0500 Subject: docs --- docs/config.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'docs') 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 ` | Generate a random secret of the specified length | \ No newline at end of file +| `-k\|--generate-secret ` | Generate a random secret of the specified length | -- cgit v1.2.3