mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-23 15:30:34 -04:00
Update the ci
This commit is contained in:
parent
88b1c04367
commit
9a09572722
@ -1,5 +1,6 @@
|
|||||||
TVDB__APIKEY=
|
TVDB__APIKEY=
|
||||||
THEMOVIEDB__APIKEY=
|
THEMOVIEDB__APIKEY=
|
||||||
AUTHENTICATION_SECRET=
|
AUTHENTICATION_SECRET=
|
||||||
POSTGRES_USER=
|
POSTGRES_USER=kyoousername
|
||||||
POSTGRES_PASSWORD=
|
POSTGRES_PASSWORD=kyoopassword
|
||||||
|
POSTGRES_DB=kyooDB
|
||||||
|
42
.github/workflows/analysis.yml
vendored
42
.github/workflows/analysis.yml
vendored
@ -1,58 +1,82 @@
|
|||||||
name: Analysis
|
name: Analysis
|
||||||
on: [push, pull_request, workflow_dispatch]
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- next
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
analysis:
|
analysis:
|
||||||
name: Static Analysis
|
name: Static Analysis
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||||
|
|
||||||
- name: Cache SonarCloud packages
|
- name: Cache SonarCloud packages
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: ~/sonar/cache
|
path: ~/sonar/cache
|
||||||
key: ${{ runner.os }}-sonar
|
key: ${{ runner.os }}-sonar
|
||||||
restore-keys: ${{ runner.os }}-sonar
|
restore-keys: ${{ runner.os }}-sonar
|
||||||
|
|
||||||
- name: Cache SonarCloud scanner
|
- name: Cache SonarCloud scanner
|
||||||
id: cache-sonar-scanner
|
id: cache-sonar-scanner
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: ./.sonar/scanner
|
path: ~/.sonar/scanner
|
||||||
key: ${{ runner.os }}-sonar-scanner
|
key: ${{ runner.os }}-sonar-scanner
|
||||||
restore-keys: ${{ runner.os }}-sonar-scanner
|
restore-keys: ${{ runner.os }}-sonar-scanner
|
||||||
|
|
||||||
- name: Install SonarCloud scanner
|
- name: Install SonarCloud scanner
|
||||||
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
|
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ./.sonar/scanner
|
cd back
|
||||||
dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner
|
mkdir -p ~/.sonar/scanner
|
||||||
- name: Wait for tests to run
|
dotnet tool update dotnet-sonarscanner --tool-path ~/.sonar/scanner
|
||||||
|
|
||||||
|
- name: Wait for tests to run (Push)
|
||||||
uses: lewagon/wait-on-check-action@master
|
uses: lewagon/wait-on-check-action@master
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
with:
|
with:
|
||||||
ref: ${{github.ref}}
|
ref: ${{github.ref}}
|
||||||
check-name: tests
|
check-name: tests
|
||||||
repo-token: ${{secrets.GITHUB_TOKEN}}
|
repo-token: ${{secrets.GITHUB_TOKEN}}
|
||||||
running-workflow-name: analysis
|
running-workflow-name: analysis
|
||||||
allowed-conclusions: success,skipped,cancelled,neutral,failure
|
allowed-conclusions: success,skipped,cancelled,neutral,failure
|
||||||
|
- name: Wait for tests to run (PR)
|
||||||
|
uses: lewagon/wait-on-check-action@master
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
|
with:
|
||||||
|
ref: ${{github.event.pull_request.head.sha}}
|
||||||
|
check-name: tests
|
||||||
|
repo-token: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
running-workflow-name: analysis
|
||||||
|
allowed-conclusions: success,skipped,cancelled,neutral,failure
|
||||||
|
|
||||||
- name: Download coverage report
|
- name: Download coverage report
|
||||||
uses: dawidd6/action-download-artifact@v2
|
uses: dawidd6/action-download-artifact@v2
|
||||||
with:
|
with:
|
||||||
commit: ${{env.COMMIT_SHA}}
|
commit: ${{env.COMMIT_SHA}}
|
||||||
workflow: tests.yml
|
workflow: tests.yml
|
||||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
|
||||||
- name: Build and analyze
|
- name: Build and analyze
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
|
||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
cp -r results.xml/ coverage.xml/ back/
|
||||||
|
cd back
|
||||||
find . -name 'coverage.opencover.xml'
|
find . -name 'coverage.opencover.xml'
|
||||||
dotnet build-server shutdown
|
dotnet build-server shutdown
|
||||||
|
|
||||||
./.sonar/scanner/dotnet-sonarscanner begin \
|
~/.sonar/scanner/dotnet-sonarscanner begin \
|
||||||
-k:"AnonymusRaccoon_Kyoo" \
|
-k:"AnonymusRaccoon_Kyoo" \
|
||||||
-o:"anonymus-raccoon" \
|
-o:"anonymus-raccoon" \
|
||||||
-d:sonar.login="${{ secrets.SONAR_TOKEN }}" \
|
-d:sonar.login="${{ secrets.SONAR_TOKEN }}" \
|
||||||
@ -60,6 +84,6 @@ jobs:
|
|||||||
-d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml" \
|
-d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml" \
|
||||||
-d:sonar.cs.vstest.reportsPaths="**/TestOutputResults.xml"
|
-d:sonar.cs.vstest.reportsPaths="**/TestOutputResults.xml"
|
||||||
|
|
||||||
dotnet build --no-incremental '-p:SkipTranscoder=true;SkipWebApp=true'
|
dotnet build --no-incremental '-p:SkipTranscoder=true'
|
||||||
|
|
||||||
./.sonar/scanner/dotnet-sonarscanner end -d:sonar.login="${{ secrets.SONAR_TOKEN }}"
|
~/.sonar/scanner/dotnet-sonarscanner end -d:sonar.login="${{ secrets.SONAR_TOKEN }}"
|
||||||
|
2
.github/workflows/coding-style.yml
vendored
2
.github/workflows/coding-style.yml
vendored
@ -12,4 +12,4 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
dotnet-version: 6.0.x
|
dotnet-version: 6.0.x
|
||||||
- name: Build the app
|
- name: Build the app
|
||||||
run: dotnet build -p:CheckCodingStyle=true -p:TreatWarningsAsErrors=true '-p:SkipTranscoder=true;SkipWebApp=true'
|
run: cd back && dotnet build -p:CheckCodingStyle=true -p:TreatWarningsAsErrors=true '-p:SkipTranscoder=true'
|
||||||
|
42
.github/workflows/docker.yml
vendored
42
.github/workflows/docker.yml
vendored
@ -1,37 +1,65 @@
|
|||||||
name: Docker
|
name: Docker
|
||||||
on: [push, pull_request, workflow_dispatch]
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- next
|
||||||
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- context: ./back
|
||||||
|
label: back
|
||||||
|
image: ghcr.io/${{github.repository_owner}}/kyoo_back
|
||||||
|
- context: ./front
|
||||||
|
label: front
|
||||||
|
image: ghcr.io/${{github.repository_owner}}/kyoo_front
|
||||||
|
name: Docker build ${{matrix.label}}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: crazy-max/ghaction-docker-meta@v2
|
uses: docker/metadata-action@v4
|
||||||
with:
|
with:
|
||||||
images: ghcr.io/${{github.repository_owner}}/Kyoo
|
images: ${{matrix.image}}
|
||||||
tags: |
|
tags: |
|
||||||
type=ref,event=tag
|
type=edge
|
||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
|
||||||
|
- name: Check if a package should be pushed
|
||||||
|
run: |
|
||||||
|
echo "SHOULD_PUSH=$([ "${GITHUB_REF##*/}" == "master" ] || [ "${GITHUB_REF##*/}" == "next" ] && echo "true" || echo "false")" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v1
|
uses: docker/setup-qemu-action@v1
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v1
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{github.repository_owner}}
|
username: ${{github.repository_owner}}
|
||||||
password: ${{secrets.GITHUB_TOKEN}}
|
password: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
id: docker_build
|
id: docker_build
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
context: .
|
context: ${{matrix.context}}
|
||||||
push: true
|
build-args: |
|
||||||
|
VERSION=0.0.0
|
||||||
|
push: ${{env.SHOULD_PUSH}}
|
||||||
tags: ${{steps.meta.outputs.tags}}
|
tags: ${{steps.meta.outputs.tags}}
|
||||||
|
2
.github/workflows/documentation.yml
vendored
2
.github/workflows/documentation.yml
vendored
@ -29,4 +29,4 @@ jobs:
|
|||||||
git push --force origin gh-pages
|
git push --force origin gh-pages
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GITHUB_REPO: "github.com/AnonymusRaccoon/Kyoo"
|
GITHUB_REPO: "github.com/${{github.repository_owner}}/Kyoo"
|
||||||
|
29
.github/workflows/robot.yml
vendored
29
.github/workflows/robot.yml
vendored
@ -1,31 +1,48 @@
|
|||||||
name: RobotTests
|
name: RobotTests
|
||||||
on: [push, pull_request, workflow_dispatch]
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- next
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
- name: Pull images
|
||||||
|
run: docker-compose pull
|
||||||
|
|
||||||
|
- name: Docker cache
|
||||||
|
uses: satackey/action-docker-layer-caching@v0.0.11
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Build the app
|
- name: Build the app
|
||||||
run: docker-compose build
|
run: docker-compose build
|
||||||
|
|
||||||
- name: Start the service
|
- name: Start the service
|
||||||
run: docker-compose up -d
|
run: |
|
||||||
|
cp .env.example .env
|
||||||
|
docker-compose up -d
|
||||||
|
|
||||||
- name: Perform healthchecks
|
- name: Perform healthchecks
|
||||||
run: |
|
run: |
|
||||||
docker-compose ps -a
|
docker-compose ps -a
|
||||||
wget --retry-connrefused http://localhost:8901 # /healthcheck
|
wget --retry-connrefused --retry-on-http-error=502 http://localhost:8901 #/api/healthcheck
|
||||||
|
|
||||||
- name: Run robot tests
|
- name: Run robot tests
|
||||||
run: |
|
run: |
|
||||||
pip install -r tests/robot/requirements.txt
|
pip install -r back/tests/robot/requirements.txt
|
||||||
robot -d out tests/robot/
|
robot -d out back/tests/robot/
|
||||||
|
|
||||||
|
- name: Show logs
|
||||||
|
if: failure()
|
||||||
|
run: docker-compose logs
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
|
27
.github/workflows/tests.yml
vendored
27
.github/workflows/tests.yml
vendored
@ -1,11 +1,14 @@
|
|||||||
name: Testing
|
name: Testing
|
||||||
|
on:
|
||||||
on: [push, pull_request]
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- next
|
||||||
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
tests:
|
tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
|
|
||||||
container: mcr.microsoft.com/dotnet/sdk:6.0
|
container: mcr.microsoft.com/dotnet/sdk:6.0
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
@ -21,27 +24,33 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Restore dependencies
|
|
||||||
run: dotnet restore
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
dotnet build --no-restore '-p:SkipWebApp=true;SkipTranscoder=true' -p:CopyLocalLockFileAssemblies=true
|
cd back
|
||||||
cp ./src/Kyoo.Abstractions/bin/Debug/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll ./tests/Kyoo.Tests/bin/Debug/net6.0/
|
dotnet build '-p:SkipTranscoder=true' -p:CopyLocalLockFileAssemblies=true
|
||||||
|
cp ./out/bin/Kyoo.Abstractions/Debug/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll ./tests/Kyoo.Tests/bin/Debug/net6.0/
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: dotnet test --no-build '-p:CollectCoverage=true;CoverletOutputFormat=opencover' --logger "trx;LogFileName=TestOutputResults.xml"
|
run: |
|
||||||
|
cd back
|
||||||
|
dotnet test --no-build '-p:CollectCoverage=true;CoverletOutputFormat=opencover' --logger "trx;LogFileName=TestOutputResults.xml"
|
||||||
env:
|
env:
|
||||||
POSTGRES_HOST: postgres
|
POSTGRES_HOST: postgres
|
||||||
POSTGRES_USERNAME: postgres
|
POSTGRES_USERNAME: postgres
|
||||||
POSTGRES_PASSWORD: postgres
|
POSTGRES_PASSWORD: postgres
|
||||||
|
|
||||||
- name: Sanitize coverage output
|
- name: Sanitize coverage output
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
run: sed -i "s'$(pwd)'.'" tests/Kyoo.Tests/coverage.opencover.xml
|
run: sed -i "s'$(pwd)/back'.'" back/tests/Kyoo.Tests/coverage.opencover.xml
|
||||||
|
|
||||||
- name: Upload tests results
|
- name: Upload tests results
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: results.xml
|
name: results.xml
|
||||||
path: "**/TestOutputResults.xml"
|
path: "**/TestOutputResults.xml"
|
||||||
|
|
||||||
- name: Upload coverage report
|
- name: Upload coverage report
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -2,4 +2,6 @@ video
|
|||||||
.env
|
.env
|
||||||
.idea
|
.idea
|
||||||
.vscode
|
.vscode
|
||||||
|
log.html
|
||||||
|
output.xml
|
||||||
|
report.html
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
root = false
|
root = false
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
indent_style = tab
|
||||||
|
indent_size = tab
|
||||||
|
smart_tab = true
|
||||||
|
|
||||||
[*.cs]
|
[*.cs]
|
||||||
csharp_prefer_braces = false
|
csharp_prefer_braces = false
|
||||||
dotnet_diagnostic.IDE0130.severity = none
|
dotnet_diagnostic.IDE0130.severity = none
|
||||||
|
@ -6,8 +6,27 @@ RUN cmake . && make -j
|
|||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 as builder
|
FROM mcr.microsoft.com/dotnet/sdk:6.0 as builder
|
||||||
WORKDIR /kyoo
|
WORKDIR /kyoo
|
||||||
|
|
||||||
|
COPY Kyoo.sln ./Kyoo.sln
|
||||||
|
COPY nuget.config ./nuget.config
|
||||||
|
COPY src/Directory.Build.props src/Directory.Build.props
|
||||||
|
COPY src/Kyoo.Authentication/Kyoo.Authentication.csproj src/Kyoo.Authentication/Kyoo.Authentication.csproj
|
||||||
|
COPY src/Kyoo.Database/Kyoo.Database.csproj src/Kyoo.Database/Kyoo.Database.csproj
|
||||||
|
COPY src/Kyoo.Host.Generic/Kyoo.Host.Generic.csproj src/Kyoo.Host.Generic/Kyoo.Host.Generic.csproj
|
||||||
|
COPY src/Kyoo.SqLite/Kyoo.SqLite.csproj src/Kyoo.SqLite/Kyoo.SqLite.csproj
|
||||||
|
COPY src/Kyoo.TheMovieDb/Kyoo.TheMovieDb.csproj src/Kyoo.TheMovieDb/Kyoo.TheMovieDb.csproj
|
||||||
|
COPY src/Kyoo.Abstractions/Kyoo.Abstractions.csproj src/Kyoo.Abstractions/Kyoo.Abstractions.csproj
|
||||||
|
COPY src/Kyoo.Core/Kyoo.Core.csproj src/Kyoo.Core/Kyoo.Core.csproj
|
||||||
|
COPY src/Kyoo.Host.Console/Kyoo.Host.Console.csproj src/Kyoo.Host.Console/Kyoo.Host.Console.csproj
|
||||||
|
COPY src/Kyoo.Postgresql/Kyoo.Postgresql.csproj src/Kyoo.Postgresql/Kyoo.Postgresql.csproj
|
||||||
|
COPY src/Kyoo.Swagger/Kyoo.Swagger.csproj src/Kyoo.Swagger/Kyoo.Swagger.csproj
|
||||||
|
COPY src/Kyoo.TheTvdb/Kyoo.TheTvdb.csproj src/Kyoo.TheTvdb/Kyoo.TheTvdb.csproj
|
||||||
|
COPY tests/Kyoo.Tests/Kyoo.Tests.csproj tests/Kyoo.Tests/Kyoo.Tests.csproj
|
||||||
|
RUN dotnet restore
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN dotnet publish -c Release -o /opt/kyoo '-p:SkipTranscoder=true;CheckCodingStyle=false' src/Kyoo.Host.Console
|
ARG VERSION
|
||||||
|
RUN dotnet publish --no-restore -c Release -o /opt/kyoo "-p:Version=${VERSION:-"0.0.0-dev"};SkipTranscoder=true" src/Kyoo.Host.Console
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0
|
FROM mcr.microsoft.com/dotnet/aspnet:6.0
|
||||||
RUN apt-get update && apt-get install -y libavutil-dev libavcodec-dev libavformat-dev
|
RUN apt-get update && apt-get install -y libavutil-dev libavcodec-dev libavformat-dev
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"profiles": {
|
|
||||||
"Console": {
|
|
||||||
"commandName": "Project",
|
|
||||||
"launchBrowser": false,
|
|
||||||
"environmentVariables": {
|
|
||||||
"KYOO_DATADIR": "./bin/KyooData"
|
|
||||||
},
|
|
||||||
"applicationUrl": "http://localhost:5000"
|
|
||||||
},
|
|
||||||
"Console-Browser": {
|
|
||||||
"commandName": "Project",
|
|
||||||
"launchBrowser": true,
|
|
||||||
"environmentVariables": {
|
|
||||||
"KYOO_DATADIR": "./bin/KyooData"
|
|
||||||
},
|
|
||||||
"applicationUrl": "http://localhost:5000"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -159,18 +159,7 @@ namespace Kyoo.Host.Generic
|
|||||||
/// <returns>The current data directory.</returns>
|
/// <returns>The current data directory.</returns>
|
||||||
private string _SetupDataDir(string[] args)
|
private string _SetupDataDir(string[] args)
|
||||||
{
|
{
|
||||||
Dictionary<string, string> registry = new();
|
|
||||||
|
|
||||||
if (OperatingSystem.IsWindows())
|
|
||||||
{
|
|
||||||
object dataDir = Registry.GetValue(@"HKEY_LOCAL_MACHINE\Software\SDG\Kyoo\Settings", "DataDir", null)
|
|
||||||
?? Registry.GetValue(@"HKEY_CURRENT_USER\Software\SDG\Kyoo\Settings", "DataDir", null);
|
|
||||||
if (dataDir is string data)
|
|
||||||
registry.Add("DataDir", data);
|
|
||||||
}
|
|
||||||
|
|
||||||
IConfiguration parsed = new ConfigurationBuilder()
|
IConfiguration parsed = new ConfigurationBuilder()
|
||||||
.AddInMemoryCollection(registry)
|
|
||||||
.AddEnvironmentVariables()
|
.AddEnvironmentVariables()
|
||||||
.AddEnvironmentVariables("KYOO_")
|
.AddEnvironmentVariables("KYOO_")
|
||||||
.AddCommandLine(args)
|
.AddCommandLine(args)
|
||||||
@ -186,8 +175,10 @@ namespace Kyoo.Host.Generic
|
|||||||
|
|
||||||
if (!File.Exists(GetConfigFile()))
|
if (!File.Exists(GetConfigFile()))
|
||||||
{
|
{
|
||||||
File.Copy(Path.Join(AppDomain.CurrentDomain.BaseDirectory, GetConfigFile()),
|
File.Copy(
|
||||||
GetConfigFile());
|
Path.Join(AppDomain.CurrentDomain.BaseDirectory, GetConfigFile()),
|
||||||
|
GetConfigFile()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
"pluginsPath": "plugins/",
|
"pluginsPath": "plugins/",
|
||||||
"transmuxPath": "cached/transmux",
|
"transmuxPath": "cached/transmux",
|
||||||
"transcodePath": "cached/transcode",
|
"transcodePath": "cached/transcode",
|
||||||
"metadataInShow": true,
|
|
||||||
"metadataPath": "metadata/"
|
"metadataPath": "metadata/"
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -19,7 +18,7 @@
|
|||||||
"server": "127.0.0.1",
|
"server": "127.0.0.1",
|
||||||
"port": "5432",
|
"port": "5432",
|
||||||
"database": "kyooDB",
|
"database": "kyooDB",
|
||||||
"user ID": "kyoo",
|
"user": "kyoo",
|
||||||
"password": "kyooPassword",
|
"password": "kyooPassword",
|
||||||
"pooling": "true",
|
"pooling": "true",
|
||||||
"maxPoolSize": "95",
|
"maxPoolSize": "95",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
*** Settings ***
|
*** Settings ***
|
||||||
Documentation Common things to handle rest requests
|
Documentation Common things to handle rest requests
|
||||||
|
|
||||||
Library REST http://localhost:5000
|
Library REST http://localhost:8901/api
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
version: "3.8"
|
version: "3.8"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
kyoo:
|
back:
|
||||||
build:
|
build:
|
||||||
context: ./back
|
context: ./back
|
||||||
dockerfile: Dockerfile.dev
|
dockerfile: Dockerfile.dev
|
||||||
@ -34,18 +34,18 @@ services:
|
|||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
environment:
|
environment:
|
||||||
- KYOO_URL=http://kyoo:5000
|
- KYOO_URL=http://back:5000
|
||||||
ingress:
|
ingress:
|
||||||
image: nginx
|
image: nginx
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
environment:
|
environment:
|
||||||
- PORT=8901
|
- PORT=8901
|
||||||
- FRONT_URL=http://front:3000
|
- FRONT_URL=http://front:3000
|
||||||
- BACK_URL=http://kyoo:5000
|
- BACK_URL=http://back:5000
|
||||||
volumes:
|
volumes:
|
||||||
- ./nginx.conf.template:/etc/nginx/templates/kyoo.conf.template:ro
|
- ./nginx.conf.template:/etc/nginx/templates/kyoo.conf.template:ro
|
||||||
depends_on:
|
depends_on:
|
||||||
- kyoo
|
- back
|
||||||
- front
|
- front
|
||||||
ports:
|
ports:
|
||||||
- "8901:8901"
|
- "8901:8901"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
version: "3.8"
|
version: "3.8"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
kyoo:
|
back:
|
||||||
build: ./back
|
build: ./back
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
environment:
|
environment:
|
||||||
@ -10,6 +10,7 @@ services:
|
|||||||
- DATABASE__CONFIGURATIONS__POSTGRES__SERVER=postgres
|
- DATABASE__CONFIGURATIONS__POSTGRES__SERVER=postgres
|
||||||
- DATABASE__CONFIGURATIONS__POSTGRES__USER=${POSTGRES_USER}
|
- DATABASE__CONFIGURATIONS__POSTGRES__USER=${POSTGRES_USER}
|
||||||
- DATABASE__CONFIGURATIONS__POSTGRES__PASSWORD=${POSTGRES_PASSWORD}
|
- DATABASE__CONFIGURATIONS__POSTGRES__PASSWORD=${POSTGRES_PASSWORD}
|
||||||
|
- DATABASE__CONFIGURATIONS__POSTGRES__DATABASE=${POSTGRES_DB}
|
||||||
- TVDB__APIKEY=${TVDB__APIKEY}
|
- TVDB__APIKEY=${TVDB__APIKEY}
|
||||||
- THEMOVIEDB__APIKEY=${THEMOVIEDB__APIKEY}
|
- THEMOVIEDB__APIKEY=${THEMOVIEDB__APIKEY}
|
||||||
depends_on:
|
depends_on:
|
||||||
@ -21,27 +22,28 @@ services:
|
|||||||
build: ./front
|
build: ./front
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
environment:
|
environment:
|
||||||
- KYOO_URL=http://kyoo:5000
|
- KYOO_URL=http://back:5000
|
||||||
ingress:
|
ingress:
|
||||||
image: nginx
|
image: nginx
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
environment:
|
environment:
|
||||||
- PORT=8901
|
- PORT=8901
|
||||||
- FRONT_URL=http://front:8901
|
- FRONT_URL=http://front:8901
|
||||||
- BACK_URL=http://kyoo:5000
|
- BACK_URL=http://back:5000
|
||||||
volumes:
|
volumes:
|
||||||
- ./nginx.conf.template:/etc/nginx/templates/kyoo.conf.template:ro
|
- ./nginx.conf.template:/etc/nginx/templates/kyoo.conf.template:ro
|
||||||
depends_on:
|
depends_on:
|
||||||
- kyoo
|
- back
|
||||||
- front
|
- front
|
||||||
ports:
|
ports:
|
||||||
- "8901:8901"
|
- "8901:8901"
|
||||||
postgres:
|
postgres:
|
||||||
image: "postgres"
|
image: postgres
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
environment:
|
environment:
|
||||||
- POSTGRES_USER=${POSTGRES_USER}
|
- POSTGRES_USER=${POSTGRES_USER}
|
||||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||||
|
- POSTGRES_DB=${POSTGRES_DB}
|
||||||
volumes:
|
volumes:
|
||||||
- db:/var/lib/postgresql/data
|
- db:/var/lib/postgresql/data
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user