aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-12-30 16:19:28 -0600
committerJP Dillingham <jp@dillingham.me>2022-12-30 16:19:28 -0600
commit3f6f13bb99deac7c0b5a5b5ddb43cea91fa40e13 (patch)
tree7155c2f7e4b856dc2c83689553866831a49a98d1
parent49bc255026aa5ef2c4df0727134b7627808270fc (diff)
downloadslskd-3f6f13bb99deac7c0b5a5b5ddb43cea91fa40e13.tar.gz
add controller 'downloads' option and docs
-rw-r--r--config/slskd.example.yml3
-rw-r--r--docs/config.md20
-rw-r--r--src/slskd/Core/Options.cs8
3 files changed, 22 insertions, 9 deletions
diff --git a/config/slskd.example.yml b/config/slskd.example.yml
index 02ccbe7f..7c1f3c36 100644
--- a/config/slskd.example.yml
+++ b/config/slskd.example.yml
@@ -17,10 +17,11 @@
# # controller config is required when running in 'agent' mode
# # this specifies the relay controller that will be controlling this agent
# controller:
-# address:
+# address: https://some.site.com:5000
# ignore_certificate_errors: false
# api_key: <a 16-255 character string corresponding to one of the controller's API keys>
# secret: <a 16-255 character shared secret matching the controller's config for this agent>
+# downloads: false
# # agent config is optional when running in 'controller' mode
# # this specifies all of the agents capable of connecting
# agents:
diff --git a/docs/config.md b/docs/config.md
index aed3a424..b3cf6aeb 100644
--- a/docs/config.md
+++ b/docs/config.md
@@ -226,14 +226,17 @@ Agents need to specify the HTTP or HTTPS address of their controller, the API ke
If using HTTPS; most users won't have a valid certificate (the self-signed certificates that slskd generates at startup are not 'valid' because they are self-signed), and in those cases the `ignore_certificate_errors` option should be set to `true`.
-| Command-Line | Environment Variable | Description |
-| ---------------------------------------- | -------------------------------------------- | ------------------------------------------|
-| `-r\|--relay` | `SLSKD_RELAY` | Enable the Relay feature |
-| `-m\|--relay-mode` | `SLSKD_RELAY_MODE` | The Relay mode (Controller, Agent, Debug) |
-| `--controller-address` | `SLSKD_CONTROLLER_ADDRESS` | The address of the controller |
-| `--controller-ignore-certificate-errors` | `SLSKD_CONTROLLER_IGNORE_CERTIFICATE_ERRORS` | Ignore certificate errors |
-| `--controller-api-key` | `SLSKD_CONTROLLER_API_KEY` | An API key for the controller |
-| `--controller-secret` | `SLSKD_CONTROLLER_SECRET` | The shared secret for this agent |
+Agents can optionally receive completed downloads from the controller by enabling the `downloads` option. With this option enabled, agents will automatically download new files from the controller and save them to the configured local downloads directory.
+
+| Command-Line | Environment Variable | Description |
+| ---------------------------------------- | -------------------------------------------- | ------------------------------------------------|
+| `-r\|--relay` | `SLSKD_RELAY` | Enable the Relay feature |
+| `-m\|--relay-mode` | `SLSKD_RELAY_MODE` | The Relay mode (Controller, Agent, Debug) |
+| `--controller-address` | `SLSKD_CONTROLLER_ADDRESS` | The address of the controller |
+| `--controller-ignore-certificate-errors` | `SLSKD_CONTROLLER_IGNORE_CERTIFICATE_ERRORS` | Ignore certificate errors |
+| `--controller-api-key` | `SLSKD_CONTROLLER_API_KEY` | An API key for the controller |
+| `--controller-secret` | `SLSKD_CONTROLLER_SECRET` | The shared secret for this agent |
+| `--controller-downloads` | `SLSKD_CONTROLLER_DOWNLOADS` | Receive completed downloads from the controller |
```yaml
instance_name: some_instance
@@ -245,6 +248,7 @@ relay:
ignore_certificate_errors: true
api_key: <a valid API key for the controller instance>
secret: <a secret value that matches the controller for this instance>
+ downloads: false
```
# Limits and User Groups
diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs
index e23fd640..bc6f14a6 100644
--- a/src/slskd/Core/Options.cs
+++ b/src/slskd/Core/Options.cs
@@ -500,6 +500,14 @@ namespace slskd
[NotNullOrWhiteSpace]
[Secret]
public string Secret { get; init; }
+
+ /// <summary>
+ /// Gets a value indicating whether to receive completed downloads from the controller.
+ /// </summary>
+ [Argument(default, "controller-downloads")]
+ [EnvironmentVariable("CONTROLLER_DOWNLOADS")]
+ [Description("receive completed downloads from the controller")]
+ public bool Downloads { get; init; } = false;
}
/// <summary>