aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Common/Options/RuntimeOptions.cs
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2021-01-23 13:40:07 -0600
committerJP Dillingham <jpdillingham@gmail.com>2021-01-23 13:40:07 -0600
commite9108aa3e747cd5798a4768e7cf9c5aa65d53395 (patch)
treed357e990eac824f187995dea89833a5447522c21 /src/slskd/Common/Options/RuntimeOptions.cs
parent9b433eb9266f26f21c82def6b6c720974a8a0bde (diff)
downloadslskd-e9108aa3e747cd5798a4768e7cf9c5aa65d53395.tar.gz
move Configuration
Diffstat (limited to 'src/slskd/Common/Options/RuntimeOptions.cs')
-rw-r--r--src/slskd/Common/Options/RuntimeOptions.cs156
1 files changed, 0 insertions, 156 deletions
diff --git a/src/slskd/Common/Options/RuntimeOptions.cs b/src/slskd/Common/Options/RuntimeOptions.cs
deleted file mode 100644
index cded2334..00000000
--- a/src/slskd/Common/Options/RuntimeOptions.cs
+++ /dev/null
@@ -1,156 +0,0 @@
-namespace slskd
-{
- using System;
- using System.Collections.Generic;
-
- public class RuntimeOptions
- {
- public static IEnumerable<EnvironmentVariable> EnvironmentVariableMap => new[]
- {
- new EnvironmentVariable {
- Description = "run in debug mode",
- Name = "SLSK_DEBUG",
- Key = "slskd:debug"
- },
- new EnvironmentVariable {
- Description = "optional; a unique name for this instance",
- Name = "SLSK_INSTANCE_NAME",
- Key = "slskd:instancename"
- },
- new EnvironmentVariable {
- Description = "enable collection and publish of prometheus metrics",
- Name = "SLSK_PROMETHEUS",
- Key = "slskd:feature:prometheus"
- },
- new EnvironmentVariable {
- Description = "enable swagger documentation",
- Name = "SLSK_SWAGGER",
- Key = "slskd:feature:swagger"
- },
- new EnvironmentVariable {
- Description = "jwt signing key",
- Name = "SLSKD_JWT_KEY",
- Key = "slskd:web:jwt:key"
- }
- };
-
- public static IEnumerable<Argument> ArgumentMap => new[]
- {
- new Argument
- {
- Description = "print usage",
- ShortName = 'h',
- LongName = "help",
- Key = "slskd:showhelp"
- },
- new Argument {
- Description = "display version information",
- ShortName = 'v',
- LongName = "version",
- Key = "slskd:showversion"
- },
- new Argument {
- Description = "run in debug mode",
- ShortName = 'd',
- LongName = "debug",
- Key = "slskd:debug"
- },
- new Argument
- {
- Description = "",
- ShortName = 'i',
- LongName = "instance-name",
- Key = "slskd:instancename"
- }
- };
-
- public class slskd
- {
- public bool ShowHelp { get; private set; } = false;
- public bool ShowVersion { get; private set; } = false;
- public bool Debug { get; private set; } = false;
- public bool NoLogo { get; private set; } = false;
- public bool NoAuth { get; private set; } = false;
- public string InstanceName { get; private set; } = "default";
- 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 class FeatureOptions
- {
- public bool Prometheus { get; private set; } = false;
- public bool Swagger { get; private set; } = false;
- }
-
- public class LoggerOptions
- {
- public string Loki { get; private set; } = null;
- }
-
- public class WebOptions
- {
- public string UrlBase { get; private set; } = "/";
- public string ContentPath { get; private set; } = "wwwroot";
- public JwtOptions Jwt { get; private set; } = new JwtOptions();
-
- public class JwtOptions
- {
- public int TTL { get; private set; } = 1234567890;
- public string Key { get; private set; } = Guid.NewGuid().ToString();
- }
- }
- }
-
- public class Soulseek
- {
- public string Username { get; set; } = InstanceOptions.Username;
- public string Password { get; set; } = InstanceOptions.Password;
- 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 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;
- }
- }
- }
-
- public class Authentication
- {
- public IEnumerable<User> Users { get; set; }
- public IEnumerable<ApiKey> ApiKeys { get; set; }
-
- public class User
- {
- public string Name { get; set; }
- public string Password { get; set; }
- public Role Role { get; set; }
- }
-
- public class ApiKey
- {
- public string Key { get; set; }
- public Role Role { get; set; }
- }
- }
- }
-}