mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-13 00:32:57 -07:00
Fixed the issue with the Identity Server running on a different port, we can now use -url #865
This commit is contained in:
parent
9d435ccc0f
commit
c196dce843
22 changed files with 499 additions and 2566 deletions
|
@ -21,7 +21,7 @@ namespace Ombi.Schedule
|
|||
{
|
||||
RecurringJob.AddOrUpdate(() => Cacher.CacheContent(), Cron.Hourly);
|
||||
RecurringJob.AddOrUpdate(() => RadarrCacher.CacheContent(), Cron.Hourly);
|
||||
RecurringJob.AddOrUpdate(() => Updater.Update(), Cron.Hourly);
|
||||
//RecurringJob.AddOrUpdate(() => Updater.Update(), Cron.Hourly);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ namespace Ombi.Store.Context
|
|||
EntityEntry<TEntity> Attach<TEntity>(TEntity entity) where TEntity : class;
|
||||
DbSet<TEntity> Set<TEntity>() where TEntity : class;
|
||||
DbSet<NotificationTemplates> NotificationTemplates { get; set; }
|
||||
DbSet<ApplicationConfiguration> ApplicationConfigurations { get; set; }
|
||||
void Seed();
|
||||
|
||||
DbSet<MovieRequests> MovieRequests { get; set; }
|
||||
|
|
|
@ -34,6 +34,8 @@ namespace Ombi.Store.Context
|
|||
public DbSet<MovieIssues> MovieIssues { get; set; }
|
||||
public DbSet<TvIssues> TvIssues { get; set; }
|
||||
|
||||
public DbSet<ApplicationConfiguration> ApplicationConfigurations { get; set; }
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
optionsBuilder.UseSqlite("Data Source=Ombi.db");
|
||||
|
|
16
src/Ombi.Store/Entities/ApplicationConfiguration.cs
Normal file
16
src/Ombi.Store/Entities/ApplicationConfiguration.cs
Normal file
|
@ -0,0 +1,16 @@
|
|||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ombi.Store.Entities
|
||||
{
|
||||
[Table("ApplicationConfiguration")]
|
||||
public class ApplicationConfiguration : Entity
|
||||
{
|
||||
public ConfigurationTypes Type { get; set; }
|
||||
public string Value { get; set; }
|
||||
}
|
||||
|
||||
public enum ConfigurationTypes
|
||||
{
|
||||
Url,
|
||||
}
|
||||
}
|
|
@ -4,14 +4,14 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
|
|||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Ombi.Store.Context;
|
||||
using Ombi.Helpers;
|
||||
using Ombi.Store.Entities;
|
||||
using Ombi.Helpers;
|
||||
|
||||
namespace Ombi.Store.Migrations
|
||||
{
|
||||
[DbContext(typeof(OmbiContext))]
|
||||
[Migration("20170719072204_Initial")]
|
||||
partial class Initial
|
||||
[Migration("20170728131851_Inital")]
|
||||
partial class Inital
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
|
@ -125,6 +125,20 @@ namespace Ombi.Store.Migrations
|
|||
b.ToTable("AspNetUserTokens");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Ombi.Store.Entities.ApplicationConfiguration", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<int>("Type");
|
||||
|
||||
b.Property<string>("Value");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("ApplicationConfiguration");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Ombi.Store.Entities.GlobalSettings", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
|
@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
||||
namespace Ombi.Store.Migrations
|
||||
{
|
||||
public partial class Initial : Migration
|
||||
public partial class Inital : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
@ -36,6 +36,20 @@ namespace Ombi.Store.Migrations
|
|||
table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ApplicationConfiguration",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Type = table.Column<int>(nullable: false),
|
||||
Value = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ApplicationConfiguration", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "GlobalSettings",
|
||||
columns: table => new
|
||||
|
@ -528,6 +542,9 @@ namespace Ombi.Store.Migrations
|
|||
migrationBuilder.DropTable(
|
||||
name: "AspNetUserTokens");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ApplicationConfiguration");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "GlobalSettings");
|
||||
|
|
@ -4,8 +4,8 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
|
|||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Ombi.Store.Context;
|
||||
using Ombi.Helpers;
|
||||
using Ombi.Store.Entities;
|
||||
using Ombi.Helpers;
|
||||
|
||||
namespace Ombi.Store.Migrations
|
||||
{
|
||||
|
@ -124,6 +124,20 @@ namespace Ombi.Store.Migrations
|
|||
b.ToTable("AspNetUserTokens");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Ombi.Store.Entities.ApplicationConfiguration", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<int>("Type");
|
||||
|
||||
b.Property<string>("Value");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("ApplicationConfiguration");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Ombi.Store.Entities.GlobalSettings", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
|
|
|
@ -1 +1 @@
|
|||
dotnet ef migrations add MIGRATIONNAME --context OmbiContext --startup-project ../Ombi/Ombi.csproj
|
||||
dotnet ef migrations add Inital --context OmbiContext --startup-project ../Ombi/Ombi.csproj
|
|
@ -19,13 +19,13 @@
|
|||
|
||||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
||||
<ul class="nav navbar-nav">
|
||||
<li [routerLinkActive]="['active']"><a [routerLink]="['/search']"><i class="fa fa-search"></i> Search</a></li>
|
||||
<li id="Search" [routerLinkActive]="['active']"><a [routerLink]="['/search']"><i class="fa fa-search"></i> Search</a></li>
|
||||
</ul>
|
||||
<ul class="nav navbar-nav">
|
||||
<li [routerLinkActive]="['active']"><a [routerLink]="['/requests']"><i class="fa fa-plus"></i> Requests</a></li>
|
||||
<li id="Requests" [routerLinkActive]="['active']"><a [routerLink]="['/requests']"><i class="fa fa-plus"></i> Requests</a></li>
|
||||
</ul>
|
||||
<ul *ngIf="hasRole('Admin') || hasRole('PowerUser')" class="nav navbar-nav">
|
||||
<li [routerLinkActive]="['active']"><a [routerLink]="['/usermanagement']"><i class="fa fa-user"></i> User Management</a></li>
|
||||
<li id="UserManagement" [routerLinkActive]="['active']"><a [routerLink]="['/usermanagement']"><i class="fa fa-user"></i> User Management</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import { ILocalUser } from './auth/IUserLogin';
|
|||
|
||||
import { ICustomizationSettings } from './interfaces/ISettings';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'ombi',
|
||||
templateUrl: './app.component.html',
|
||||
|
@ -21,7 +22,9 @@ export class AppComponent implements OnInit {
|
|||
customizationSettings: ICustomizationSettings;
|
||||
user: ILocalUser;
|
||||
|
||||
ngOnInit() : void {
|
||||
ngOnInit(): void {
|
||||
|
||||
|
||||
|
||||
this.user = this.authService.claims();
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ import { SettingsService } from '../services/settings.service';
|
|||
import { ICustomizationSettings } from '../interfaces/ISettings';
|
||||
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: './login.component.html',
|
||||
styleUrls: ['./login.component.scss']
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 col-md-push-9">
|
||||
<div class="col-md-1 col-md-push-9"> <!--// TODO ADMIN-->
|
||||
<form>
|
||||
<button style="text-align: right" (click)="approve(child)" class="btn btn-sm btn-success-outline" type="submit"><i class="fa fa-plus"></i> Approve</button>
|
||||
<button style="text-align: right" *ngIf="child.CanApprove" (click)="approve(child)" class="btn btn-sm btn-success-outline" type="submit"><i class="fa fa-plus"></i> Approve</button>
|
||||
</form>
|
||||
<form>
|
||||
<button type="button" (click)="deny(child)" class="btn btn-sm btn-danger-outline deny"><i class="fa fa-times"></i> Deny</button>
|
||||
|
|
|
@ -57,6 +57,7 @@
|
|||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Design" Version="1.1.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.1.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="1.1.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.2" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.2" />
|
||||
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.0.0-alpha6-79" />
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Ombi.Store.Context;
|
||||
using Ombi.Store.Entities;
|
||||
|
||||
namespace Ombi
|
||||
{
|
||||
|
@ -11,12 +12,51 @@ namespace Ombi
|
|||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine(Directory.GetCurrentDirectory());
|
||||
Console.Title = "Ombi";
|
||||
var urlArgs = "http://*:5000";
|
||||
if (args.Length <= 0)
|
||||
{
|
||||
Console.WriteLine("No URL provided, we will run on \"http://localhost:5000\"");
|
||||
Console.WriteLine("Please provider the argument -url e.g. \"ombi.exe -url http://ombi.io:80/\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (args[0].Contains("-url"))
|
||||
{
|
||||
urlArgs = args[0].Replace("-url ", string.Empty);
|
||||
}
|
||||
}
|
||||
var urlValue = string.Empty;
|
||||
using (var ctx = new OmbiContext())
|
||||
{
|
||||
var url = ctx.ApplicationConfigurations.FirstOrDefault(x => x.Type == ConfigurationTypes.Url);
|
||||
if (url == null)
|
||||
{
|
||||
url = new ApplicationConfiguration
|
||||
{
|
||||
Type = ConfigurationTypes.Url,
|
||||
Value = "http://*:5000"
|
||||
};
|
||||
|
||||
ctx.ApplicationConfigurations.Add(url);
|
||||
ctx.SaveChanges();
|
||||
urlValue = url.Value;
|
||||
}
|
||||
else if (!url.Value.Equals(urlArgs))
|
||||
{
|
||||
url.Value = urlArgs;
|
||||
ctx.SaveChanges();
|
||||
urlValue = url.Value;
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine($"We are running on {urlValue}");
|
||||
|
||||
var host = new WebHostBuilder()
|
||||
.UseKestrel()
|
||||
.UseContentRoot(Directory.GetCurrentDirectory())
|
||||
.UseIISIntegration()
|
||||
.UseUrls(urlValue)
|
||||
.UseStartup<Startup>()
|
||||
.Build();
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"commandLineArgs": "server.urls=http://*:3579",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.Principal;
|
||||
using AutoMapper;
|
||||
using AutoMapper.EquivalencyExpression;
|
||||
|
@ -10,6 +11,7 @@ using IdentityServer4.Services;
|
|||
using IdentityServer4.Validation;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Hosting.Server.Features;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
||||
using Microsoft.AspNetCore.SpaServices.Webpack;
|
||||
|
@ -181,11 +183,17 @@ namespace Ombi
|
|||
var options = (IOptions<UserSettings>) app.ApplicationServices.GetService(
|
||||
typeof(IOptions<UserSettings>));
|
||||
|
||||
var ctx = (IOmbiContext)app.ApplicationServices.GetService(typeof(IOmbiContext));
|
||||
|
||||
// Get the url
|
||||
var url = ctx.ApplicationConfigurations.FirstOrDefault(x => x.Type == ConfigurationTypes.Url);
|
||||
|
||||
Console.WriteLine($"Using Url {url.Value} for Identity Server");
|
||||
app.UseIdentity();
|
||||
app.UseIdentityServer();
|
||||
app.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions
|
||||
{
|
||||
Authority = options.Value.WebsiteUrl,
|
||||
Authority = url.Value,
|
||||
ApiName = "api",
|
||||
ApiSecret = "secret",
|
||||
|
||||
|
@ -234,7 +242,6 @@ namespace Ombi
|
|||
|
||||
// Setup the scheduler
|
||||
var jobSetup = (IJobSetup)app.ApplicationServices.GetService(typeof(IJobSetup));
|
||||
var ctx = (IOmbiContext)app.ApplicationServices.GetService(typeof(IOmbiContext));
|
||||
jobSetup.Setup();
|
||||
ctx.Seed();
|
||||
|
||||
|
|
3
src/Ombi/hosting.json
Normal file
3
src/Ombi/hosting.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"server.urls": "http://localhost:5010;http://localhost:5012"
|
||||
}
|
2898
src/Ombi/package-lock.json
generated
2898
src/Ombi/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -19,6 +19,7 @@
|
|||
"@angular/router": "4.1.3",
|
||||
"@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.26",
|
||||
"@types/core-js": "^0.9.41",
|
||||
"@types/intro.js": "^2.4.2",
|
||||
"@types/node": "7.0.23",
|
||||
"angular2-jwt": "^0.2.3",
|
||||
"angular2-moment": "^1.3.3",
|
||||
|
@ -40,6 +41,7 @@
|
|||
"gulp-run": "^1.7.1",
|
||||
"hammerjs": "^2.0.8",
|
||||
"html-loader": "0.4.5",
|
||||
"intro.js-mit": "^3.0.0",
|
||||
"jquery": "3.2.1",
|
||||
"ng2-dragula": "1.5.0",
|
||||
"ngx-infinite-scroll": "^0.5.1",
|
||||
|
|
2
src/Ombi/typings/globals/globals.d.ts
vendored
2
src/Ombi/typings/globals/globals.d.ts
vendored
|
@ -3,7 +3,7 @@
|
|||
declare var module: any;
|
||||
declare var require: any;
|
||||
declare var localStorage: any;
|
||||
|
||||
declare var introJs: any;
|
||||
|
||||
declare module "*.css" {
|
||||
let string: string;
|
||||
|
|
1
src/Ombi/typings/index.d.ts
vendored
1
src/Ombi/typings/index.d.ts
vendored
|
@ -1 +1,2 @@
|
|||
/// <reference path="globals/globals.d.ts" />
|
||||
/// <reference path="../node_modules/@types/intro.js/index.d.ts" />
|
|
@ -46,6 +46,8 @@ module.exports = function (env) {
|
|||
'font-awesome/scss/font-awesome.scss',
|
||||
'pace-progress',
|
||||
'pace-progress/themes/orange/pace-theme-flash.css',
|
||||
'intro.js-mit/intro.js',
|
||||
'intro.js-mit/introjs.css',
|
||||
//'ng2-dragula',
|
||||
//'dragula/dist/dragula.min.css'
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue