diff --git a/Dockerfile b/Dockerfile index 47eea8c..258e7e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,75 +1,66 @@ +# Fetching our ffmpeg FROM ubuntu:22.04 AS ffmpeg - ENV DEBIAN_FRONTEND=noninteractive +# Use script due local build compability +COPY ffmpeg-fetch.sh . +RUN sh ./ffmpeg-fetch.sh -COPY docker-build.sh . -RUN sh ./docker-build.sh - -#--------------# Stage 2 - -FROM ubuntu:22.04 as frontend +# Create our Ubuntu 22.04 with node 16 +# Go to 20.04 +FROM ubuntu:20.04 AS base ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get -y install \ - curl \ - gnupg \ - # Ubuntu 22.04 ships Node.JS 12 by default :) - nodejs \ - # needed on 21.10 and before, maybe not on 22.04 YARN: brings along npm, solves dependency conflicts, - # spares us this spaghetti approach: https://stackoverflow.com/a/60547197 - npm && \ - apt-get install -f && \ - npm config set strict-ssl false && \ - npm install -g @angular/cli - +ENV UID=1000 +ENV GID=1000 +ENV USER=youtube +ENV NO_UPDATE_NOTIFIER=true +ENV PM2_HOME=/app/pm2 +RUN groupadd -g $GID $USER && useradd --system -m -g $USER --uid $UID $USER && \ + apt update && \ + apt install -y --no-install-recommends curl ca-certificates && \ + curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \ + apt install -y --no-install-recommends nodejs && \ + npm -g install npm && \ + apt clean && \ + rm -rf /var/lib/apt/lists/* + + +# Build frontend +FROM base as frontend +RUN npm install -g @angular/cli WORKDIR /build -COPY [ "package.json", "package-lock.json", "/build/" ] -RUN npm install - -COPY [ "angular.json", "tsconfig.json", "/build/" ] +COPY [ "package.json", "package-lock.json", "angular.json", "tsconfig.json", "/build/" ] COPY [ "src/", "/build/src/" ] -RUN npm run build - -#--------------# Final Stage - -FROM ubuntu:22.04 +RUN npm install && \ + npm run build && \ + ls -al /build/backend/public -ENV UID=1000 \ - GID=1000 \ - USER=youtube \ - NO_UPDATE_NOTIFIER=true -ENV DEBIAN_FRONTEND=noninteractive - -RUN groupadd -g $GID $USER && useradd --system -g $USER --uid $UID $USER +# Install backend deps +FROM base as backend +WORKDIR /app +COPY [ "backend/","/app/" ] +RUN npm config set strict-ssl false && \ + npm install --prod && \ + ls -al -RUN apt-get update && apt-get -y install \ - npm \ - python2 \ - python3 \ - gosu \ - atomicparsley && \ - apt-get install -f && \ - apt-get autoremove --purge && \ - apt-get autoremove && \ - apt-get clean && \ - rm -rf /var/lib/apt +# Final image +FROM base +RUN npm install -g pm2 && \ + apt update && \ + apt install -y --no-install-recommends gosu python3-minimal python-is-python3 atomicparsley && \ + apt clean && \ + rm -rf /var/lib/apt/lists/* WORKDIR /app +# User 1000 already exist from base image COPY --chown=$UID:$GID --from=ffmpeg [ "/usr/local/bin/ffmpeg", "/usr/local/bin/ffmpeg" ] COPY --chown=$UID:$GID --from=ffmpeg [ "/usr/local/bin/ffprobe", "/usr/local/bin/ffprobe" ] -COPY --chown=$UID:$GID [ "backend/package.json", "backend/package-lock.json", "/app/" ] -ENV PM2_HOME=/app/pm2 -RUN npm config set strict-ssl false && \ - npm install pm2 -g && \ - npm install && chown -R $UID:$GID ./ - -# needed for ubuntu, see #596 -RUN ln -s /usr/bin/python3 /usr/bin/python - +COPY --chown=$UID:$GID --from=backend ["/app/","/app/"] COPY --chown=$UID:$GID --from=frontend [ "/build/backend/public/", "/app/public/" ] -COPY --chown=$UID:$GID [ "/backend/", "/app/" ] +# Add some persistence data +#VOLUME ["/app/appdata"] EXPOSE 17442 ENTRYPOINT [ "/app/entrypoint.sh" ] -CMD [ "pm2-runtime", "pm2.config.js" ] +CMD [ "pm2-runtime","--raw","pm2.config.js" ] diff --git a/backend/youtube-dl.js b/backend/youtube-dl.js index a94e566..4e1c5ff 100644 --- a/backend/youtube-dl.js +++ b/backend/youtube-dl.js @@ -90,7 +90,7 @@ exports.updateYoutubeDL = async (latest_update_version) => { exports.verifyBinaryExistsLinux = () => { const details_json = fs.readJSONSync(CONSTS.DETAILS_BIN_PATH); - if (!is_windows && details_json && details_json['path'].includes('.exe')) { + if (!is_windows && details_json && details_json['path'] && details_json['path'].includes('.exe')) { details_json['path'] = 'node_modules/youtube-dl/bin/youtube-dl'; details_json['exec'] = 'youtube-dl'; details_json['version'] = OUTDATED_VERSION; diff --git a/docker-build.sh b/ffmpeg-fetch.sh similarity index 97% rename from docker-build.sh rename to ffmpeg-fetch.sh index 2a81d43..3b1ac78 100644 --- a/docker-build.sh +++ b/ffmpeg-fetch.sh @@ -40,4 +40,4 @@ echo "(4/5) PROVISION - Provide ffmpeg and ffprobe from ffmpeg obtain layer" cp /tmp/ffmpeg/*/ffmpeg /usr/local/bin/ffmpeg cp /tmp/ffmpeg/*/ffprobe /usr/local/bin/ffprobe echo "(5/5) CLEANUP - Remove temporary downloads from ffmpeg obtain layer" -rm -rf /tmp/ffmpeg ffmpeg.txz \ No newline at end of file +rm -rf /tmp/ffmpeg ffmpeg.txz diff --git a/src/assets/i18n/messages.es.xlf b/src/assets/i18n/messages.es.xlf index bcf54aa..e26c1df 100644 --- a/src/assets/i18n/messages.es.xlf +++ b/src/assets/i18n/messages.es.xlf @@ -1,4 +1,4 @@ - + @@ -1630,6 +1630,198 @@ 469 + + Date + Fecha + + src/app/components/downloads/downloads.component.html + 7 + + Date + + + Title + Título + + src/app/components/downloads/downloads.component.html + 13 + + + src/app/components/tasks/tasks.component.html + 6 + + Title + + + Subscription + Suscripción + + src/app/components/downloads/downloads.component.html + 23 + + Subscription + + + Progress + Progreso + + src/app/components/downloads/downloads.component.html + 42 + + Progress + + + Tasks + Tareas + + src/app/app.component.html + 47 + + Navigation menu Tasks Page title + + + Watch content + Ver archivo + + src/app/components/downloads/downloads.component.html + 64 + + Watch content + + + Creating download + Creando descarga + + src/app/components/downloads/downloads.component.ts + 58 + + + + Resume all downloads + Reanudar todas las descargas + + src/app/components/downloads/downloads.component.html + 84 + + Resume all downloads + + + Stage + Etapa + + src/app/components/downloads/downloads.component.html + 36 + + Stage + + + Actions + Acciones + + src/app/components/downloads/downloads.component.html + 55 + + + src/app/components/tasks/tasks.component.html + 49 + + Actions + + + Pause + Pausa + + src/app/components/downloads/downloads.component.html + 59 + + Pause + + + Clear + Quitar + + src/app/components/downloads/downloads.component.html + 68 + + Clear + + + Resume + Resumir + + src/app/components/downloads/downloads.component.html + 60 + + Resume + + + Restart + Reanudar + + src/app/components/downloads/downloads.component.html + 66 + + Restart + + + Pause all downloads + Pausar todas las descargas + + src/app/components/downloads/downloads.component.html + 83 + + Pause all downloads + + + Downloading file + Descargando archivo + + src/app/components/downloads/downloads.component.ts + 60 + + + + Show error + Mostrar error + + src/app/components/downloads/downloads.component.html + 65 + + Show error + + + Clear finished downloads + Quitar descargas finalizadas + + src/app/components/downloads/downloads.component.html + 85 + + Clear finished downloads + + + Getting info + Cogiendo info + + src/app/components/downloads/downloads.component.ts + 59 + + + + Complete + Completo + + src/app/components/downloads/downloads.component.ts + 61 + + + + Clear finished downloads + Borrar descargas terminadas + + src/app/components/downloads/downloads.component.ts + 129 + + diff --git a/src/assets/i18n/messages.nl.xlf b/src/assets/i18n/messages.nl.xlf index 03cb155..829af1c 100644 --- a/src/assets/i18n/messages.nl.xlf +++ b/src/assets/i18n/messages.nl.xlf @@ -1392,7 +1392,7 @@ Allow subscriptions setting - Base bath for subscriptions + Subscriptions base path Abonnementenbasispad src/app/settings/settings.component.html @@ -2854,8 +2854,8 @@ - Error for - Foutmelding bij + Error for + Foutmelding bij src/app/components/downloads/downloads.component.ts 238 @@ -3097,13 +3097,303 @@ Autoplay checkbox - Download for has been queued! - staat in de wachtrij! + Download for has been queued! + staat in de wachtrij! src/app/main/main.component.ts 469 + + Tasks + Taken + + src/app/app.component.html + 47 + + Navigation menu Tasks Page title + + + N/A + n/b + + src/app/components/tasks/tasks.component.html + 19 + + + src/app/components/tasks/tasks.component.html + 28 + + N/A + + + Last confirmed + Laatst bevestigd: + + src/app/components/tasks/tasks.component.html + 25 + + Last confirmed + + + Status + Status + + src/app/components/tasks/tasks.component.html + 34 + + Status + + + Busy + Bezig + + src/app/components/tasks/tasks.component.html + 36 + + Busy + + + Not scheduled + Niet ingepland + + src/app/components/tasks/tasks.component.html + 42 + + Not scheduled + + + Clear missing files from DB: + Ontbrekende bestanden wissen uit DB: + + src/app/components/tasks/tasks.component.html + 57 + + Clear missing files from DB + + + Clear duplicate files from DB: + Gedupliceerde bestanden wissen uit DB: + + src/app/components/tasks/tasks.component.html + 60 + + Clear duplicate files from DB + + + Update binary to: + Uitvoerbaar bestand bijwerken naar + + src/app/components/tasks/tasks.component.html + 63 + + Update binary to + + + Run + Uitvoeren + + src/app/components/tasks/tasks.component.html + 69 + + Run + + + Schedule + Inplannen + + src/app/components/tasks/tasks.component.html + 72 + + Schedule + + + Failed to run task! + De taak kan niet worden uitgevoerd! + + src/app/components/tasks/tasks.component.ts + 79 + + + src/app/components/tasks/tasks.component.ts + 81 + + + + Successfully confirmed task! + De taak is bevestigd! + + src/app/components/tasks/tasks.component.ts + 89 + + + + Failed to confirm task! + De taak kan niet worden bevestigd! + + src/app/components/tasks/tasks.component.ts + 90 + + + src/app/components/tasks/tasks.component.ts + 92 + + + + Would you like to reset your tasks? All your schedules will be removed as well. + Weet je zeker dat je alle taken wilt herstellen? Alle schema's worden hierdoor gewist. + + src/app/components/tasks/tasks.component.ts + 133 + + + + Reset + Herstellen + + src/app/components/tasks/tasks.component.ts + 134 + + + + Failed to reset tasks! + De taken kunnen niet worden hersteld! + + src/app/components/tasks/tasks.component.ts + 144 + + + src/app/components/tasks/tasks.component.ts + 147 + + + + Restore + Herstellen + + src/app/dialogs/restore-db-dialog/restore-db-dialog.component.html + 25 + + Restore button + + + Update task schedule + Taakschema bijwerken + + src/app/dialogs/update-task-schedule-dialog/update-task-schedule-dialog.component.html + 1 + + Update task schedule + + + Enabled + Ingeschakeld + + src/app/dialogs/update-task-schedule-dialog/update-task-schedule-dialog.component.html + 7 + + Enabled + + + Recurring + Herhalen + + src/app/dialogs/update-task-schedule-dialog/update-task-schedule-dialog.component.html + 10 + + Recurring + + + Update + Bijwerken + + src/app/dialogs/update-task-schedule-dialog/update-task-schedule-dialog.component.html + 52 + + Update button + + + Last ran + Laatst uitgevoerd: + + src/app/components/tasks/tasks.component.html + 16 + + Last ran + + + Scheduled for + Ingepland om + + src/app/components/tasks/tasks.component.html + 38 + + Scheduled + + + Restore DB from backup + DB herstellen uit back-up + + src/app/components/tasks/tasks.component.html + 89 + + + src/app/dialogs/restore-db-dialog/restore-db-dialog.component.html + 1 + + Restore DB from backup button + + + Reset tasks + Taken herstellen + + src/app/components/tasks/tasks.component.ts + 132 + + + + Successfully ran task! + De taak is uitgevoerd! + + src/app/components/tasks/tasks.component.ts + 78 + + + + Reset tasks + Taken herstellen + + src/app/components/tasks/tasks.component.html + 90 + + Reset tasks button + + + No tasks available! + Er zijn geen taken beschikbaar! + + src/app/components/tasks/tasks.component.html + 94 + + No tasks label + + + Tasks successfully reset! + De taken zijn hersteld! + + src/app/components/tasks/tasks.component.ts + 142 + + + + Global custom args for downloads on the home page. (Set args for subscriptions for each subscriptions separately!) Args are delimited using two commas like so: ,, + Globale aanvullende opties voor downloades. (Stel ze per abonnement in!) Scheid de opties met twee komma's, dus ,, + + src/app/settings/settings.component.html + 128 + + Custom args setting input hint + diff --git a/src/assets/i18n/messages.zh.xlf b/src/assets/i18n/messages.zh.xlf index be003db..5ed8f19 100644 --- a/src/assets/i18n/messages.zh.xlf +++ b/src/assets/i18n/messages.zh.xlf @@ -733,7 +733,7 @@ Subscriptions base path - 订阅文件路径 + 订阅基路径 app/settings/settings.component.html 72