From 106e318d896c521b90b27f438bf7225ffd276b8b Mon Sep 17 00:00:00 2001 From: Graham Sutherland Date: Fri, 26 Jan 2024 22:33:26 +0000 Subject: Document blacklistfile --- docs/config.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 15a4c817..f46f581f 100644 --- a/docs/config.md +++ b/docs/config.md @@ -359,7 +359,7 @@ Blacklisted users are prevented from: - Retrieving directory contents - Enqueueing downloads -Users can be blacklisted by adding their username to the `members` list. Additionally, users can be blacklisted by IP address, or range of addresses by adding a CIDR entry to the `cidrs` list. +Users can be blacklisted by adding their username to the `members` list. Users can also be blacklisted by IP address, or range of addresses by adding a CIDR entry to the `cidrs` list. In addition, an external blacklist file containing CIDRs can be specified using `blacklistfile`, with each CIDR on its own line. Empty lines and lines starting with `#` are ignored. Users added to the blacklist will be blocked from enqueueing any new files. Any existing active or queued transfers will need to be cancelled manually. @@ -371,6 +371,7 @@ groups: - cidrs: - + blacklistfile: 'D:\blacklist.txt' ``` ## User Defined Groups -- cgit v1.2.3 From 2a5c671499ac7bb542d7373464ac4a57465d971d Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 5 May 2024 13:34:37 -0500 Subject: document the managed blacklist --- docs/config.md | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 265b3fd2..f81fe8c0 100644 --- a/docs/config.md +++ b/docs/config.md @@ -415,7 +415,7 @@ groups: failures: 30 ``` -## Blacklist +## User Blacklist A fourth built-in group, `blacklisted`, is used to disallow other users from various activities. @@ -425,10 +425,12 @@ Blacklisted users are prevented from: - Retrieving directory contents - Enqueueing downloads -Users can be blacklisted by adding their username to the `members` list. Users can also be blacklisted by IP address, or range of addresses by adding a CIDR entry to the `cidrs` list. In addition, an external blacklist file containing CIDRs can be specified using `blacklistfile`, with each CIDR on its own line. Empty lines and lines starting with `#` are ignored. +Users can be blacklisted by adding their username to the `members` list. Additionally, users can be blacklisted by IP address, or range of addresses by adding a CIDR entry to the `cidrs` list. Users added to the blacklist will be blocked from enqueueing any new files. Any existing active or queued transfers will need to be cancelled manually. +A managed blacklist file may also be used to achieve the same effects. Read more about this in the [Managed Blacklist](#managed-blacklist) section below. + **YAML** ```yaml groups: @@ -437,7 +439,6 @@ groups: - cidrs: - - blacklistfile: 'D:\blacklist.txt' ``` ## User Defined Groups @@ -505,6 +506,27 @@ groups: - bob ``` +## 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. + +Blacklists/blocklists designed for use with other P2P applications (such as BitTorrent) are supported; specifically the P2P, DAT, and CIDR formats. + +When enabled, the specified file is validated by reading the first few lines of the file to automatically detect the format. If the file doesn't exist, can't be read, the format can't be detected, or if it contains any lines that don't match the format, the application will exit. Similarly, if the file changes while the application is running and there's an issue, the application will exit. + +Note that the contents of the blacklist are stored in memory to ensure performance, and this will increase the amount of memory used, potentially significantly if the blacklist is large. + +| Command-Line | Environment Variable | Description | +| -------------------- | -------------------- | ------------------------------ | +| `--enable-blacklist` | `BLACKLIST` | Enable the managed blacklist | +| `--blacklist-file` | `BLACKLIST_FILE` | The path to the blacklist file | + +```yaml +blacklist: + enabled: true + file: +``` + # Chat Rooms and Private Messaging ## Auto-Joining Rooms @@ -515,7 +537,6 @@ The list can be specified via command line (e.g. --rooms --rooms Additionally, when the client is disconnected, any rooms that were joined at the time of the disconnect are rejoined upon reconnect, as long as the app hasn't been restarted in between. - | Command-Line | Environment Variable | Description | | ------------- | ---------------------| ----------------------------------------| | `--rooms` | `ROOMS` | A list of chat rooms to join on startup | -- cgit v1.2.3 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 From 1748a75cfd10008ebf46144c61d8f884625c6726 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Mon, 27 May 2024 18:19:01 -0500 Subject: docs for keepalive --- docs/config.md | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 5c4eb2bb..87fb916b 100644 --- a/docs/config.md +++ b/docs/config.md @@ -1072,20 +1072,21 @@ feature: Several additional feature flags are provided to change the application's runtime behavior, which is helpful during development. Available feature flags are: -| Flag | Environment Variable | Description | -| ------------------------ | ---------------------------- | ---------------------------------------------------------------- | -| `-d\|--debug` | `SLSKD_DEBUG` | Run the application in debug mode. Produces verbose log output. | -| `--experimental` | `SLSKD_EXPERIMENTAL` | Run the application in experimental mode. YMMV. | -| `-n\|--no-logo` | `SLSKD_NO_LOGO` | Don't show the application logo on startup | -| `-x\|--no-start` | `SLSKD_NO_START` | Bootstrap the application, but don't start | -| `--no-config-watch` | `SLSKD_NO_CONFIG_WATCH` | Don't watch the configuration file for changes | -| `--no-connect` | `SLSKD_NO_CONNECT` | Start the application, but don't connect to the server | -| `--no-share-scan` | `SLSKD_NO_SHARE_SCAN` | Don't perform a scan of shared directories on startup | -| `--force-share-scan` | `SLSKD_FORCE_SHARE_SCAN` | Force a scan of shared directories on startup | -| `--no-version-check` | `SLSKD_NO_VERSION_CHECK` | Don't perform a version check on startup | -| `--log-sql` | `SLSKD_LOG_SQL` | Log SQL queries generated by Entity Framework | -| `--volatile` | `SLSKD_VOLATILE` | Use volatile data storage (all data will be lost at shutdown) | -| `--case-sensitive-regex` | `SLSKD_CASE_SENSITIVE_REGEX` | User-defined regular expressions are case sensitive | +| Flag | Environment Variable | Description | +| -------------------------------- | ------------------------------------ | ---------------------------------------------------------------- | +| `-d\|--debug` | `SLSKD_DEBUG` | Run the application in debug mode. Produces verbose log output. | +| `--experimental` | `SLSKD_EXPERIMENTAL` | Run the application in experimental mode. YMMV. | +| `-n\|--no-logo` | `SLSKD_NO_LOGO` | Don't show the application logo on startup | +| `-x\|--no-start` | `SLSKD_NO_START` | Bootstrap the application, but don't start | +| `--no-config-watch` | `SLSKD_NO_CONFIG_WATCH` | Don't watch the configuration file for changes | +| `--no-connect` | `SLSKD_NO_CONNECT` | Start the application, but don't connect to the server | +| `--no-share-scan` | `SLSKD_NO_SHARE_SCAN` | Don't perform a scan of shared directories on startup | +| `--force-share-scan` | `SLSKD_FORCE_SHARE_SCAN` | Force a scan of shared directories on startup | +| `--no-version-check` | `SLSKD_NO_VERSION_CHECK` | Don't perform a version check on startup | +| `--log-sql` | `SLSKD_LOG_SQL` | Log SQL queries generated by Entity Framework | +| `--volatile` | `SLSKD_VOLATILE` | Use volatile data storage (all data will be lost at shutdown) | +| `--case-sensitive-regex` | `SLSKD_CASE_SENSITIVE_REGEX` | User-defined regular expressions are case sensitive | +| `--legacy-windows-tcp-keepalive` | `SLSKD_LEGACY_WINDOWS_TCP_KEEPALIVE` | Use a legacy TCP keepalive strategy for older Windows versions | #### **YAML** ```yaml @@ -1102,6 +1103,7 @@ flags: experimental: false volatile: false case_sensitive_reg_ex: false + legacy_windows_tcp_keepalive: false ``` # Commands -- cgit v1.2.3