mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 21:03:17 -07:00
This commit is contained in:
parent
95c5c839f0
commit
0e6a1707f4
20 changed files with 44 additions and 18 deletions
26
build.cake
26
build.cake
|
@ -28,19 +28,19 @@ GitVersion versionInfo = null;
|
||||||
|
|
||||||
var buildSettings = new DotNetCoreBuildSettings
|
var buildSettings = new DotNetCoreBuildSettings
|
||||||
{
|
{
|
||||||
Framework = "netcoreapp1.1",
|
Framework = "netcoreapp2.0",
|
||||||
Configuration = "Release",
|
Configuration = "Release",
|
||||||
OutputDirectory = Directory(buildDir),
|
OutputDirectory = Directory(buildDir),
|
||||||
};
|
};
|
||||||
|
|
||||||
var publishSettings = new DotNetCorePublishSettings
|
var publishSettings = new DotNetCorePublishSettings
|
||||||
{
|
{
|
||||||
Framework = "netcoreapp1.1",
|
Framework = "netcoreapp2.0",
|
||||||
Configuration = "Release",
|
Configuration = "Release",
|
||||||
OutputDirectory = Directory(buildDir),
|
OutputDirectory = Directory(buildDir),
|
||||||
};
|
};
|
||||||
|
|
||||||
var artifactsFolder = buildDir + "/netcoreapp1.1/";
|
var artifactsFolder = buildDir + "/netcoreapp2.0/";
|
||||||
var windowsArtifactsFolder = artifactsFolder + "win10-x64/published";
|
var windowsArtifactsFolder = artifactsFolder + "win10-x64/published";
|
||||||
var osxArtifactsFolder = artifactsFolder + "osx.10.12-x64/published";
|
var osxArtifactsFolder = artifactsFolder + "osx.10.12-x64/published";
|
||||||
var ubuntuArtifactsFolder = artifactsFolder + "ubuntu.16.04-x64/published";
|
var ubuntuArtifactsFolder = artifactsFolder + "ubuntu.16.04-x64/published";
|
||||||
|
@ -151,10 +151,10 @@ Task("Publish-Windows")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
publishSettings.Runtime = "win10-x64";
|
publishSettings.Runtime = "win10-x64";
|
||||||
publishSettings.OutputDirectory = Directory(buildDir) + Directory("netcoreapp1.1/win10-x64/published");
|
publishSettings.OutputDirectory = Directory(buildDir) + Directory("netcoreapp2.0/win10-x64/published");
|
||||||
|
|
||||||
DotNetCorePublish("./src/Ombi/Ombi.csproj", publishSettings);
|
DotNetCorePublish("./src/Ombi/Ombi.csproj", publishSettings);
|
||||||
CopyFile(buildDir + "/netcoreapp1.1/win10-x64/Swagger.xml", buildDir + "/netcoreapp1.1/win10-x64/published/Swagger.xml");
|
CopyFile(buildDir + "/netcoreapp2.0/win10-x64/Swagger.xml", buildDir + "/netcoreapp2.0/win10-x64/published/Swagger.xml");
|
||||||
DotNetCorePublish("./src/Ombi.Updater/Ombi.Updater.csproj", publishSettings);
|
DotNetCorePublish("./src/Ombi.Updater/Ombi.Updater.csproj", publishSettings);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -162,10 +162,10 @@ Task("Publish-OSX")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
publishSettings.Runtime = "osx.10.12-x64";
|
publishSettings.Runtime = "osx.10.12-x64";
|
||||||
publishSettings.OutputDirectory = Directory(buildDir) + Directory("netcoreapp1.1/osx.10.12-x64/published");
|
publishSettings.OutputDirectory = Directory(buildDir) + Directory("netcoreapp2.0/osx.10.12-x64/published");
|
||||||
|
|
||||||
DotNetCorePublish("./src/Ombi/Ombi.csproj", publishSettings);
|
DotNetCorePublish("./src/Ombi/Ombi.csproj", publishSettings);
|
||||||
CopyFile(buildDir + "/netcoreapp1.1/osx.10.12-x64/Swagger.xml", buildDir + "/netcoreapp1.1/osx.10.12-x64/published/Swagger.xml");
|
CopyFile(buildDir + "/netcoreapp2.0/osx.10.12-x64/Swagger.xml", buildDir + "/netcoreapp2.0/osx.10.12-x64/published/Swagger.xml");
|
||||||
DotNetCorePublish("./src/Ombi.Updater/Ombi.Updater.csproj", publishSettings);
|
DotNetCorePublish("./src/Ombi.Updater/Ombi.Updater.csproj", publishSettings);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -173,30 +173,30 @@ Task("Publish-Ubuntu")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
publishSettings.Runtime = "ubuntu.16.04-x64";
|
publishSettings.Runtime = "ubuntu.16.04-x64";
|
||||||
publishSettings.OutputDirectory = Directory(buildDir) + Directory("netcoreapp1.1/ubuntu.16.04-x64/published");
|
publishSettings.OutputDirectory = Directory(buildDir) + Directory("netcoreapp2.0/ubuntu.16.04-x64/published");
|
||||||
|
|
||||||
DotNetCorePublish("./src/Ombi/Ombi.csproj", publishSettings);
|
DotNetCorePublish("./src/Ombi/Ombi.csproj", publishSettings);
|
||||||
CopyFile(buildDir + "/netcoreapp1.1/ubuntu.16.04-x64/Swagger.xml", buildDir + "/netcoreapp1.1/ubuntu.16.04-x64/published/Swagger.xml");
|
CopyFile(buildDir + "/netcoreapp2.0/ubuntu.16.04-x64/Swagger.xml", buildDir + "/netcoreapp2.0/ubuntu.16.04-x64/published/Swagger.xml");
|
||||||
DotNetCorePublish("./src/Ombi.Updater/Ombi.Updater.csproj", publishSettings);
|
DotNetCorePublish("./src/Ombi.Updater/Ombi.Updater.csproj", publishSettings);
|
||||||
});
|
});
|
||||||
Task("Publish-Debian")
|
Task("Publish-Debian")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
publishSettings.Runtime = "debian.8-x64";
|
publishSettings.Runtime = "debian.8-x64";
|
||||||
publishSettings.OutputDirectory = Directory(buildDir) + Directory("netcoreapp1.1/debian.8-x64/published");
|
publishSettings.OutputDirectory = Directory(buildDir) + Directory("netcoreapp2.0/debian.8-x64/published");
|
||||||
|
|
||||||
DotNetCorePublish("./src/Ombi/Ombi.csproj", publishSettings);
|
DotNetCorePublish("./src/Ombi/Ombi.csproj", publishSettings);
|
||||||
CopyFile(buildDir + "/netcoreapp1.1/debian.8-x64/Swagger.xml", buildDir + "/netcoreapp1.1/debian.8-x64/published/Swagger.xml");
|
CopyFile(buildDir + "/netcoreapp2.0/debian.8-x64/Swagger.xml", buildDir + "/netcoreapp2.0/debian.8-x64/published/Swagger.xml");
|
||||||
DotNetCorePublish("./src/Ombi.Updater/Ombi.Updater.csproj", publishSettings);
|
DotNetCorePublish("./src/Ombi.Updater/Ombi.Updater.csproj", publishSettings);
|
||||||
});
|
});
|
||||||
Task("Publish-Centos")
|
Task("Publish-Centos")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
publishSettings.Runtime = "centos.7-x64";
|
publishSettings.Runtime = "centos.7-x64";
|
||||||
publishSettings.OutputDirectory = Directory(buildDir) + Directory("netcoreapp1.1/centos.7-x64/published");
|
publishSettings.OutputDirectory = Directory(buildDir) + Directory("netcoreapp2.0/centos.7-x64/published");
|
||||||
|
|
||||||
DotNetCorePublish("./src/Ombi/Ombi.csproj", publishSettings);
|
DotNetCorePublish("./src/Ombi/Ombi.csproj", publishSettings);
|
||||||
CopyFile(buildDir + "/netcoreapp1.1/centos.7-x64/Swagger.xml", buildDir + "/netcoreapp1.1/centos.7-x64/published/Swagger.xml");
|
CopyFile(buildDir + "/netcoreapp2.0/centos.7-x64/Swagger.xml", buildDir + "/netcoreapp2.0/centos.7-x64/published/Swagger.xml");
|
||||||
DotNetCorePublish("./src/Ombi.Updater/Ombi.Updater.csproj", publishSettings);
|
DotNetCorePublish("./src/Ombi.Updater/Ombi.Updater.csproj", publishSettings);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
<FileVersion>3.0.0.0</FileVersion>
|
<FileVersion>3.0.0.0</FileVersion>
|
||||||
<Version></Version>
|
<Version></Version>
|
||||||
<PackageVersion></PackageVersion>
|
<PackageVersion></PackageVersion>
|
||||||
|
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
1
src/Ombi/.gitignore
vendored
1
src/Ombi/.gitignore
vendored
|
@ -20,3 +20,4 @@ testem.log
|
||||||
#/typings
|
#/typings
|
||||||
/systemjs.config.js*
|
/systemjs.config.js*
|
||||||
/Logs/**
|
/Logs/**
|
||||||
|
**.db
|
||||||
|
|
|
@ -14,6 +14,7 @@ namespace Ombi.Controllers.External
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Admin]
|
[Admin]
|
||||||
[ApiV1]
|
[ApiV1]
|
||||||
|
[Produces("application/json")]
|
||||||
public class EmbyController : Controller
|
public class EmbyController : Controller
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -15,6 +15,7 @@ namespace Ombi.Controllers.External
|
||||||
{
|
{
|
||||||
[Admin]
|
[Admin]
|
||||||
[ApiV1]
|
[ApiV1]
|
||||||
|
[Produces("application/json")]
|
||||||
public class PlexController : Controller
|
public class PlexController : Controller
|
||||||
{
|
{
|
||||||
public PlexController(IPlexApi plexApi, ISettingsService<PlexSettings> plexSettings)
|
public PlexController(IPlexApi plexApi, ISettingsService<PlexSettings> plexSettings)
|
||||||
|
|
|
@ -11,6 +11,7 @@ namespace Ombi.Controllers.External
|
||||||
{
|
{
|
||||||
[Admin]
|
[Admin]
|
||||||
[ApiV1]
|
[ApiV1]
|
||||||
|
[Produces("application/json")]
|
||||||
public class RadarrController : Controller
|
public class RadarrController : Controller
|
||||||
{
|
{
|
||||||
public RadarrController(IRadarrApi radarr, ISettingsService<RadarrSettings> settings)
|
public RadarrController(IRadarrApi radarr, ISettingsService<RadarrSettings> settings)
|
||||||
|
|
|
@ -12,6 +12,7 @@ namespace Ombi.Controllers.External
|
||||||
{
|
{
|
||||||
[Admin]
|
[Admin]
|
||||||
[ApiV1]
|
[ApiV1]
|
||||||
|
[Produces("application/json")]
|
||||||
public class SonarrController : Controller
|
public class SonarrController : Controller
|
||||||
{
|
{
|
||||||
public SonarrController(ISonarrApi sonarr, ISettingsService<SonarrSettings> settings)
|
public SonarrController(ISonarrApi sonarr, ISettingsService<SonarrSettings> settings)
|
||||||
|
|
|
@ -25,6 +25,7 @@ namespace Ombi.Controllers.External
|
||||||
/// <seealso cref="Ombi.Controllers.BaseV1ApiController" />
|
/// <seealso cref="Ombi.Controllers.BaseV1ApiController" />
|
||||||
[Admin]
|
[Admin]
|
||||||
[ApiV1]
|
[ApiV1]
|
||||||
|
[Produces("application/json")]
|
||||||
public class TesterController : Controller
|
public class TesterController : Controller
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -35,6 +35,7 @@ namespace Ombi.Controllers
|
||||||
/// <seealso cref="Ombi.Controllers.BaseV1ApiController" />
|
/// <seealso cref="Ombi.Controllers.BaseV1ApiController" />
|
||||||
[PowerUser]
|
[PowerUser]
|
||||||
[ApiV1]
|
[ApiV1]
|
||||||
|
[Produces("application/json")]
|
||||||
public class IdentityController : Controller
|
public class IdentityController : Controller
|
||||||
{
|
{
|
||||||
public IdentityController(UserManager<OmbiUser> user, IMapper mapper, RoleManager<IdentityRole> rm, IEmailProvider prov,
|
public IdentityController(UserManager<OmbiUser> user, IMapper mapper, RoleManager<IdentityRole> rm, IEmailProvider prov,
|
||||||
|
|
|
@ -11,6 +11,7 @@ using Ombi.Config;
|
||||||
namespace Ombi.Controllers
|
namespace Ombi.Controllers
|
||||||
{
|
{
|
||||||
[ApiV1]
|
[ApiV1]
|
||||||
|
[Produces("application/json")]
|
||||||
public class ImagesController : Controller
|
public class ImagesController : Controller
|
||||||
{
|
{
|
||||||
public ImagesController(IFanartTvApi api, IApplicationConfigRepository config, IOptions<LandingPageBackground> options)
|
public ImagesController(IFanartTvApi api, IApplicationConfigRepository config, IOptions<LandingPageBackground> options)
|
||||||
|
|
|
@ -13,6 +13,7 @@ namespace Ombi.Controllers
|
||||||
{
|
{
|
||||||
[ApiV1]
|
[ApiV1]
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
|
[Produces("application/json")]
|
||||||
public class LandingPageController
|
public class LandingPageController
|
||||||
{
|
{
|
||||||
public LandingPageController(ISettingsService<PlexSettings> plex, ISettingsService<EmbySettings> emby,
|
public LandingPageController(ISettingsService<PlexSettings> plex, ISettingsService<EmbySettings> emby,
|
||||||
|
|
|
@ -8,6 +8,7 @@ namespace Ombi.Controllers
|
||||||
{
|
{
|
||||||
[Authorize]
|
[Authorize]
|
||||||
[ApiV1]
|
[ApiV1]
|
||||||
|
[Produces("application/json")]
|
||||||
public class LoggingController : Controller
|
public class LoggingController : Controller
|
||||||
{
|
{
|
||||||
public LoggingController(ILogger logger)
|
public LoggingController(ILogger logger)
|
||||||
|
|
|
@ -13,6 +13,7 @@ namespace Ombi.Controllers
|
||||||
{
|
{
|
||||||
[Authorize]
|
[Authorize]
|
||||||
[ApiV1]
|
[ApiV1]
|
||||||
|
[Produces("application/json")]
|
||||||
public class RequestController : Controller
|
public class RequestController : Controller
|
||||||
{
|
{
|
||||||
public RequestController(IMovieRequestEngine engine, ITvRequestEngine tvRequestEngine)
|
public RequestController(IMovieRequestEngine engine, ITvRequestEngine tvRequestEngine)
|
||||||
|
|
|
@ -15,6 +15,7 @@ namespace Ombi.Controllers
|
||||||
{
|
{
|
||||||
[Authorize]
|
[Authorize]
|
||||||
[ApiV1]
|
[ApiV1]
|
||||||
|
[Produces("application/json")]
|
||||||
public class SearchController : Controller
|
public class SearchController : Controller
|
||||||
{
|
{
|
||||||
public SearchController(IMovieEngine movie, ITvSearchEngine tvEngine, ILogger<SearchController> logger)
|
public SearchController(IMovieEngine movie, ITvSearchEngine tvEngine, ILogger<SearchController> logger)
|
||||||
|
|
|
@ -30,6 +30,7 @@ namespace Ombi.Controllers
|
||||||
/// <seealso cref="Ombi.Controllers.BaseV1ApiController" />
|
/// <seealso cref="Ombi.Controllers.BaseV1ApiController" />
|
||||||
[Admin]
|
[Admin]
|
||||||
[ApiV1]
|
[ApiV1]
|
||||||
|
[Produces("application/json")]
|
||||||
public class SettingsController : Controller
|
public class SettingsController : Controller
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -37,6 +37,7 @@ using Ombi.Settings.Settings.Models;
|
||||||
namespace Ombi.Controllers
|
namespace Ombi.Controllers
|
||||||
{
|
{
|
||||||
[ApiV1]
|
[ApiV1]
|
||||||
|
[Produces("application/json")]
|
||||||
public class StatusController : Controller
|
public class StatusController : Controller
|
||||||
{
|
{
|
||||||
public StatusController(ISettingsService<OmbiSettings> ombi)
|
public StatusController(ISettingsService<OmbiSettings> ombi)
|
||||||
|
|
|
@ -18,6 +18,7 @@ using Ombi.Store.Repository;
|
||||||
namespace Ombi.Controllers
|
namespace Ombi.Controllers
|
||||||
{
|
{
|
||||||
[ApiV1]
|
[ApiV1]
|
||||||
|
[Produces("application/json")]
|
||||||
public class TokenController
|
public class TokenController
|
||||||
{
|
{
|
||||||
public TokenController(UserManager<OmbiUser> um, IOptions<TokenAuthentication> ta,
|
public TokenController(UserManager<OmbiUser> um, IOptions<TokenAuthentication> ta,
|
||||||
|
|
|
@ -41,6 +41,10 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Remove="Ombi.db" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AutoMapper" Version="6.1.0" />
|
<PackageReference Include="AutoMapper" Version="6.1.0" />
|
||||||
<PackageReference Include="CommandLineParser" Version="2.1.1-beta" />
|
<PackageReference Include="CommandLineParser" Version="2.1.1-beta" />
|
||||||
|
|
|
@ -71,11 +71,10 @@ namespace Ombi
|
||||||
public IConfigurationRoot Configuration { get; }
|
public IConfigurationRoot Configuration { get; }
|
||||||
|
|
||||||
// This method gets called by the runtime. Use this method to add services to the container.
|
// This method gets called by the runtime. Use this method to add services to the container.
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public IServiceProvider ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
// Add framework services.
|
// Add framework services.
|
||||||
services.AddDbContext<OmbiContext>(options =>
|
services.AddDbContext<OmbiContext>();
|
||||||
options.UseSqlite("Data Source=Ombi.db"));
|
|
||||||
|
|
||||||
services.AddIdentity<OmbiUser, IdentityRole>()
|
services.AddIdentity<OmbiUser, IdentityRole>()
|
||||||
.AddEntityFrameworkStores<OmbiContext>()
|
.AddEntityFrameworkStores<OmbiContext>()
|
||||||
|
@ -179,13 +178,20 @@ namespace Ombi
|
||||||
x.Audience = "Ombi";
|
x.Audience = "Ombi";
|
||||||
x.TokenValidationParameters = tokenValidationParameters;
|
x.TokenValidationParameters = tokenValidationParameters;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Build the intermediate service provider
|
||||||
|
var serviceProvider = services.BuildServiceProvider();
|
||||||
|
|
||||||
|
//return the provider
|
||||||
|
return serviceProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||||
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IMemoryCache cache)
|
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory,
|
||||||
|
IMemoryCache cache, IServiceProvider serviceProvider)
|
||||||
{
|
{
|
||||||
|
|
||||||
var ctx = (IOmbiContext)app.ApplicationServices.GetService(typeof(IOmbiContext));
|
var ctx = serviceProvider.GetService<IOmbiContext>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue