mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Creating a docker-compose
This commit is contained in:
parent
65cbd3933b
commit
65a8190ce8
17
Kyoo/Extensions.cs
Normal file
17
Kyoo/Extensions.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System.Data.Common;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace Kyoo
|
||||
{
|
||||
public static class Extensions
|
||||
{
|
||||
public static string GetDatabaseConnection(this IConfiguration config)
|
||||
{
|
||||
DbConnectionStringBuilder builder = new();
|
||||
IConfigurationSection section = config.GetSection("Database");
|
||||
foreach (IConfigurationSection child in section.GetChildren())
|
||||
builder[child.Key] = child.Value;
|
||||
return builder.ConnectionString;
|
||||
}
|
||||
}
|
||||
}
|
@ -98,7 +98,7 @@
|
||||
</Target>
|
||||
|
||||
<Target Name="Compile the transcoder" BeforeTargets="BeforeBuild" Condition="'$(SkipTranscoder)' != 'true'">
|
||||
<Exec WorkingDirectory="$(TranscoderRoot)" Command='mkdir -p build %26%26 cd build %26%26 cmake .. %26%26 make -j' />
|
||||
<Exec WorkingDirectory="$(TranscoderRoot)" Command="mkdir -p build %26%26 cd build %26%26 cmake .. %26%26 make -j" />
|
||||
<Copy SourceFiles="$(TranscoderRoot)/build/libtranscoder.so" DestinationFolder="." />
|
||||
</Target>
|
||||
|
||||
|
@ -58,14 +58,14 @@ namespace Kyoo
|
||||
|
||||
services.AddDbContext<DatabaseContext>(options =>
|
||||
{
|
||||
options.UseNpgsql(_configuration.GetConnectionString("Database"));
|
||||
options.UseNpgsql(_configuration.GetDatabaseConnection());
|
||||
// .EnableSensitiveDataLogging()
|
||||
// .UseLoggerFactory(LoggerFactory.Create(builder => builder.AddConsole()));
|
||||
}, ServiceLifetime.Transient);
|
||||
|
||||
services.AddDbContext<IdentityDatabase>(options =>
|
||||
{
|
||||
options.UseNpgsql(_configuration.GetConnectionString("Database"));
|
||||
options.UseNpgsql(_configuration.GetDatabaseConnection());
|
||||
});
|
||||
|
||||
string assemblyName = typeof(Startup).GetTypeInfo().Assembly.GetName().Name;
|
||||
@ -89,13 +89,13 @@ namespace Kyoo
|
||||
.AddConfigurationStore(options =>
|
||||
{
|
||||
options.ConfigureDbContext = builder =>
|
||||
builder.UseNpgsql(_configuration.GetConnectionString("Database"),
|
||||
builder.UseNpgsql(_configuration.GetDatabaseConnection(),
|
||||
sql => sql.MigrationsAssembly(assemblyName));
|
||||
})
|
||||
.AddOperationalStore(options =>
|
||||
{
|
||||
options.ConfigureDbContext = builder =>
|
||||
builder.UseNpgsql(_configuration.GetConnectionString("Database"),
|
||||
builder.UseNpgsql(_configuration.GetDatabaseConnection(),
|
||||
sql => sql.MigrationsAssembly(assemblyName));
|
||||
options.EnableTokenCleanup = true;
|
||||
})
|
||||
|
@ -3,6 +3,18 @@
|
||||
"public_url": "http://localhost:5000/",
|
||||
"http_port": 5000,
|
||||
"https_port": 44300,
|
||||
|
||||
"Database": {
|
||||
"Server": "127.0.0.1",
|
||||
"Port": "5432",
|
||||
"Database": "kyooDB",
|
||||
"User Id": "kyoo",
|
||||
"Password": "kyooPassword",
|
||||
"Pooling": "true",
|
||||
"MaxPoolSize": "95",
|
||||
"Timeout": "30"
|
||||
},
|
||||
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Warning",
|
||||
@ -15,9 +27,6 @@
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
|
||||
"ConnectionStrings": {
|
||||
"Database": "Server=127.0.0.1; Port=5432; Database=kyooDB; User Id=kyoo; Password=kyooPassword; Pooling=true; MaxPoolSize=95; Timeout=30;"
|
||||
},
|
||||
"parallelTasks": "1",
|
||||
|
||||
"scheduledTasks": {
|
||||
@ -36,4 +45,4 @@
|
||||
"newUserPermissions": "read,play,write,admin",
|
||||
"regex": "(?:\\/(?<Collection>.*?))?\\/(?<Show>.*?)(?: \\(\\d+\\))?\\/\\k<Show>(?: \\(\\d+\\))?(?:(?: S(?<Season>\\d+)E(?<Episode>\\d+))| (?<Absolute>\\d+))?.*$",
|
||||
"subtitleRegex": "^(?<Episode>.*)\\.(?<Language>\\w{1,3})\\.(?<Default>default\\.)?(?<Forced>forced\\.)?.*$"
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +0,0 @@
|
||||
#! /usr/bin/bash
|
||||
|
||||
REGEX="(?:\/(?<Collection>.*?))?\/(?<ShowTitle>.*)(?: \(\d+\))?\/\k<ShowTitle>(?: \(\d+\))?(?:(?: S(?<SeasonNumber>\d+)E(?<EpisodeNumber>\d+))| (?<AbsoluteNumber>\d+))?.*$"
|
||||
|
||||
find "$1" -type f \( -name '*.mp4' -o -name '*.mkv' \) | cut -c $((${#1} + 1))- | grep -viP "$REGEX"
|
26
docker-compose.yml
Normal file
26
docker-compose.yml
Normal file
@ -0,0 +1,26 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
kyoo:
|
||||
build: "."
|
||||
restart: on-failure
|
||||
environment:
|
||||
- Database__Server=postgres
|
||||
ports:
|
||||
- 80:5000
|
||||
depends_on:
|
||||
- postgres
|
||||
volumes:
|
||||
- kyoo:/var/lib/kyoo
|
||||
postgres:
|
||||
image: "postgres"
|
||||
restart: on-failure
|
||||
environment:
|
||||
- POSTGRES_USER=kyoo
|
||||
- POSTGRES_PASSWORD=kyooPassword
|
||||
volumes:
|
||||
- db:/var/lib/postgresql/data
|
||||
|
||||
volumes:
|
||||
kyoo:
|
||||
db:
|
Loading…
x
Reference in New Issue
Block a user