Copying file to run directory on startup

This commit is contained in:
Zoe Roux 2021-01-17 21:52:45 +01:00
parent 261c4a01c6
commit 664147f6eb
3 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,5 @@
using System;
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
@ -13,6 +14,8 @@ namespace Kyoo
if (args.Length > 0)
FileSystem.CurrentDirectory = args[0];
Console.WriteLine($"Running as {Environment.UserName} in {FileSystem.CurrentDirectory}.");
if (!File.Exists("./appsettings.json"))
File.Copy(Path.Join(AppDomain.CurrentDomain.BaseDirectory, "appsettings.json"), "appsettings.json");
await CreateWebHostBuilder(args).Build().RunAsync();
}

View File

@ -31,6 +31,7 @@ namespace Kyoo.Api
public override void OnActionExecuted(ActionExecutedContext ctx)
{
base.OnActionExecuted(ctx);
// Disabling the cache prevent an issue on firefox that skip the last 30 seconds of HLS files.
ctx.HttpContext.Response.Headers.Add("Cache-Control", "no-cache, no-store, must-revalidate");
ctx.HttpContext.Response.Headers.Add("Pragma", "no-cache");
ctx.HttpContext.Response.Headers.Add("Expires", "0");

View File

@ -33,9 +33,7 @@ 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"
install -Dm 644 kyoo.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/kyoo.conf"