diff options
| author | encode42 <me@encode42.dev> | 2025-09-21 04:28:34 -0400 |
|---|---|---|
| committer | encode42 <me@encode42.dev> | 2025-09-21 04:38:24 -0400 |
| commit | f7156c08b159875cc3f8b4e59cb3babd8e475cca (patch) | |
| tree | cf7c7175c3917560dea58ebc359dc78dd520576b | |
| parent | 85d2b9a44fdaa8d7386ddffbf02a9ebc2629b1a0 (diff) | |
| download | slskd-f7156c08b159875cc3f8b4e59cb3babd8e475cca.tar.gz | |
Support the ability for the web interface to listen on a unix socket
| -rw-r--r-- | config/slskd.example.yml | 1 | ||||
| -rw-r--r-- | docs/config.md | 2 | ||||
| -rw-r--r-- | src/slskd/Core/Options.cs | 9 | ||||
| -rw-r--r-- | src/slskd/Program.cs | 6 |
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 |
