From a9a7eaf82eb74cfb6a85a7423bd308e450e3e94d Mon Sep 17 00:00:00 2001 From: Kjeld Schouten-Lebbing Date: Sat, 17 Apr 2021 17:01:43 +0200 Subject: [PATCH] Add youtubedl-Material Container (#374) --- .containers/apps/ombi/latest-base.sh | 1 + .containers/apps/youtubedl/BASE | 1 + .containers/apps/youtubedl/Dockerfile | 67 ++++++++++++++++++++ .containers/apps/youtubedl/VERSION | 1 + .containers/apps/youtubedl/entrypoint.sh | 3 + .containers/apps/youtubedl/goss.yaml | 14 ++++ .containers/apps/youtubedl/latest-base.sh | 2 + .containers/apps/youtubedl/latest-version.sh | 6 ++ .containers/base/alpine/latest-version.sh | 0 .github/workflows/containers.build.yaml | 2 +- 10 files changed, 96 insertions(+), 1 deletion(-) mode change 100644 => 100755 .containers/apps/ombi/latest-base.sh create mode 100644 .containers/apps/youtubedl/BASE create mode 100644 .containers/apps/youtubedl/Dockerfile create mode 100644 .containers/apps/youtubedl/VERSION create mode 100755 .containers/apps/youtubedl/entrypoint.sh create mode 100644 .containers/apps/youtubedl/goss.yaml create mode 100755 .containers/apps/youtubedl/latest-base.sh create mode 100755 .containers/apps/youtubedl/latest-version.sh mode change 100644 => 100755 .containers/base/alpine/latest-version.sh diff --git a/.containers/apps/ombi/latest-base.sh b/.containers/apps/ombi/latest-base.sh old mode 100644 new mode 100755 index 5810deebd04..2d4403d5130 --- a/.containers/apps/ombi/latest-base.sh +++ b/.containers/apps/ombi/latest-base.sh @@ -1 +1,2 @@ +#!/usr/bin/env bash cat "./.containers/base/ubuntu/VERSION" diff --git a/.containers/apps/youtubedl/BASE b/.containers/apps/youtubedl/BASE new file mode 100644 index 00000000000..3d66b16fb18 --- /dev/null +++ b/.containers/apps/youtubedl/BASE @@ -0,0 +1 @@ +focal-20210401 diff --git a/.containers/apps/youtubedl/Dockerfile b/.containers/apps/youtubedl/Dockerfile new file mode 100644 index 00000000000..9b902b170e6 --- /dev/null +++ b/.containers/apps/youtubedl/Dockerfile @@ -0,0 +1,67 @@ +# hadolint ignore=DL3007 +FROM ghcr.io/truecharts/ubuntu:latest + +ENV NO_UPDATE_NOTIFIER=true +ENV NODE_ENV=production +ENV APP_DIR="/app" + +ARG TARGETPLATFORM +ARG BUILDPLATFORM +ARG VERSION + +# hadolint ignore=DL3002 +USER root + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +# hadolint ignore=DL3008,DL3015,SC2086,SC2155,DL3003,DL3016 +RUN \ + apt-get -qq update \ + && \ + apt-get -qq install -y \ + nodejs \ + youtube-dl \ + ffmpeg \ + unzip \ + python \ + npm \ + ffmpeg \ + atomicparsley \ + && \ + mkdir -p /extract \ + && \ + export URL="https://github.com/Tzahi12345/YoutubeDL-Material/releases/download/v${VERSION}/youtubedl-material-v${VERSION}.zip" \ + && curl -fsSL -o /tmp/youtubedl.zip "${URL}" \ + && unzip /tmp/youtubedl.zip -d /tmp \ + && rm -Rf /app || Skip deleting app directory \ + && cp -Rf /tmp/youtubedl-material /app \ + && printf "UpdateMethod=docker\nPackageVersion=%s\nPackageAuthor=[TrueCharts Project](https://truecharts.org)" "${VERSION}" > /app/package_info \ + && echo "==running NPM install==" \ + && cd /app \ + && npm install \ + && echo "==Running Cleanup ==" \ + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ + && apt-get autoremove -y \ + && apt-get clean \ + && \ + rm -rf \ + /tmp/* \ + /var/lib/apt/lists/* \ + /var/tmp/ \ + && chmod -R u=rwX,go=rX /app \ + && chown -R apps:apps /app \ + && printf "umask %d" "${UMASK}" >> /etc/bash.bashrc \ + && update-ca-certificates + +WORKDIR /app +VOLUME /app +USER apps + +EXPOSE 17442 +COPY ./.containers/apps/youtubedl/entrypoint.sh /entrypoint.sh +CMD [ "/entrypoint.sh" ] + +LABEL "maintainer"="TrueCharts " +LABEL "authors"="TrueCharts " +LABEL "org.opencontainers.image.source"="https://github.com/truecharts/apps/tree/master/.containers/apps/youtubedl" +LABEL "org.opencontainers.image.documentation "="https://truecharts.org" diff --git a/.containers/apps/youtubedl/VERSION b/.containers/apps/youtubedl/VERSION new file mode 100644 index 00000000000..bf77d549685 --- /dev/null +++ b/.containers/apps/youtubedl/VERSION @@ -0,0 +1 @@ +4.2 diff --git a/.containers/apps/youtubedl/entrypoint.sh b/.containers/apps/youtubedl/entrypoint.sh new file mode 100755 index 00000000000..067df6c2f99 --- /dev/null +++ b/.containers/apps/youtubedl/entrypoint.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +exec node /app/app.js ${@} ${EXTRA_ARGS} diff --git a/.containers/apps/youtubedl/goss.yaml b/.containers/apps/youtubedl/goss.yaml new file mode 100644 index 00000000000..9c75ee0dc40 --- /dev/null +++ b/.containers/apps/youtubedl/goss.yaml @@ -0,0 +1,14 @@ +--- +process: + node: + running: true + +port: + tcp6:17442: + listening: true + +# http: +# http://localhost:9117/UI/Login: +# status: 200 +# body: +# - 'Jackett' diff --git a/.containers/apps/youtubedl/latest-base.sh b/.containers/apps/youtubedl/latest-base.sh new file mode 100755 index 00000000000..2d4403d5130 --- /dev/null +++ b/.containers/apps/youtubedl/latest-base.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +cat "./.containers/base/ubuntu/VERSION" diff --git a/.containers/apps/youtubedl/latest-version.sh b/.containers/apps/youtubedl/latest-version.sh new file mode 100755 index 00000000000..675ffbcf787 --- /dev/null +++ b/.containers/apps/youtubedl/latest-version.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +version=$(curl -sX GET "https://api.github.com/reposTzahi12345/YoutubeDL-Material/releases" | jq --raw-output '.[0].tag_name') +version="${version#*v}" +version="${version#*release-}" +printf "%s" "${version}" diff --git a/.containers/base/alpine/latest-version.sh b/.containers/base/alpine/latest-version.sh old mode 100644 new mode 100755 diff --git a/.github/workflows/containers.build.yaml b/.github/workflows/containers.build.yaml index 87fdce33a9c..0872d78c699 100644 --- a/.github/workflows/containers.build.yaml +++ b/.github/workflows/containers.build.yaml @@ -92,7 +92,7 @@ jobs: fi if [ "${{github.event_name}}" == "pull_request" ]; then echo ::set-output name=push::false - echo ::set-output name=cache_from::"type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ matrix.container }}:buildcache" + echo ::set-output name=cache_from::"type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ matrix.container }}:buildcache" || echo ::set-output name=cache_from::"" echo ::set-output name=cache_to::"" else echo ::set-output name=push::true