diff --git a/.containers/apps/youtubedltest/BASE b/.containers/apps/youtubedltest/BASE new file mode 100644 index 00000000000..3d66b16fb18 --- /dev/null +++ b/.containers/apps/youtubedltest/BASE @@ -0,0 +1 @@ +focal-20210401 diff --git a/.containers/apps/youtubedltest/Dockerfile b/.containers/apps/youtubedltest/Dockerfile new file mode 100644 index 00000000000..3188518fc2b --- /dev/null +++ b/.containers/apps/youtubedltest/Dockerfile @@ -0,0 +1,104 @@ +# hadolint ignore=DL3007 +FROM ghcr.io/truecharts/ubuntu:latest AS builder + + +WORKDIR /extract/build + +# hadolint ignore=DL3002 +USER root +ARG VERSION +ENV VERSION=4.2 + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +# hadolint ignore=DL3008,DL3015,SC2086,SC2155,DL3003,DL3016 +RUN \ + apt-get -qq update \ + && \ + apt-get -qq install -y \ + npm + +# hadolint ignore=DL3016 +RUN npm install -g @angular/cli + +RUN \ + export URL="https://github.com/Tzahi12345/YoutubeDL-Material/archive/refs/tags/v${VERSION}.tar.gz" \ + && curl -fsSL -o /tmp/youtubedl.tgz "${URL}" \ + && tar ixzf /tmp/youtubedl.tgz -C /extract --strip-components=1 \ + && cp /extract/package.json /extract/package-lock.json /extract/build + +# hadolint ignore=DL3016 +RUN \ + echo "==running NPM install==" \ + && npm install \ + && cp /extract/angular.json /extract/tsconfig.json /extract/build \ + && cp -Rf /extract/src /extract/build \ + && ng build --prod + + +# 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"] + +ARG VERSION + +WORKDIR /app +COPY --chown=apps:apps --from=builder [ "/extract/backend/package.json", "/extract/backend/package-lock.json", "/app/" ] + +# hadolint ignore=DL3008,DL3015,SC2086,SC2155,DL3003,DL3016 +RUN \ + apt-get -qq update \ + && \ + apt-get -qq install -y \ + nodejs \ + npm \ + ffmpeg \ + python \ + ffmpeg \ + atomicparsley \ + && echo "==Installing youtubedl-material==" \ + && npm install \ + && printf "UpdateMethod=docker\nPackageVersion=%s\nPackageAuthor=[TrueCharts Project](https://truecharts.org)" "${VERSION}" > /app/package_info \ + && echo "==Running Cleanup ==" \ + && apt-get remove -y \ + npm \ + && 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/ \ + && mkdir -p /data/appdata \ + && chmod -R 777 /data \ + && chmod -R u=rwX,go=rX /app \ + && printf "umask %d" "${UMASK}" >> /etc/bash.bashrc \ + && update-ca-certificates + +COPY --chown=apps:apps --from=builder [ "/extract/build/backend/public/", "/app/public/" ] +COPY --chown=apps:apps --from=builder [ "/extract/backend/", "/app/" ] + +USER apps +VOLUME /data/appdata + +EXPOSE 17442 +COPY ./.containers/apps/youtubedltest/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/youtubedltest/VERSION b/.containers/apps/youtubedltest/VERSION new file mode 100644 index 00000000000..bf77d549685 --- /dev/null +++ b/.containers/apps/youtubedltest/VERSION @@ -0,0 +1 @@ +4.2 diff --git a/.containers/apps/youtubedltest/entrypoint.sh b/.containers/apps/youtubedltest/entrypoint.sh new file mode 100644 index 00000000000..5c0af08f3d5 --- /dev/null +++ b/.containers/apps/youtubedltest/entrypoint.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + + +exec node /app/app.js ${@} ${EXTRA_ARGS} diff --git a/.containers/apps/youtubedltest/goss.yaml b/.containers/apps/youtubedltest/goss.yaml new file mode 100644 index 00000000000..9c75ee0dc40 --- /dev/null +++ b/.containers/apps/youtubedltest/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/youtubedltest/latest-base.sh b/.containers/apps/youtubedltest/latest-base.sh new file mode 100644 index 00000000000..2d4403d5130 --- /dev/null +++ b/.containers/apps/youtubedltest/latest-base.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +cat "./.containers/base/ubuntu/VERSION" diff --git a/.containers/apps/youtubedltest/latest-version.sh b/.containers/apps/youtubedltest/latest-version.sh new file mode 100644 index 00000000000..903c68ffac8 --- /dev/null +++ b/.containers/apps/youtubedltest/latest-version.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +version=$(curl -sX GET "https://api.github.com/repos/Tzahi12345/YoutubeDL-Material/releases" | jq --raw-output '.[0].tag_name') +version="${version#*v}" +version="${version#*release-}" +printf "%s" "${version}"