mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-29 05:16:34 +02:00
Merge branch 'api-key' into develop
Conflicts: NzbDrone.Integration.Test/NzbDroneRunner.cs
This commit is contained in:
@@ -28,13 +28,14 @@ namespace NzbDrone.Core.Configuration
|
||||
string Password { get; }
|
||||
string LogLevel { get; }
|
||||
string Branch { get; }
|
||||
string ApiKey { get; }
|
||||
bool Torrent { get; }
|
||||
string SslCertHash { get; }
|
||||
}
|
||||
|
||||
public class ConfigFileProvider : IConfigFileProvider
|
||||
{
|
||||
private const string CONFIG_ELEMENT_NAME = "Config";
|
||||
public const string CONFIG_ELEMENT_NAME = "Config";
|
||||
|
||||
private readonly IEventAggregator _eventAggregator;
|
||||
private readonly ICached<string> _cache;
|
||||
@@ -108,6 +109,14 @@ namespace NzbDrone.Core.Configuration
|
||||
get { return GetValueBoolean("LaunchBrowser", true); }
|
||||
}
|
||||
|
||||
public string ApiKey
|
||||
{
|
||||
get
|
||||
{
|
||||
return GetValue("ApiKey", Guid.NewGuid().ToString().Replace("-", ""));
|
||||
}
|
||||
}
|
||||
|
||||
public bool Torrent
|
||||
{
|
||||
get { return GetValueBoolean("Torrent", false, persist: false); }
|
||||
@@ -223,6 +232,8 @@ namespace NzbDrone.Core.Configuration
|
||||
var xDoc = new XDocument(new XDeclaration("1.0", "utf-8", "yes"));
|
||||
xDoc.Add(new XElement(CONFIG_ELEMENT_NAME));
|
||||
xDoc.Save(_configFile);
|
||||
|
||||
SaveConfigDictionary(GetConfigDictionary());
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user