aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Core/Options.cs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs
index c9b46239..1d9f814c 100644
--- a/src/slskd/Core/Options.cs
+++ b/src/slskd/Core/Options.cs
@@ -438,6 +438,14 @@ namespace slskd
}
else
{
+ // determine whether any InstanceName is used more than once
+ var instanceNames = Agents.Values.Select(a => a.InstanceName);
+
+ if (instanceNames.Count() != instanceNames.Distinct().Count())
+ {
+ modeResults.Add(new ValidationResult("One or more Agent instance names are duplicated. Ensure instance names are unique."));
+ }
+
foreach (var (name, agent) in Agents)
{
var res = new List<ValidationResult>();
@@ -516,6 +524,15 @@ namespace slskd
public class RelayAgentConfigurationOptions : IValidatableObject
{
/// <summary>
+ /// Gets the agent instance name.
+ /// </summary>
+ [Description("the name for this agent")]
+ [StringLength(255, MinimumLength = 1)]
+ [NotNullOrWhiteSpace]
+ [Secret]
+ public string InstanceName { get; init; }
+
+ /// <summary>
/// Gets the agent secret.
/// </summary>
[Description("shared secret for this agent")]