aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Core
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-10-24 20:09:08 -0500
committerGitHub <noreply@github.com>2026-10-24 20:09:08 -0500
commita4cce04d38544ad6d4c1506b9facb32407a79509 (patch)
tree122b6789cfc4cfd6100539b392a6f09aae86d96a /src/slskd/Core
parent99171c6577f53b28e1e2238a205c04243c6256d5 (diff)
parent84f56bf5175f93194f03f9819f6b9a62f492b9ad (diff)
downloadslskd-a4cce04d38544ad6d4c1506b9facb32407a79509.tar.gz
Merge pull request #1909 from slskd/dump
Remove the ability to dump memory at run-time
Diffstat (limited to 'src/slskd/Core')
-rw-r--r--src/slskd/Core/API/Controllers/ApplicationController.cs21
-rw-r--r--src/slskd/Core/Options.cs13
2 files changed, 0 insertions, 34 deletions
diff --git a/src/slskd/Core/API/Controllers/ApplicationController.cs b/src/slskd/Core/API/Controllers/ApplicationController.cs
index c9af1296..e015e612 100644
--- a/src/slskd/Core/API/Controllers/ApplicationController.cs
+++ b/src/slskd/Core/API/Controllers/ApplicationController.cs
@@ -168,27 +168,6 @@ namespace slskd.Core.API
}
[ApiExplorerSettings(IgnoreApi = true)]
- [HttpGet("dump")]
- [Authorize(Policy = AuthPolicy.Any, Roles = AuthRole.AdministratorOnly)]
- public async Task<IActionResult> DumpMemory()
- {
- if (OptionsAtStartup.Flags.Dumpable)
- {
- Log.Warning("Dumping application memory...");
-
- using var dumper = new Dumper();
- var file = await dumper.DumpAsync();
-
- Log.Warning("Dump complete");
-
- return PhysicalFile(file, "application/octet-stream", "slskd.dmp");
- }
-
- Log.Warning("Unauthorized attempt to dump application memory; Flags.Dumpable is disabled");
- return Forbid();
- }
-
- [ApiExplorerSettings(IgnoreApi = true)]
[HttpPost("loopback")]
[Authorize(Policy = AuthPolicy.Any, Roles = AuthRole.ReadWriteOrAdministrator)]
public IActionResult Loopback([FromBody] object body)
diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs
index d2aba37f..05eaed57 100644
--- a/src/slskd/Core/Options.cs
+++ b/src/slskd/Core/Options.cs
@@ -484,19 +484,6 @@ namespace slskd
public bool Volatile { get; init; } = false;
/// <summary>
- /// Gets a value indicating whether real-time memory dumping via API is enabled.
- /// </summary>
- /// <remarks>
- /// This can expose sensitive information, and should be turned on only to diagnose memory leaks.
- /// As such, it is and must remain undocumented.
- /// </remarks>
- [Argument(default, "dumpable")]
- [EnvironmentVariable("DUMPABLE")]
- [Description("enable run-time memory dumps via api")]
- [RequiresRestart]
- public bool Dumpable { get; init; } = false;
-
- /// <summary>
/// Gets a value indicating whether user-defined regular expressions are case sensitive.
/// </summary>
[Argument(default, "case-sensitive-regex")]