diff --git a/deployment/kyoo-windows.iss b/deployment/kyoo-windows.iss index 276fe810..f6bb8aa2 100644 --- a/deployment/kyoo-windows.iss +++ b/deployment/kyoo-windows.iss @@ -9,7 +9,7 @@ AppUpdatesURL=https://github.com/AnonymusRaccoon/Kyoo DefaultDirName={commonpf}\Kyoo DisableProgramGroupPage=yes LicenseFile={#kyoo}\LICENSE -SetupIconFile={#kyoo}\wwwroot\favicon.ico +SetupIconFile={#kyoo}\wwwroot\icon-256x256.png Compression=lzma SolidCompression=yes WizardStyle=modern @@ -54,7 +54,7 @@ procedure InitializeWizard; begin DataDirPage := CreateInputDirPage(wpSelectDir, 'Choose Data Location', 'Choose the folder in which to install the Kyoo data', - 'The installer will set the following folder for Kyoo. To install in a different folder, click Browse and select another folder.' + + 'The installer will set the following folder for Kyoo. To install in a different folder, click Browse and select another folder.' + 'Please make sure the folder exists and is accessible. Do not choose the server install folder. Click Next to continue.', False, ''); DataDirPage.Add(''); @@ -64,4 +64,4 @@ end; function GetDataDir(Param: String): String; begin Result := DataDirPage.Values[0]; -end; \ No newline at end of file +end; diff --git a/icons/banner.png b/icons/banner.png new file mode 100644 index 00000000..db5e97cd Binary files /dev/null and b/icons/banner.png differ diff --git a/icons/icon-128x128.png b/icons/icon-128x128.png new file mode 100644 index 00000000..f602aaaa Binary files /dev/null and b/icons/icon-128x128.png differ diff --git a/icons/icon-16x16.png b/icons/icon-16x16.png new file mode 100644 index 00000000..f0ecbd81 Binary files /dev/null and b/icons/icon-16x16.png differ diff --git a/icons/icon-256x256.ico b/icons/icon-256x256.ico new file mode 100644 index 00000000..8a6ef232 Binary files /dev/null and b/icons/icon-256x256.ico differ diff --git a/icons/icon-256x256.png b/icons/icon-256x256.png new file mode 100644 index 00000000..a395f0fe Binary files /dev/null and b/icons/icon-256x256.png differ diff --git a/icons/icon-32x32.png b/icons/icon-32x32.png new file mode 100644 index 00000000..b5944473 Binary files /dev/null and b/icons/icon-32x32.png differ diff --git a/icons/icon-64x64.png b/icons/icon-64x64.png new file mode 100644 index 00000000..ad7d28e9 Binary files /dev/null and b/icons/icon-64x64.png differ diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 5efb3ebc..8983bf4e 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -15,6 +15,8 @@ 1.0.0 true snupkg + + $(MSBuildThisFileDirectory)../icons/icon-256x256.ico diff --git a/src/Kyoo.Authentication/Models/DTO/OtacResponse.cs b/src/Kyoo.Authentication/Models/DTO/OtacResponse.cs new file mode 100644 index 00000000..13ff8aac --- /dev/null +++ b/src/Kyoo.Authentication/Models/DTO/OtacResponse.cs @@ -0,0 +1,41 @@ +// Kyoo - A portable and vast media library solution. +// Copyright (c) Kyoo. +// +// See AUTHORS.md and LICENSE file in the project root for full license information. +// +// Kyoo is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// any later version. +// +// Kyoo is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Kyoo. If not, see . + +namespace Kyoo.Authentication.Models.DTO +{ + /// + /// A one time access token + /// + public class OtacResponse + { + /// + /// The One Time Access Token that allow one to connect to an account without typing a password or without + /// any kind of verification. This is valid only one time and only for a short period of time. + /// + public string OTAC { get; set; } + + /// + /// Create a new . + /// + /// The one time access token. + public OtacResponse(string otac) + { + OTAC = otac; + } + } +} diff --git a/src/Kyoo.Authentication/Views/AccountApi.cs b/src/Kyoo.Authentication/Views/AccountApi.cs index 3c424efd..a2cbf2f2 100644 --- a/src/Kyoo.Authentication/Views/AccountApi.cs +++ b/src/Kyoo.Authentication/Views/AccountApi.cs @@ -28,6 +28,7 @@ using IdentityServer4.Models; using IdentityServer4.Services; using Kyoo.Abstractions.Controllers; using Kyoo.Abstractions.Models; +using Kyoo.Abstractions.Models.Attributes; using Kyoo.Abstractions.Models.Exceptions; using Kyoo.Abstractions.Models.Utils; using Kyoo.Authentication.Models; @@ -43,10 +44,13 @@ namespace Kyoo.Authentication.Views { /// /// The endpoint responsible for login, logout, permissions and claims of a user. + /// Documentation of this endpoint is a work in progress. /// + /// TODO document this well. [Route("api/accounts")] [Route("api/account", Order = AlternativeRoute)] [ApiController] + [ApiDefinition("Account")] public class AccountApi : Controller, IProfileService { /// @@ -90,7 +94,7 @@ namespace Kyoo.Authentication.Views [HttpPost("register")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status409Conflict, Type = typeof(RequestError))] - public async Task Register([FromBody] RegisterRequest request) + public async Task> Register([FromBody] RegisterRequest request) { User user = request.ToUser(); user.Permissions = _options.Value.Permissions.NewUser; @@ -106,7 +110,7 @@ namespace Kyoo.Authentication.Views return Conflict(new RequestError("A user with this name already exists")); } - return Ok(new { Otac = user.ExtraData["otac"] }); + return Ok(new OtacResponse(user.ExtraData["otac"])); } /// @@ -126,8 +130,11 @@ namespace Kyoo.Authentication.Views } /// - /// Login the user. + /// Login /// + /// + /// Login the current session. + /// /// The DTO login request /// TODO [HttpPost("login")] diff --git a/src/Kyoo.Swagger/ApiTagsFilter.cs b/src/Kyoo.Swagger/ApiTagsFilter.cs index 10177e71..f3537541 100644 --- a/src/Kyoo.Swagger/ApiTagsFilter.cs +++ b/src/Kyoo.Swagger/ApiTagsFilter.cs @@ -59,7 +59,7 @@ namespace Kyoo.Swagger }); } - if (def == null) + if (def?.Group == null) return true; context.Document.ExtensionData ??= new Dictionary(); diff --git a/src/Kyoo.Swagger/SwaggerModule.cs b/src/Kyoo.Swagger/SwaggerModule.cs index b2da0668..b929ed62 100644 --- a/src/Kyoo.Swagger/SwaggerModule.cs +++ b/src/Kyoo.Swagger/SwaggerModule.cs @@ -18,6 +18,7 @@ using System; using System.Collections.Generic; +using System.Reflection; using Kyoo.Abstractions.Controllers; using Kyoo.Abstractions.Models.Permissions; using Kyoo.Abstractions.Models.Utils; @@ -58,7 +59,7 @@ namespace Kyoo.Swagger document.Title = "Kyoo API"; // TODO use a real multi-line description in markdown. document.Description = "The Kyoo's public API"; - document.Version = "1.0.0"; + document.Version = Assembly.GetExecutingAssembly().GetName().Version!.ToString(3); document.DocumentName = "v1"; document.UseControllerSummaryAsTagDescription = true; document.GenerateExamples = true; @@ -74,6 +75,14 @@ namespace Kyoo.Swagger Name = "GPL-3.0-or-later", Url = "https://github.com/AnonymusRaccoon/Kyoo/blob/master/LICENSE" }; + + options.Info.ExtensionData ??= new Dictionary(); + options.Info.ExtensionData["x-logo"] = new + { + url = "/banner.png", + backgroundColor = "#FFFFFF", + altText = "Kyoo's logo" + }; }; document.UseApiTags(); document.SortApis(); @@ -129,6 +138,10 @@ namespace Kyoo.Swagger SA.New(app => app.UseReDoc(x => { x.Path = "/redoc"; + x.AdditionalSettings["theme"] = new + { + colors = new { primary = new { main = "#e13e13" } } + }; }), SA.Before) }; } diff --git a/src/Kyoo.WebApp/Front b/src/Kyoo.WebApp/Front index a3da5f1e..7bf53b40 160000 --- a/src/Kyoo.WebApp/Front +++ b/src/Kyoo.WebApp/Front @@ -1 +1 @@ -Subproject commit a3da5f1e6edb982e3b71792a7ea6fcd45661c337 +Subproject commit 7bf53b40080d1d43228f1cdcad510b302ead99ff diff --git a/src/Kyoo.WebApp/Kyoo.WebApp.csproj b/src/Kyoo.WebApp/Kyoo.WebApp.csproj index eeb49df7..4d637707 100644 --- a/src/Kyoo.WebApp/Kyoo.WebApp.csproj +++ b/src/Kyoo.WebApp/Kyoo.WebApp.csproj @@ -12,6 +12,7 @@ false $(DefaultItemExcludes);$(SpaRoot)node_modules/** Front/ + ../../icons/ $(SpaRoot)node_modules/.install-stamp @@ -29,6 +30,11 @@ + + wwwroot/%(RecursiveDir)%(Filename)%(Extension) + Always + + wwwroot/%(RecursiveDir)%(Filename)%(Extension) Always