aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/slskd.example.yml1
-rw-r--r--docs/config.md2
-rw-r--r--src/slskd/Core/Options.cs9
-rw-r--r--src/slskd/Program.cs6
4 files changed, 18 insertions, 0 deletions
diff --git a/config/slskd.example.yml b/config/slskd.example.yml
index 86e272ef..122ce4cf 100644
--- a/config/slskd.example.yml
+++ b/config/slskd.example.yml
@@ -143,6 +143,7 @@
# certificate:
# pfx: ~
# password: ~
+# socket: ~
# url_base: /
# content_path: wwwroot
# logging: false
diff --git a/docs/config.md b/docs/config.md
index 053deea3..6bbd01cf 100644
--- a/docs/config.md
+++ b/docs/config.md
@@ -802,6 +802,7 @@ Logging of HTTP requests is disabled by default.
| Command-Line | Environment Variable | Description |
| ----------------- | -------------------------- | ------------------------------------------------- |
| `-l\|--http-port` | `SLSKD_HTTP_PORT` | The HTTP listen port |
+| `--http-socket` | `SLSKD_HTTP_SOCKET` | The unix listen socket |
| `--url-base` | `SLSKD_URL_BASE` | The base url for web requests |
| `--content-path` | `SLSKD_CONTENT_PATH` | The path to static web content |
| `--http-logging` | `SLSKD_HTTP_LOGGING` | Determines whether HTTP requests are to be logged |
@@ -810,6 +811,7 @@ Logging of HTTP requests is disabled by default.
```yaml
web:
port: 5030
+ socket: ~
url_base: /
content_path: wwwroot
logging: false
diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs
index 4d4c1e68..af8f3c2f 100644
--- a/src/slskd/Core/Options.cs
+++ b/src/slskd/Core/Options.cs
@@ -1812,6 +1812,15 @@ namespace slskd
[Validate]
[RequiresRestart]
public HttpsOptions Https { get; init; } = new HttpsOptions();
+
+ /// <summary>
+ /// Gets the unix listen socket.
+ /// </summary>
+ [Argument(default, "http-socket")]
+ [EnvironmentVariable("HTTP_SOCKET")]
+ [Description("unix listen socket for web UI")]
+ [RequiresRestart]
+ public string Socket { get; init; }
/// <summary>
/// Gets the base url for web requests.
diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs
index 35ed87fc..8825485e 100644
--- a/src/slskd/Program.cs
+++ b/src/slskd/Program.cs
@@ -493,6 +493,12 @@ namespace slskd
}
});
}
+
+ if (OptionsAtStartup.Web.Socket != null)
+ {
+ Log.Information($"Listening on socket {OptionsAtStartup.Web.Socket}");
+ options.ListenUnixSocket(OptionsAtStartup.Web.Socket);
+ }
});
builder.Services