Skip to content

Commit

Permalink
New: Add application URL to host configuration settings
Browse files Browse the repository at this point in the history
(cherry picked from commit 762042ba97c2ae689cee32d8e66a458f6d7a8adc)
  • Loading branch information
onedr0p authored and mynameisbogdan committed May 8, 2023
1 parent 1a5e41d commit 2028361
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
16 changes: 16 additions & 0 deletions frontend/src/Settings/General/HostSettings.js
Expand Up @@ -21,6 +21,7 @@ function HostSettings(props) {
port,
urlBase,
instanceName,
applicationUrl,
enableSsl,
sslPort,
sslCertPath,
Expand Down Expand Up @@ -89,6 +90,21 @@ function HostSettings(props) {
/>
</FormGroup>

<FormGroup
advancedSettings={advancedSettings}
isAdvanced={true}
>
<FormLabel>{translate('ApplicationURL')}</FormLabel>

<FormInputGroup
type={inputTypes.TEXT}
name="applicationUrl"
helpText={translate('ApplicationUrlHelpText')}
onChange={onInputChange}
{...applicationUrl}
/>
</FormGroup>

<FormGroup
advancedSettings={advancedSettings}
isAdvanced={true}
Expand Down
2 changes: 2 additions & 0 deletions src/NzbDrone.Core/Configuration/ConfigService.cs
Expand Up @@ -182,6 +182,8 @@ public string UILanguage
public CertificateValidationType CertificateValidation =>
GetValueEnum("CertificateValidation", CertificateValidationType.Enabled);

public string ApplicationUrl => GetValue("ApplicationUrl", string.Empty);

private string GetValue(string key)
{
return GetValue(key, string.Empty);
Expand Down
1 change: 1 addition & 0 deletions src/NzbDrone.Core/Configuration/IConfigService.cs
Expand Up @@ -55,5 +55,6 @@ public interface IConfigService
bool LogIndexerResponse { get; set; }

CertificateValidationType CertificateValidation { get; }
string ApplicationUrl { get; }
}
}
4 changes: 3 additions & 1 deletion src/NzbDrone.Core/Localization/Core/en.json
Expand Up @@ -34,6 +34,8 @@
"ApplicationLongTermStatusCheckSingleClientMessage": "Applications unavailable due to failures for more than 6 hours: {0}",
"ApplicationStatusCheckAllClientMessage": "All applications are unavailable due to failures",
"ApplicationStatusCheckSingleClientMessage": "Applications unavailable due to failures: {0}",
"ApplicationURL": "Application URL",
"ApplicationUrlHelpText": "This application's external URL including http(s)://, port and URL base",
"Applications": "Applications",
"Apply": "Apply",
"ApplyTags": "Apply Tags",
Expand Down Expand Up @@ -508,4 +510,4 @@
"Yes": "Yes",
"YesCancel": "Yes, Cancel",
"Yesterday": "Yesterday"
}
}
2 changes: 2 additions & 0 deletions src/Prowlarr.Api.V1/Config/HostConfigResource.cs
Expand Up @@ -27,6 +27,7 @@ public class HostConfigResource : RestResource
public string SslCertPassword { get; set; }
public string UrlBase { get; set; }
public string InstanceName { get; set; }
public string ApplicationUrl { get; set; }
public bool UpdateAutomatically { get; set; }
public UpdateMechanism UpdateMechanism { get; set; }
public string UpdateScriptPath { get; set; }
Expand Down Expand Up @@ -86,6 +87,7 @@ public static HostConfigResource ToResource(this IConfigFileProvider model, ICon
BackupFolder = configService.BackupFolder,
BackupInterval = configService.BackupInterval,
BackupRetention = configService.BackupRetention,
ApplicationUrl = configService.ApplicationUrl,
HistoryCleanupDays = configService.HistoryCleanupDays
};
}
Expand Down

0 comments on commit 2028361

Please sign in to comment.