mirror of
https://github.com/Stone-Red-Code/RemoteExec.git
synced 2026-09-04 09:06:20 +02:00
Add authentication and improve server side configuration
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
namespace RemoteExec.Server.Configuration;
|
||||
|
||||
public class ApiKeyConfiguration
|
||||
{
|
||||
public required string Key { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public bool Enabled { get; set; } = true;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace RemoteExec.Server.Configuration;
|
||||
|
||||
public class AuthenticationConfiguration
|
||||
{
|
||||
public List<ApiKeyConfiguration> ApiKeys { get; set; } = [];
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace RemoteExec.Server.Configuration;
|
||||
|
||||
public class ExecutionConfiguration
|
||||
{
|
||||
/// <summary>
|
||||
/// Maximum number of concurrent tasks. Default is ProcessorCount * 2.
|
||||
/// </summary>
|
||||
public int? MaxConcurrentTasks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Timeout for assembly loading requests in seconds. Default is 30 seconds.
|
||||
/// </summary>
|
||||
public int AssemblyLoadTimeoutSeconds { get; set; } = 30;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace RemoteExec.Server.Configuration;
|
||||
|
||||
public class MetricsConfiguration
|
||||
{
|
||||
/// <summary>
|
||||
/// Minimum CPU usage difference (in percentage points) to trigger a metrics broadcast. Default is 1.0.
|
||||
/// </summary>
|
||||
public double CpuDifferenceThreshold { get; set; } = 1.0;
|
||||
|
||||
/// <summary>
|
||||
/// Minimum memory usage difference (in bytes) to trigger a metrics broadcast. Default is 10 MB.
|
||||
/// </summary>
|
||||
public long MemoryDifferenceThreshold { get; set; } = 10 * 1024 * 1024;
|
||||
|
||||
/// <summary>
|
||||
/// Broadcast interval in milliseconds. Default is 500 ms.
|
||||
/// </summary>
|
||||
public int BroadcastIntervalMs { get; set; } = 500;
|
||||
}
|
||||
Reference in New Issue
Block a user