diff --git a/build.cake b/build.cake
index 27b0dfddc..4fa3ab07c 100644
--- a/build.cake
+++ b/build.cake
@@ -58,7 +58,7 @@ Task("Clean")
.Does(() =>
{
CleanDirectory(buildDir);
- CleanDirectory(nodeModulesDir);
+ //CleanDirectory(nodeModulesDir);
CleanDirectory(wwwRootDistDir);
});
@@ -80,8 +80,15 @@ Task("SetVersionInfo")
Information("GitResults -> {0}", versionInfo.Dump());
- buildSettings.ArgumentCustomization = args => args.Append("/p:SemVer=" + versionInfo.BuildMetaData);
- publishSettings.ArgumentCustomization = args => args.Append("/p:SemVer=" + versionInfo.BuildMetaData);
+ var fullVer = versionInfo.MajorMinorPatch + "-" + versionInfo.BranchName + "-" + versionInfo.BuildMetaData;
+
+
+ buildSettings.ArgumentCustomization = args => args.Append("/p:SemVer=" + versionInfo.AssemblySemVer);
+ buildSettings.ArgumentCustomization = args => args.Append("/p:FullVer=" + fullVer);
+ publishSettings.ArgumentCustomization = args => args.Append("/p:SemVer=" + versionInfo.AssemblySemVer);
+ publishSettings.ArgumentCustomization = args => args.Append("/p:FullVer=" + fullVer);
+ buildSettings.VersionSuffix = versionInfo.BranchName;
+ publishSettings.VersionSuffix = versionInfo.BranchName;
});
Task("Restore")
diff --git a/src/Ombi.Schedule/Ombi/Jobs/IOmbiAutomaticUpdater.cs b/src/Ombi.Schedule/Jobs/Ombi/IOmbiAutomaticUpdater.cs
similarity index 100%
rename from src/Ombi.Schedule/Ombi/Jobs/IOmbiAutomaticUpdater.cs
rename to src/Ombi.Schedule/Jobs/Ombi/IOmbiAutomaticUpdater.cs
diff --git a/src/Ombi.sln b/src/Ombi.sln
index d07e0d243..d8a94d046 100644
--- a/src/Ombi.sln
+++ b/src/Ombi.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
-VisualStudioVersion = 15.0.26730.10
+VisualStudioVersion = 15.0.26730.8
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi", "Ombi\Ombi.csproj", "{C987AA67-AFE1-468F-ACD3-EAD5A48E1F6A}"
EndProject
@@ -9,7 +9,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject
..\appveyor.yml = ..\appveyor.yml
..\build.cake = ..\build.cake
- ..\BuildTask.ps1 = ..\BuildTask.ps1
..\CHANGELOG.md = ..\CHANGELOG.md
..\global.json = ..\global.json
EndProjectSection
@@ -82,7 +81,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.Api.Pushover", "Ombi.A
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.Schedule.Tests", "Ombi.Schedule.Tests\Ombi.Schedule.Tests.csproj", "{BDD8B924-016E-4CDA-9FFA-50B0A34BCD3C}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ombi.Api.Telegram", "Ombi.Api.Telegram\Ombi.Api.Telegram.csproj", "{484A8CA4-C9DC-4033-971D-D9D8EABB957E}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.Api.Telegram", "Ombi.Api.Telegram\Ombi.Api.Telegram.csproj", "{484A8CA4-C9DC-4033-971D-D9D8EABB957E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/src/Ombi/Ombi.csproj b/src/Ombi/Ombi.csproj
index 2772d2f69..eb118ad76 100644
--- a/src/Ombi/Ombi.csproj
+++ b/src/Ombi/Ombi.csproj
@@ -7,7 +7,7 @@
2.3
$(SemVer)
$(SemVer)
- $(SemVer)
+ $(FullVer)
diff --git a/src/Ombi/Startup.cs b/src/Ombi/Startup.cs
index 7b715f0ef..21217cf00 100644
--- a/src/Ombi/Startup.cs
+++ b/src/Ombi/Startup.cs
@@ -124,7 +124,14 @@ namespace Ombi
{
Console.WriteLine(e);
}
-
+ c.AddSecurityDefinition("Bearer", new ApiKeyScheme()
+ {
+ Description = "JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"",
+ Name = "Authorization",
+ In = "header",
+ Type = "apiKey"
+ });
+
c.AddSecurityDefinition("Authentication", new ApiKeyScheme());
c.OperationFilter();
c.DescribeAllParametersInCamelCase();
@@ -189,9 +196,10 @@ namespace Ombi
app.UseHangfireServer();
app.UseHangfireDashboard();
- app.UseSwagger();
+
app.UseSwaggerUI(c =>
{
+
c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1");
c.ShowJsonEditor();
});
diff --git a/src/Ombi/SwaggerOperationFilter.cs b/src/Ombi/SwaggerOperationFilter.cs
index 83ebfbc21..82eb97fdb 100644
--- a/src/Ombi/SwaggerOperationFilter.cs
+++ b/src/Ombi/SwaggerOperationFilter.cs
@@ -1,5 +1,7 @@
using System.Collections.Generic;
using System.Linq;
+using System.Reflection.Metadata;
+using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Microsoft.AspNetCore.Mvc.Authorization;
using Swashbuckle.AspNetCore.Swagger;
using Swashbuckle.AspNetCore.SwaggerGen;
@@ -8,25 +10,19 @@ namespace Ombi
{
public class SwaggerOperationFilter : IOperationFilter
{
+ public string Name { get; private set; }
+
+ public SwaggerOperationFilter()
+ {
+ Name = "Authorization";
+ }
+
public void Apply(Operation operation, OperationFilterContext context)
{
- var filterPipeline = context.ApiDescription.ActionDescriptor.FilterDescriptors;
- var isAuthorized = filterPipeline.Select(filterInfo => filterInfo.Filter).Any(filter => filter is AuthorizeFilter);
- var allowAnonymous = filterPipeline.Select(filterInfo => filterInfo.Filter).Any(filter => filter is IAllowAnonymousFilter);
- if (isAuthorized && !allowAnonymous)
- {
- if (operation.Parameters == null)
- operation.Parameters = new List();
- operation.Parameters.Add(new NonBodyParameter
- {
- Name = "Authorization",
- In = "header",
- Description = "JWT token",
- Required = true,
- Type = "string",
- Default = "Bearer "
- });
- }
+ if (operation.Parameters == null)
+ operation.Parameters = new List();
+ var tokenAuthDict = new Dictionary> {{Name, new List()}};
+ operation.Security = new IDictionary>[] { tokenAuthDict };
}
}
}