From 9b160cab11e35619c64369d5ae5d9187fc2bcaa9 Mon Sep 17 00:00:00 2001 From: meeb Date: Fri, 27 Nov 2020 17:50:15 +1100 Subject: [PATCH] add bundled ffmpeg version to app when built in a container --- Dockerfile | 3 +++ app/common/context_processors.py | 5 +++-- app/common/templates/base.html | 8 ++++++-- app/common/third_party_versions.py | 9 +++++++++ 4 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 app/common/third_party_versions.py diff --git a/Dockerfile b/Dockerfile index 5fcccc9..a98a862 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,6 +32,9 @@ ARG default_gid="10000" COPY app /app COPY app/tubesync/local_settings.py.container /app/tubesync/local_settings.py +# Append container bundled software versions +RUN echo "ffmpeg_version = '${FFMPEG_VERSION}-static'" >> /app/common/third_party_versions.py + # Add Pipfiles COPY Pipfile /app/Pipfile COPY Pipfile.lock /app/Pipfile.lock diff --git a/app/common/context_processors.py b/app/common/context_processors.py index 1534b11..370e933 100644 --- a/app/common/context_processors.py +++ b/app/common/context_processors.py @@ -1,9 +1,10 @@ from django.conf import settings -from youtube_dl import version as yt_version +from .third_party_versions import youtube_dl_version, ffmpeg_version def app_details(request): return { 'app_version': str(settings.VERSION), - 'youtube_dl_version': str(yt_version.__version__) + 'youtube_dl_version': youtube_dl_version, + 'ffmpeg_version': ffmpeg_version, } diff --git a/app/common/templates/base.html b/app/common/templates/base.html index e5a99f0..22354b8 100644 --- a/app/common/templates/base.html +++ b/app/common/templates/base.html @@ -49,9 +49,13 @@ {% include 'tubesync.svg' with width='0.8rem' height='0.8rem' %} TubeSync is an open source synchronisation tool to automatically download videos from online video platforms. The original code under a GPLv3 licence is available at - https://github.com/meeb/tubesync. + https://github.com/meeb/tubesync. +

+

+ TubeSync version {{ app_version }} with + youtube-dl version {{ youtube_dl_version }} and + FFmpeg version {{ ffmpeg_version }}.

-

TubeSync version {{ app_version }} with youtube-dl version {{ youtube_dl_version }}.

diff --git a/app/common/third_party_versions.py b/app/common/third_party_versions.py new file mode 100644 index 0000000..4351040 --- /dev/null +++ b/app/common/third_party_versions.py @@ -0,0 +1,9 @@ +from youtube_dl import version as yt_version + + +youtube_dl_version = str(yt_version.__version__) +ffmpeg_version = '[shared system install]' + + +# This file may contain data dynamically written during the container build process +# that replaces the above versions. Do not edit below this line