mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Copying file to run directory on startup
This commit is contained in:
parent
261c4a01c6
commit
664147f6eb
@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.IO;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore;
|
using Microsoft.AspNetCore;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
@ -13,6 +14,8 @@ namespace Kyoo
|
|||||||
if (args.Length > 0)
|
if (args.Length > 0)
|
||||||
FileSystem.CurrentDirectory = args[0];
|
FileSystem.CurrentDirectory = args[0];
|
||||||
Console.WriteLine($"Running as {Environment.UserName} in {FileSystem.CurrentDirectory}.");
|
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();
|
await CreateWebHostBuilder(args).Build().RunAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ namespace Kyoo.Api
|
|||||||
public override void OnActionExecuted(ActionExecutedContext ctx)
|
public override void OnActionExecuted(ActionExecutedContext ctx)
|
||||||
{
|
{
|
||||||
base.OnActionExecuted(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("Cache-Control", "no-cache, no-store, must-revalidate");
|
||||||
ctx.HttpContext.Response.Headers.Add("Pragma", "no-cache");
|
ctx.HttpContext.Response.Headers.Add("Pragma", "no-cache");
|
||||||
ctx.HttpContext.Response.Headers.Add("Expires", "0");
|
ctx.HttpContext.Response.Headers.Add("Expires", "0");
|
||||||
|
@ -33,9 +33,7 @@ build() {
|
|||||||
|
|
||||||
package() {
|
package() {
|
||||||
mkdir -p "$pkgdir/usr/lib"
|
mkdir -p "$pkgdir/usr/lib"
|
||||||
mkdir -p "$pkgdir/var/lib/kyoo"
|
|
||||||
cp -r --no-preserve ownership "$srcdir/output" "$pkgdir/usr/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.service -t "$pkgdir/usr/lib/systemd/system/"
|
||||||
install -Dm 644 kyoo.sysusers "$pkgdir/usr/lib/sysusers.d/kyoo.conf"
|
install -Dm 644 kyoo.sysusers "$pkgdir/usr/lib/sysusers.d/kyoo.conf"
|
||||||
install -Dm 644 kyoo.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/kyoo.conf"
|
install -Dm 644 kyoo.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/kyoo.conf"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user