diff --git a/src/Ombi.Settings/Settings/Models/OmbiSettings.cs b/src/Ombi.Settings/Settings/Models/OmbiSettings.cs
index da13109b0..9cacbd8e2 100644
--- a/src/Ombi.Settings/Settings/Models/OmbiSettings.cs
+++ b/src/Ombi.Settings/Settings/Models/OmbiSettings.cs
@@ -2,7 +2,7 @@
{
public class OmbiSettings : Models.Settings
{
- //public string BaseUrl { get; set; }
+ public string BaseUrl { get; set; }
public bool CollectAnalyticData { get; set; }
public bool Wizard { get; set; }
public string ApiKey { get; set; }
diff --git a/src/Ombi/ClientApp/app/interfaces/ISettings.ts b/src/Ombi/ClientApp/app/interfaces/ISettings.ts
index e4bb69391..2dfcdad32 100644
--- a/src/Ombi/ClientApp/app/interfaces/ISettings.ts
+++ b/src/Ombi/ClientApp/app/interfaces/ISettings.ts
@@ -9,7 +9,7 @@ export interface IExternalSettings extends ISettings {
export interface IOmbiSettings extends ISettings {
port: number;
- //baseUrl:string,
+ baseUrl: string;
collectAnalyticData: boolean;
wizard: boolean;
apiKey: string;
diff --git a/src/Ombi/ClientApp/app/settings/ombi/ombi.component.html b/src/Ombi/ClientApp/app/settings/ombi/ombi.component.html
index f3a8d5053..ac2d05ac5 100644
--- a/src/Ombi/ClientApp/app/settings/ombi/ombi.component.html
+++ b/src/Ombi/ClientApp/app/settings/ombi/ombi.component.html
@@ -20,7 +20,7 @@
-->
-
+
+
+
@@ -56,5 +63,6 @@
+
\ No newline at end of file
diff --git a/src/Ombi/ClientApp/app/settings/ombi/ombi.component.ts b/src/Ombi/ClientApp/app/settings/ombi/ombi.component.ts
index 49075a1dc..b481dd1bd 100644
--- a/src/Ombi/ClientApp/app/settings/ombi/ombi.component.ts
+++ b/src/Ombi/ClientApp/app/settings/ombi/ombi.component.ts
@@ -23,6 +23,7 @@ export class OmbiComponent implements OnInit {
apiKey: [x.apiKey],
externalUrl: [x.externalUrl],
allowExternalUsersToAuthenticate: [x.allowExternalUsersToAuthenticate],
+ baseUrl: [x.baseUrl],
});
});
}
diff --git a/src/Ombi/Startup.cs b/src/Ombi/Startup.cs
index 1aca98b63..9fd750da9 100644
--- a/src/Ombi/Startup.cs
+++ b/src/Ombi/Startup.cs
@@ -45,7 +45,7 @@ using Swashbuckle.AspNetCore.Swagger;
namespace Ombi
{
- public partial class Startup
+ public class Startup
{
public Startup(IHostingEnvironment env)
{
@@ -167,7 +167,7 @@ namespace Ombi
app.UseAuthentication();
- //ApiKeyMiddlewear(app, serviceProvider);
+ ApiKeyMiddlewear(app, serviceProvider);
app.UseSwagger();
app.UseSwaggerUI(c =>
{
@@ -210,11 +210,7 @@ namespace Ombi
else
{
var identity = new GenericIdentity("API");
- identity.AddClaim(new System.Security.Claims.Claim("Origin", "Api"));
- identity.AddClaim(new System.Security.Claims.Claim("role", "Admin"));
-
- var principal = new GenericPrincipal(identity, new[] { "ApiUser" });
- // TODO need to think about if I require a JWT Token here.
+ var principal = new GenericPrincipal(identity, new[] {"Admin", "ApiUser"});
context.User = principal;
await next();
}
diff --git a/src/Ombi/TagHelpers/ReverseProxyTagHelper.cs b/src/Ombi/TagHelpers/ReverseProxyTagHelper.cs
new file mode 100644
index 000000000..684fd036e
--- /dev/null
+++ b/src/Ombi/TagHelpers/ReverseProxyTagHelper.cs
@@ -0,0 +1,24 @@
+using Microsoft.AspNetCore.Razor.TagHelpers;
+using Ombi.Core.Settings;
+using Ombi.Settings.Settings.Models;
+
+namespace Ombi.TagHelpers
+{
+ public class ReverseProxyTagHelper : TagHelper
+ {
+ public ReverseProxyTagHelper(ISettingsService c)
+ {
+ _ctx = c;
+ }
+
+ private readonly ISettingsService _ctx;
+
+ public override void Process(TagHelperContext context, TagHelperOutput output)
+ {
+ output.TagName = "base";
+ var s = _ctx.GetSettings();
+ var baseUrl = string.IsNullOrEmpty(s.BaseUrl) ? "/" : s.BaseUrl;
+ output.Attributes.SetAttribute("href", baseUrl);
+ }
+ }
+}
diff --git a/src/Ombi/Views/Shared/_Layout.cshtml b/src/Ombi/Views/Shared/_Layout.cshtml
index a42776fe3..07fd0f503 100644
--- a/src/Ombi/Views/Shared/_Layout.cshtml
+++ b/src/Ombi/Views/Shared/_Layout.cshtml
@@ -4,13 +4,13 @@
Ombi
-
+ @**@
+
-
@RenderBody()
diff --git a/src/Ombi/Views/_ViewImports.cshtml b/src/Ombi/Views/_ViewImports.cshtml
index 13274f512..99def46c2 100644
--- a/src/Ombi/Views/_ViewImports.cshtml
+++ b/src/Ombi/Views/_ViewImports.cshtml
@@ -1,4 +1,4 @@
@using Ombi
@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers"
@addTagHelper "*, Microsoft.AspNetCore.SpaServices"
-@*@addTagHelper *, MiniProfiler.AspNetCore.Mvc*@
\ No newline at end of file
+@addTagHelper *, Ombi
\ No newline at end of file