aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Configuration.cs
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2021-01-23 22:02:30 -0600
committerJP Dillingham <jpdillingham@gmail.com>2021-01-23 22:02:30 -0600
commit0f76728a60e16acae2aab0e3c661d32ab7e5a01c (patch)
tree45c906cffaef0813ff9c8632d6991778027e5c9d /src/slskd/Configuration.cs
parent01b69a964a5162b5fcbf91774ee39d8a4e429dd6 (diff)
downloadslskd-0f76728a60e16acae2aab0e3c661d32ab7e5a01c.tar.gz
tweak config layout
Diffstat (limited to 'src/slskd/Configuration.cs')
-rw-r--r--src/slskd/Configuration.cs117
1 files changed, 70 insertions, 47 deletions
diff --git a/src/slskd/Configuration.cs b/src/slskd/Configuration.cs
index c09896a5..e02670df 100644
--- a/src/slskd/Configuration.cs
+++ b/src/slskd/Configuration.cs
@@ -65,27 +65,6 @@
Key: "slskd:instancename",
Description: "optional; a unique name for this instance"),
new(
- ShortName: 'm',
- LongName: "prometheus",
- EnvironmentVariable: "PROMETHEUS",
- Type: typeof(bool),
- Key: "slskd:feature:prometheus",
- Description: "enable collection and publishing of prometheus metrics"),
- new(
- ShortName: 's',
- LongName: "swagger",
- EnvironmentVariable: "SWAGGER",
- Type: typeof(bool),
- Key: "slskd:feature:swagger",
- Description: "enable swagger documentation and UI"),
- new(
- ShortName: 'l',
- LongName: "loki",
- EnvironmentVariable: "LOKI",
- Type: typeof(string),
- Key: "slskd:logger:loki",
- Description: "optional; the url to a Grafana Loki instance to which to log"),
- new(
ShortName: 'b',
LongName: "url-base",
EnvironmentVariable: "URL_BASE",
@@ -118,15 +97,57 @@
LongName: "username",
EnvironmentVariable: "USERNAME",
Type: typeof(string),
- Key: "soulseek:username",
+ Key: "slskd:soulseek:username",
Description: "the username for the Soulseek network"),
new(
ShortName: 'p',
LongName: "password",
EnvironmentVariable: "PASSWORD",
Type: typeof(string),
- Key: "soulseek:password",
- Description: "the password for the Soulseek network")
+ Key: "slskd:soulseek:password",
+ Description: "the password for the Soulseek network"),
+ new(
+ ShortName: 'l',
+ LongName: "listen-port",
+ EnvironmentVariable: "LISTEN_PORT",
+ Type: typeof(int),
+ Key: "slskd:soulseek:listenport",
+ Description: "the port on which to listen"),
+ new(
+ ShortName: 'n',
+ LongName: "distributed-network",
+ EnvironmentVariable: "DNET",
+ Type: typeof(bool),
+ Key: "slskd:soulseek:distributednetwork:enabled",
+ Description: "enables the distributed network"),
+ new(
+ ShortName: 'c',
+ LongName: "child-limit",
+ EnvironmentVariable: "DNET_CHILDREN",
+ Type: typeof(int),
+ Key: "slskd:soulseek:distributednetwork:childlimit",
+ Description: "sets the limit for the number of distributed children"),
+ new(
+ ShortName: default,
+ LongName: "prometheus",
+ EnvironmentVariable: "PROMETHEUS",
+ Type: typeof(bool),
+ Key: "slskd:feature:prometheus",
+ Description: "enable collection and publishing of prometheus metrics"),
+ new(
+ ShortName: default,
+ LongName: "swagger",
+ EnvironmentVariable: "SWAGGER",
+ Type: typeof(bool),
+ Key: "slskd:feature:swagger",
+ Description: "enable swagger documentation and UI"),
+ new(
+ ShortName: default,
+ LongName: "loki",
+ EnvironmentVariable: "LOKI",
+ Type: typeof(string),
+ Key: "slskd:logger:loki",
+ Description: "optional; the url to a Grafana Loki instance to which to log"),
};
public class Program
@@ -138,6 +159,7 @@
public FeatureOptions Feature { get; private set; } = new FeatureOptions();
public LoggerOptions Logger { get; private set; } = new LoggerOptions();
public WebOptions Web { get; private set; } = new WebOptions();
+ public SoulseekOptions Soulseek { get; private set; } = new SoulseekOptions();
public class FeatureOptions
{
@@ -162,37 +184,38 @@
public string Key { get; private set; } = Guid.NewGuid().ToString();
}
}
- }
-
- public class Soulseek
- {
- public string Username { get; set; }
- public string Password { get; set; }
- public int ListenPort { get; set; } = 50000;
- public DistributedNetworkOptions DistributedNetwork { get; set; }
- public ConnectionOptions Connection { get; set; }
- public class DistributedNetworkOptions
- {
- public bool Enabled { get; set; } = true;
- public int ChildLimit { get; set; } = 10;
- }
- public class ConnectionOptions
+ public class SoulseekOptions
{
- public TimeoutOptions Timeout { get; set; }
- public BufferOptions Buffer { get; set; }
+ public string Username { get; set; }
+ public string Password { get; set; }
+ public int ListenPort { get; set; } = 50000;
+ public DistributedNetworkOptions DistributedNetwork { get; set; }
+ public ConnectionOptions Connection { get; set; }
- public class TimeoutOptions
+ public class DistributedNetworkOptions
{
- public int Connect { get; set; } = 5000;
- public int Inactivity { get; set; } = 15000;
+ public bool Enabled { get; set; } = true;
+ public int ChildLimit { get; set; } = 10;
}
- public class BufferOptions
+ public class ConnectionOptions
{
- public int Read { get; set; } = 16384;
- public int Write { get; set; } = 16384;
+ public TimeoutOptions Timeout { get; set; }
+ public BufferOptions Buffer { get; set; }
+
+ public class TimeoutOptions
+ {
+ public int Connect { get; set; } = 5000;
+ public int Inactivity { get; set; } = 15000;
+ }
+
+ public class BufferOptions
+ {
+ public int Read { get; set; } = 16384;
+ public int Write { get; set; } = 16384;
+ }
}
}
}