From 21ae7a1317255acd0a031e74575f6c08967ce5f3 Mon Sep 17 00:00:00 2001 From: JPVenson Date: Thu, 18 Jan 2024 23:11:22 +0000 Subject: [PATCH 1/6] Added ffmpeg version to build --- .../devcontainer.json | 0 .../Dev - Server Ffmpeg/devcontainer.json | 28 +++++++++++++++++++ .../Dev - Server Ffmpeg/install-ffmpeg.sh | 5 ++++ .vscode/extensions.json | 2 +- 4 files changed, 34 insertions(+), 1 deletion(-) rename .devcontainer/{ => Dev - Server Default}/devcontainer.json (100%) create mode 100644 .devcontainer/Dev - Server Ffmpeg/devcontainer.json create mode 100644 .devcontainer/Dev - Server Ffmpeg/install-ffmpeg.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/Dev - Server Default/devcontainer.json similarity index 100% rename from .devcontainer/devcontainer.json rename to .devcontainer/Dev - Server Default/devcontainer.json diff --git a/.devcontainer/Dev - Server Ffmpeg/devcontainer.json b/.devcontainer/Dev - Server Ffmpeg/devcontainer.json new file mode 100644 index 0000000000..8d1413d092 --- /dev/null +++ b/.devcontainer/Dev - Server Ffmpeg/devcontainer.json @@ -0,0 +1,28 @@ +{ + "name": "Development Jellyfin Server - FFmpeg", + "image":"mcr.microsoft.com/devcontainers/dotnet:8.0-jammy", + // restores nuget packages, installs the dotnet workloads and installs the dev https certificate + "postStartCommand": "dotnet restore; dotnet workload update; dotnet dev-certs https --trust; bash ./install-ffmpeg.sh", + // reads the extensions list and installs them + "postAttachCommand": "cat .vscode/extensions.json | jq -r .recommendations[] | xargs -n 1 code --install-extension", + "features": { + "ghcr.io/devcontainers/features/dotnet:2": { + "version": "none", + "dotnetRuntimeVersions": "8.0", + "aspNetCoreRuntimeVersions": "8.0" + }, + "ghcr.io/devcontainers-contrib/features/apt-packages:1": { + "preserve_apt_list": false, + "packages": ["libfontconfig1"] + }, + "ghcr.io/devcontainers/features/docker-in-docker:2": { + "dockerDashComposeVersion": "v2" + }, + "ghcr.io/devcontainers/features/github-cli:1": {}, + "ghcr.io/eitsupi/devcontainer-features/jq-likes:2": {} + }, + "hostRequirements": { + "memory": "8gb", + "cpus": 4 + } +} diff --git a/.devcontainer/Dev - Server Ffmpeg/install-ffmpeg.sh b/.devcontainer/Dev - Server Ffmpeg/install-ffmpeg.sh new file mode 100644 index 0000000000..d2a54b98f3 --- /dev/null +++ b/.devcontainer/Dev - Server Ffmpeg/install-ffmpeg.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +sudo wget https://repo.jellyfin.org/releases/server/ubuntu/versions/jellyfin-ffmpeg/6.0-8/jellyfin-ffmpeg6_6.0-8-focal_amd64.deb -O ffmpeg.deb +sudo apt install -f ./ffmpeg.deb -y +rm ffmpeg.deb \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json index d738e9fba4..3be946e446 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,7 +2,7 @@ "recommendations": [ "ms-dotnettools.csharp", "editorconfig.editorconfig", - "GitHub.vscode-github-actions", + "github.vscode-github-actions", "ms-dotnettools.vscode-dotnet-runtime", "ms-dotnettools.csdevkit" ], From 23c77706838aa2e5cf83ee036f3853a90acc4a68 Mon Sep 17 00:00:00 2001 From: JPVenson Date: Fri, 19 Jan 2024 00:48:03 +0000 Subject: [PATCH 2/6] Fixed ffmpeg version updated lauch with ffmpeg --- .devcontainer/Dev - Server Ffmpeg/devcontainer.json | 2 +- .devcontainer/Dev - Server Ffmpeg/install-ffmpeg.sh | 6 ++++-- .../{Dev - Server Default => }/devcontainer.json | 0 .vscode/launch.json | 12 ++++++++++++ 4 files changed, 17 insertions(+), 3 deletions(-) rename .devcontainer/{Dev - Server Default => }/devcontainer.json (100%) diff --git a/.devcontainer/Dev - Server Ffmpeg/devcontainer.json b/.devcontainer/Dev - Server Ffmpeg/devcontainer.json index 8d1413d092..0b848d9f3c 100644 --- a/.devcontainer/Dev - Server Ffmpeg/devcontainer.json +++ b/.devcontainer/Dev - Server Ffmpeg/devcontainer.json @@ -2,7 +2,7 @@ "name": "Development Jellyfin Server - FFmpeg", "image":"mcr.microsoft.com/devcontainers/dotnet:8.0-jammy", // restores nuget packages, installs the dotnet workloads and installs the dev https certificate - "postStartCommand": "dotnet restore; dotnet workload update; dotnet dev-certs https --trust; bash ./install-ffmpeg.sh", + "postStartCommand": "dotnet restore; dotnet workload update; dotnet dev-certs https --trust; sudo bash \"./.devcontainer/Dev - Server Ffmpeg/install-ffmpeg.sh\"", // reads the extensions list and installs them "postAttachCommand": "cat .vscode/extensions.json | jq -r .recommendations[] | xargs -n 1 code --install-extension", "features": { diff --git a/.devcontainer/Dev - Server Ffmpeg/install-ffmpeg.sh b/.devcontainer/Dev - Server Ffmpeg/install-ffmpeg.sh index d2a54b98f3..c84e1258fa 100644 --- a/.devcontainer/Dev - Server Ffmpeg/install-ffmpeg.sh +++ b/.devcontainer/Dev - Server Ffmpeg/install-ffmpeg.sh @@ -1,5 +1,7 @@ #!/bin/bash -sudo wget https://repo.jellyfin.org/releases/server/ubuntu/versions/jellyfin-ffmpeg/6.0-8/jellyfin-ffmpeg6_6.0-8-focal_amd64.deb -O ffmpeg.deb +wget https://repo.jellyfin.org/releases/server/ubuntu/versions/jellyfin-ffmpeg/6.0.1-1/jellyfin-ffmpeg6_6.0.1-1-jammy_amd64.deb -O ffmpeg.deb + +sudo apt update sudo apt install -f ./ffmpeg.deb -y -rm ffmpeg.deb \ No newline at end of file +rm ffmpeg.deb diff --git a/.devcontainer/Dev - Server Default/devcontainer.json b/.devcontainer/devcontainer.json similarity index 100% rename from .devcontainer/Dev - Server Default/devcontainer.json rename to .devcontainer/devcontainer.json diff --git a/.vscode/launch.json b/.vscode/launch.json index be55764fd4..2673973dbf 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -29,6 +29,18 @@ "stopAtEntry": false, "internalConsoleOptions": "openOnSessionStart" }, + { + "name": "ghcs .NET Launch (nowebclient, ffmpeg)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + "program": "${workspaceFolder}/Jellyfin.Server/bin/Debug/net8.0/jellyfin.dll", + "args": ["--nowebclient", "--ffmpeg", "/usr/share/jellyfin-ffmpeg/ffmpeg"], + "cwd": "${workspaceFolder}/Jellyfin.Server", + "console": "internalConsole", + "stopAtEntry": false, + "internalConsoleOptions": "openOnSessionStart" + }, { "name": ".NET Attach", "type": "coreclr", From 8de70e381485e20378538a58dd7476f10cbab60a Mon Sep 17 00:00:00 2001 From: JPVenson Date: Fri, 19 Jan 2024 06:02:24 +0000 Subject: [PATCH 3/6] Added documentation --- README.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 62ef21334d..3f6ccb7b7c 100644 --- a/README.md +++ b/README.md @@ -145,14 +145,24 @@ cd Jellyfin.Server/bin/Debug/net8.0 # Change into the build output directory ### Running from GH-Codespaces As Jellyfin will run on a container on a github hosted server, JF needs to handle some things differently. -**NOTE:** If you want to access the JF instance from outside, like with a WebClient on another PC, remember to set the "ports" in the lower VsCode window to public. -#### FFmpeg installation. -Because sometimes you need FFMPEG to test certain cases, follow the instructions from the wiki on the dev enviorment: -https://jellyfin.org/docs/general/installation/linux/#ffmpeg-installation +**NOTE:** Depending on the selected configuration (if you just click 'create codespace' it will create a default configuration one) it might take 20-30 secounds to load all extensions and prepare the enviorment while vscode is already open. Just give it some time and wait until you see `Downloading .NET version(s) 7.0.15~x64 ...... Done!` in the output tab. + +**NOTE:** If you want to access the JF instance from outside, like with a WebClient on another PC, remember to set the "ports" in the lower VsCode window to public. **NOTE:** When first opening the server instance with any WebUI, you will be send to the login instead of the setup page. Refresh the login page once and you should be redirected to the Setup. +There are two configurations for you to chose from. +#### Default - Development Jellyfin Server +This creates a container that has everything to run and debug the Jellyfin Media server but does not setup anything else. Each time you create a new container you have to run though the whole setup again. There is also no ffmpeg, webclient or media preloaded. Use the `.NET Launch (nowebclient)` lunch config to start the server. + +> Keep in mind that as this has no web client you have to connect to it via an extenal client. This can be just another codespace container running the WebUI. vuejs does not work from the getgo as it does not support the setup steps. + +#### Development Jellyfin Server ffmpeg +this extens the default server with an default installation of ffmpeg6 though the means described here: https://jellyfin.org/docs/general/installation/linux#repository-manual +If you want to install a specific ffmpeg version, follow the comments embedded in the `.devcontainer/Dev - Server Ffmpeg/install.ffmpeg.sh` file. + + ### Running The Tests This repository also includes unit tests that are used to validate functionality as part of a CI pipeline on Azure. There are several ways to run these tests. From 6ef110b00803e8dad37375d80c98a767859f6c1b Mon Sep 17 00:00:00 2001 From: JPVenson Date: Fri, 19 Jan 2024 06:02:39 +0000 Subject: [PATCH 4/6] Updated to using jf repro --- .../Dev - Server Ffmpeg/install-ffmpeg.sh | 33 ++++++++++++++++--- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/.devcontainer/Dev - Server Ffmpeg/install-ffmpeg.sh b/.devcontainer/Dev - Server Ffmpeg/install-ffmpeg.sh index c84e1258fa..c867ef538c 100644 --- a/.devcontainer/Dev - Server Ffmpeg/install-ffmpeg.sh +++ b/.devcontainer/Dev - Server Ffmpeg/install-ffmpeg.sh @@ -1,7 +1,32 @@ #!/bin/bash -wget https://repo.jellyfin.org/releases/server/ubuntu/versions/jellyfin-ffmpeg/6.0.1-1/jellyfin-ffmpeg6_6.0.1-1-jammy_amd64.deb -O ffmpeg.deb +## configure the following for a manuall install of a specific version from the repo -sudo apt update -sudo apt install -f ./ffmpeg.deb -y -rm ffmpeg.deb +# wget https://repo.jellyfin.org/releases/server/ubuntu/versions/jellyfin-ffmpeg/6.0.1-1/jellyfin-ffmpeg6_6.0.1-1-jammy_amd64.deb -O ffmpeg.deb + +# sudo apt update +# sudo apt install -f ./ffmpeg.deb -y +# rm ffmpeg.deb + + +## Add the jellyfin repo +sudo apt install curl gnupg -y +sudo apt-get install software-properties-common -y +sudo add-apt-repository universe -y + +sudo mkdir -p /etc/apt/keyrings +curl -fsSL https://repo.jellyfin.org/jellyfin_team.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/jellyfin.gpg +export VERSION_OS="$( awk -F'=' '/^ID=/{ print $NF }' /etc/os-release )" +export VERSION_CODENAME="$( awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release )" +export DPKG_ARCHITECTURE="$( dpkg --print-architecture )" +cat < Date: Fri, 19 Jan 2024 07:39:04 +0100 Subject: [PATCH 5/6] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 3f6ccb7b7c..878e335ed1 100644 --- a/README.md +++ b/README.md @@ -162,6 +162,8 @@ This creates a container that has everything to run and debug the Jellyfin Media this extens the default server with an default installation of ffmpeg6 though the means described here: https://jellyfin.org/docs/general/installation/linux#repository-manual If you want to install a specific ffmpeg version, follow the comments embedded in the `.devcontainer/Dev - Server Ffmpeg/install.ffmpeg.sh` file. +Use the `ghcs .NET Launch (nowebclient, ffmpeg)` launch config to run with the jellyfin-ffmpeg enabled. + ### Running The Tests From 38bf59d6e8485c05b6b877043b6e87ff09e80d45 Mon Sep 17 00:00:00 2001 From: JPVenson Date: Fri, 19 Jan 2024 12:25:39 +0100 Subject: [PATCH 6/6] Update .vscode/launch.json Co-authored-by: Nyanmisaka --- .vscode/launch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 2673973dbf..7e50d4f0a4 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -35,7 +35,7 @@ "request": "launch", "preLaunchTask": "build", "program": "${workspaceFolder}/Jellyfin.Server/bin/Debug/net8.0/jellyfin.dll", - "args": ["--nowebclient", "--ffmpeg", "/usr/share/jellyfin-ffmpeg/ffmpeg"], + "args": ["--nowebclient", "--ffmpeg", "/usr/lib/jellyfin-ffmpeg/ffmpeg"], "cwd": "${workspaceFolder}/Jellyfin.Server", "console": "internalConsole", "stopAtEntry": false,