mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-13 00:32:57 -07:00
Added the ability to automatically generate the API Key on startup if it does not exist #2070
This commit is contained in:
parent
a8f906617a
commit
f1e164d29a
1 changed files with 6 additions and 0 deletions
|
@ -165,6 +165,12 @@ namespace Ombi
|
||||||
var ombiService =
|
var ombiService =
|
||||||
app.ApplicationServices.GetService<ISettingsService<OmbiSettings>>();
|
app.ApplicationServices.GetService<ISettingsService<OmbiSettings>>();
|
||||||
var settings = ombiService.GetSettings();
|
var settings = ombiService.GetSettings();
|
||||||
|
if (settings.ApiKey.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
// Generate a API Key
|
||||||
|
settings.ApiKey = Guid.NewGuid().ToString("N");
|
||||||
|
ombiService.SaveSettings(settings);
|
||||||
|
}
|
||||||
if (settings.BaseUrl.HasValue())
|
if (settings.BaseUrl.HasValue())
|
||||||
{
|
{
|
||||||
app.UsePathBase(settings.BaseUrl);
|
app.UsePathBase(settings.BaseUrl);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue