-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add configurable IceServers and concurrent update count.
- Loading branch information
Showing
19 changed files
with
126 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,46 @@ | ||
using Microsoft.Extensions.Configuration; | ||
using Remotely.Shared.Models; | ||
|
||
namespace Remotely.Server.Services | ||
{ | ||
public class ApplicationConfig | ||
{ | ||
private IceServerModel[] fallbackIceServers = new IceServerModel[] | ||
{ | ||
new IceServerModel() { Url = "stun: stun.l.google.com:19302"}, | ||
new IceServerModel() { Url = "stun: stun4.l.google.com:19302"} | ||
}; | ||
|
||
public ApplicationConfig(IConfiguration config) | ||
{ | ||
Config = config; | ||
} | ||
public bool AllowApiLogin => bool.Parse(Config["ApplicationOptions:AllowApiLogin"]); | ||
public double DataRetentionInDays => double.Parse(Config["ApplicationOptions:DataRetentionInDays"]); | ||
public string DBProvider => Config["ApplicationOptions:DBProvider"]; | ||
public string DefaultPrompt => Config["ApplicationOptions:DefaultPrompt"]; | ||
|
||
public bool AllowApiLogin => bool.Parse(Config["ApplicationOptions:AllowApiLogin"] ?? "false"); | ||
public double DataRetentionInDays => double.Parse(Config["ApplicationOptions:DataRetentionInDays"] ?? "30"); | ||
public string DBProvider => Config["ApplicationOptions:DBProvider"] ?? "SQLite"; | ||
public string DefaultPrompt => Config["ApplicationOptions:DefaultPrompt"] ?? "~>"; | ||
public bool EnableWindowsEventLog => bool.Parse(Config["ApplicationOptions:EnableWindowsEventLog"]); | ||
public IceServerModel[] IceServers => Config.GetSection("ApplicationOptions:IceServers").Get<IceServerModel[]>() ?? fallbackIceServers; | ||
public string[] KnownProxies => Config.GetSection("ApplicationOptions:KnownProxies").Get<string[]>(); | ||
public int MaxOrganizationCount => int.Parse(Config["ApplicationOptions:MaxOrganizationCount"]); | ||
public bool RecordRemoteControlSessions => bool.Parse(Config["ApplicationOptions:RecordRemoteControlSessions"]); | ||
public bool RedirectToHttps => bool.Parse(Config["ApplicationOptions:RedirectToHttps"]); | ||
public bool RemoteControlRequiresAuthentication => bool.Parse(Config["ApplicationOptions:RemoteControlRequiresAuthentication"]); | ||
public double RemoteControlSessionLimit => double.Parse(Config["ApplicationOptions:RemoteControlSessionLimit"]); | ||
public bool Require2FA => bool.Parse(Config["ApplicationOptions:Require2FA"]); | ||
public int MaxConcurrentUpdates => int.Parse(Config["ApplicationOptions:MaxConcurrentUpdates"] ?? "10"); | ||
public int MaxOrganizationCount => int.Parse(Config["ApplicationOptions:MaxOrganizationCount"] ?? "1"); | ||
public bool RecordRemoteControlSessions => bool.Parse(Config["ApplicationOptions:RecordRemoteControlSessions"] ?? "false"); | ||
public bool RedirectToHttps => bool.Parse(Config["ApplicationOptions:RedirectToHttps"] ?? "false"); | ||
public bool RemoteControlRequiresAuthentication => bool.Parse(Config["ApplicationOptions:RemoteControlRequiresAuthentication"] ?? "true"); | ||
public double RemoteControlSessionLimit => double.Parse(Config["ApplicationOptions:RemoteControlSessionLimit"] ?? "3"); | ||
public bool Require2FA => bool.Parse(Config["ApplicationOptions:Require2FA"] ?? "false"); | ||
public string SmtpDisplayName => Config["ApplicationOptions:SmtpDisplayName"]; | ||
public string SmtpEmail => Config["ApplicationOptions:SmtpEmail"]; | ||
public bool SmtpEnableSsl => bool.Parse(Config["ApplicationOptions:SmtpEnableSsl"]); | ||
public bool SmtpEnableSsl => bool.Parse(Config["ApplicationOptions:SmtpEnableSsl"] ?? "true"); | ||
public string SmtpHost => Config["ApplicationOptions:SmtpHost"]; | ||
public string SmtpPassword => Config["ApplicationOptions:SmtpPassword"]; | ||
public int SmtpPort => int.Parse(Config["ApplicationOptions:SmtpPort"]); | ||
public string SmtpUserName => Config["ApplicationOptions:SmtpUserName"]; | ||
public string Theme => Config["ApplicationOptions:Theme"]; | ||
public string[] TrustedCorsOrigins => Config.GetSection("ApplicationOptions:TrustedCorsOrigins").Get<string[]>(); | ||
public bool UseHsts => bool.Parse(Config["ApplicationOptions:UseHsts"]); | ||
public bool UseWebRtc => bool.Parse(Config["ApplicationOptions:UseWebRtc"]); | ||
public bool UseHsts => bool.Parse(Config["ApplicationOptions:UseHsts"] ?? "false"); | ||
public bool UseWebRtc => bool.Parse(Config["ApplicationOptions:UseWebRtc"] ?? "true"); | ||
private IConfiguration Config { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export class IceServerModel { | ||
Url: string; | ||
TurnPassword: string; | ||
TurnUsername: string; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.