
public class AppConfiguration
{
    public static AppConfiguration Instance = new AppConfiguration();

    private AppConfiguration()
    {
        this.SignalAPIEndpointUri = Environment.GetEnvironmentVariable("SIGNAL_API_URI") ?? "http://192.168.1.108";
        this.SignalAPIEndpointPort = Environment.GetEnvironmentVariable("SIGNAL_API_PORT") ?? "8719";
        this.HostPhoneNumber = Environment.GetEnvironmentVariable("HOST_PHONE") ?? "+4367762751895";
        this.DatabaseUri = Environment.GetEnvironmentVariable("DB_URI") ?? "192.168.1.108";
        this.DatabasePort = Environment.GetEnvironmentVariable("DB_PORT") ?? "5477";
        this.DatabaseName = Environment.GetEnvironmentVariable("DB_NAME") ?? "sotd";
        this.DatabaseUser = Environment.GetEnvironmentVariable("DB_USER") ?? "sotd";
        this.DatabasePW = Environment.GetEnvironmentVariable("DB_PASS") ?? "SotdP0stgresP4ss";
        this.SignalGroupId = Environment.GetEnvironmentVariable("SIGNAL_GROUP_ID") ?? "group.Wmk1UTVQTnh0Sjd6a0xiOGhnTnMzZlNkc2p2Q3c0SXJiQkU2eDlNU0hyTT0=";
        this.WebUIBaseURL = Environment.GetEnvironmentVariable("WEB_BASE_URL") ?? "https://sotd.disi.dev/";
        this.UseBotTag = bool.Parse(Environment.GetEnvironmentVariable("USE_BOT_TAG") ?? "true");
        this.DaysBetweenRequests = int.Parse(Environment.GetEnvironmentVariable("DAYS_BETWEEN_REQUESTS") ?? "2");
        var managersGroupName = Environment.GetEnvironmentVariable("LDAP_ADMINGROUP") ?? "admins";
        var userGroupName = Environment.GetEnvironmentVariable("LDAP_USERGROUP") ?? "everybody";
        var bindValue = Environment.GetEnvironmentVariable("LDAP_BIND");
        this.SpotifyClientId = Environment.GetEnvironmentVariable("SPOTIFY_CLIENT_ID") ?? "0c59b625470b4ad1b70743e0254d17fd";
        this.SpotifyClientSecret = Environment.GetEnvironmentVariable("SPOTIFY_CLIENT_SECRET") ?? "04daaebd42fc47909c5cbd1f5cf23555";
        this.LDAPConfig = new ConfigurationAD()
        {
            Username = Environment.GetEnvironmentVariable("LDAP_BIND") ?? "cn=admin,dc=disi,dc=dev",
            Password = Environment.GetEnvironmentVariable("LDAP_PASS") ?? "adminPass2022!",
            Port = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("LDAP_BIND")) ? int.Parse(bindValue ?? "389") : 389,
            LDAPserver = Environment.GetEnvironmentVariable("LDAP_URL") ?? "192.168.1.108",
            LDAPQueryBase = Environment.GetEnvironmentVariable("LDAP_BASE") ?? "dc=disi,dc=dev",
            LDAPUserQueryBase = Environment.GetEnvironmentVariable("LDAP_BASE") ?? "ou=people,dc=disi,dc=dev",
            CrewGroup = $"cn={userGroupName},ou=groups,dc=disi,dc=dev",
            ManagerGroup = $"cn={managersGroupName},ou=groups,dc=disi,dc=dev"
        };
    }

    public string SignalAPIEndpointUri
    {
        get; private set;
    }

    public string SignalAPIEndpointPort
    {
        get; private set;
    }

    public string DatabaseUri
    {
        get; private set;
    }

    public string DatabasePort
    {
        get; private set;
    }

    public string DatabaseName
    {
        get; private set;
    }

    public string DatabaseUser
    {
        get; private set;
    }

    public string DatabasePW
    {
        get; private set;
    }

    public string SignalGroupId
    {
        get; private set;
    }

    public string HostPhoneNumber
    {
        get; private set;
    }

    public string WebUIBaseURL
    {
        get; private set;
    }

    public string SpotifyClientId
    {
        get; private set;
    }

    public string SpotifyClientSecret
    {
        get; private set;
    }

    public bool UseBotTag
    {
        get; private set;
    }

    public int DaysBetweenRequests
    {
        get; private set;
    }

    public ConfigurationAD LDAPConfig
    {
        get; private set;
    }
}