Cleaning up

This commit is contained in:
Zoe Roux 2020-03-19 01:45:50 +01:00
parent eb37ec7d1b
commit e25e1276e4
5 changed files with 23 additions and 10 deletions

View File

@ -30,8 +30,8 @@ namespace Kyoo
RequireClientSecret = false, RequireClientSecret = false,
RequireConsent = false, RequireConsent = false,
AccessTokenType = AccessTokenType.Reference, AccessTokenType = AccessTokenType.Reference,
AllowedScopes = { "kyoo.admin", "kyoo.write", "kyoo.read", "openid", "profile" }, AllowedScopes = { "openid", "profile", "kyoo.read", "kyoo.write", "kyoo.play", "kyoo.download", "kyoo.admin" },
RedirectUris = { "/silent", "/" }, RedirectUris = { "/", "/silent" },
PostLogoutRedirectUris = { "/logout" } PostLogoutRedirectUris = { "/logout" }
} }
}; };
@ -57,6 +57,16 @@ namespace Kyoo
DisplayName = "Read and write access to the public API" DisplayName = "Read and write access to the public API"
}, },
new Scope new Scope
{
Name = "kyoo.play",
DisplayName = "Allow playback of movies and episodes."
},
new Scope
{
Name = "kyoo.download",
DisplayName = "Allow downloading of episodes and movies from kyoo."
},
new Scope
{ {
Name = "kyoo.admin", Name = "kyoo.admin",
DisplayName = "Full access to the admin's API and the public API." DisplayName = "Full access to the admin's API and the public API."

View File

@ -1,7 +1,9 @@
using System;
using System.Reflection; using System.Reflection;
using Kyoo.Api; using Kyoo.Api;
using Kyoo.Controllers; using Kyoo.Controllers;
using Kyoo.Models; using Kyoo.Models;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
@ -133,7 +135,7 @@ namespace Kyoo
if (env.IsDevelopment()) if (env.IsDevelopment())
{ {
spa.UseAngularCliServer(npmScript: "start"); spa.UseAngularCliServer("start");
} }
}); });
} }

View File

@ -52,7 +52,8 @@ namespace Kyoo.Api
_userManager = userManager; _userManager = userManager;
_signInManager = siginInManager; _signInManager = siginInManager;
_picturePath = configuration.GetValue<string>("profilePicturePath"); _picturePath = configuration.GetValue<string>("profilePicturePath");
if (!Path.IsPathRooted(_picturePath))
_picturePath = Path.GetFullPath(_picturePath);
} }
[HttpPost("register")] [HttpPost("register")]
@ -119,7 +120,7 @@ namespace Kyoo.Api
string path = Path.Combine(_picturePath, user.Id); string path = Path.Combine(_picturePath, user.Id);
if (!System.IO.File.Exists(path)) if (!System.IO.File.Exists(path))
return NotFound(); return NotFound();
return new PhysicalFileResult(path, "image"); return new PhysicalFileResult(path, "image/png");
} }
[HttpPost("update")] [HttpPost("update")]

@ -1 +1 @@
Subproject commit 54f9406c079894648b9a84a63aa7944c8d439ce4 Subproject commit 4d5b46ad07643e5524badc51ada3461b25e6d239

View File

@ -13,10 +13,10 @@
"Database": "Data Source=kyoo.db" "Database": "Data Source=kyoo.db"
}, },
"transmuxTempPath": "/tmp/cached/kyoo/transmux", "transmuxTempPath": "cached/kyoo/transmux",
"transcodeTempPath": "/tmp/cached/kyoo/transcode", "transcodeTempPath": "cached/kyoo/transcode",
"peoplePath": "/tmp/people", "peoplePath": "people",
"profilePicturePath": "/tmp/users/", "profilePicturePath": "users/",
"plugins": "plugins/", "plugins": "plugins/",
"regex": "(\\/(?<Collection>.*)\\/)?.*\\/(?<ShowTitle>.+?)(( S(?<Season>\\d+)E(?<Episode>\\d+)| (?<Absolute>\\d+)))?\\.", "regex": "(\\/(?<Collection>.*)\\/)?.*\\/(?<ShowTitle>.+?)(( S(?<Season>\\d+)E(?<Episode>\\d+)| (?<Absolute>\\d+)))?\\.",
} }