Allowing relative paths

This commit is contained in:
Zoe Roux 2021-01-11 22:58:40 +01:00
parent 95a7efa71e
commit 6c2410d9a9
6 changed files with 18 additions and 13 deletions

View File

@ -87,14 +87,12 @@ namespace Kyoo.Controllers
Pkcs12Store store = new Pkcs12StoreBuilder().Build();
store.SetKeyEntry("Kyoo_key", new AsymmetricKeyEntry(subjectKeyPair.Private), new [] {new X509CertificateEntry(bouncyCert)});
using (MemoryStream pfxStream = new MemoryStream())
{
store.Save(pfxStream, password.ToCharArray(), random);
certificate = new X509Certificate2(pfxStream.ToArray(), password, X509KeyStorageFlags.Exportable);
using FileStream fileStream = File.OpenWrite(file);
pfxStream.WriteTo(fileStream);
}
using MemoryStream pfxStream = new MemoryStream();
store.Save(pfxStream, password.ToCharArray(), random);
certificate = new X509Certificate2(pfxStream.ToArray(), password, X509KeyStorageFlags.Exportable);
using FileStream fileStream = File.OpenWrite(file);
pfxStream.WriteTo(fileStream);
return certificate;
}
}

View File

@ -50,7 +50,7 @@
<ItemGroup>
<Content Remove="$(SpaRoot)**" />
<None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**" />
<None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules/**" />
<StaticFiles Include="$(SpaRoot)static/**" />
<LoginFiles Include="$(LoginRoot)**" />
<StaticFiles Include="Views/Login/material-icons.css" />

View File

@ -1,4 +1,5 @@
using System;
using System.IO;
using System.Reflection;
using IdentityServer4.Services;
using Kyoo.Api;
@ -37,7 +38,7 @@ namespace Kyoo
{
services.AddSpaStaticFiles(configuration =>
{
configuration.RootPath = "wwwroot";
configuration.RootPath = Path.Join(AppDomain.CurrentDomain.BaseDirectory, "wwwroot");
});
services.AddControllers()
@ -192,7 +193,7 @@ namespace Kyoo
app.UseSpa(spa =>
{
spa.Options.SourcePath = "Views/WebClient";
spa.Options.SourcePath = Path.Join(AppDomain.CurrentDomain.BaseDirectory, "Views/WebClient");
if (env.IsDevelopment())
{

5
install/aur/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
Kyoo/
src/
pkg/
kyoo-1.0.0-1-x86_64.pkg.tar.zst

View File

@ -31,7 +31,9 @@ build() {
package() {
mkdir -p "$pkgdir/usr/lib"
mkdir -p "$pkgdir/var/lib/kyoo"
cp -r --no-preserve ownership "$srcdir/output" "$pkgdir/usr/lib/kyoo"
mv "$pkgdir/usr/lib/kyoo/appsettings.json" "$pkgdir/var/lib/kyoo/"
install -Dm 644 kyoo.service -t "$pkgdir/usr/lib/systemd/system/"
install -Dm 644 kyoo.sysusers "$pkgdir/usr/lib/sysusers.d/kyoo.conf"
}

View File

@ -4,8 +4,7 @@ After=network.target
[Service]
User=kyoo
WorkingDirectory=/usr/lib/kyoo
ExecStart=/usr/bin/dotnet kyoo.dll
ExecStart=/usr/lib/kyoo/Kyoo /var/lib/kyoo
Restart=on-abort
TimeoutSec=20