From 6352b24c19db276b5858f4855ab95c42fa4ef76e Mon Sep 17 00:00:00 2001 From: Lorenzo Carbonell Date: Fri, 13 Jan 2023 20:20:26 +0100 Subject: [PATCH] metube --- metube/README.md | 42 +++++++++++++++++++++++++++++++ metube/docker-compose.caddy.yml | 13 ++++++++++ metube/docker-compose.traefik.yml | 21 ++++++++++++++++ metube/docker-compose.yml | 15 +++++++++++ metube/sample.env | 1 + 5 files changed, 92 insertions(+) create mode 100644 metube/README.md create mode 100644 metube/docker-compose.caddy.yml create mode 100644 metube/docker-compose.traefik.yml create mode 100644 metube/docker-compose.yml create mode 100644 metube/sample.env diff --git a/metube/README.md b/metube/README.md new file mode 100644 index 0000000..5776881 --- /dev/null +++ b/metube/README.md @@ -0,0 +1,42 @@ +# Installation + +``` +git clone https://github.com/atareao/self-hosted.git +cd self-hosted/metube +mv sample.env .env +sed -i "s/dnote.tuservidor.es/el_fqdn_que_quieras/g" .env +``` + +A la hora de levantar el servicio dependerá del proxy inverso que hayas seleccionado. Si has elegido Caddy, simplemente, + +``` +docker-compose -f docker-compose.yml -f docker-compose.caddy.yml up -d +docker-compose logs -f +``` + +Mientras que si has elegido Traefik, + +``` +docker-compose -f docker-compose.yml -f docker-compose.traefik.yml up -d +docker-compose logs -f +``` + +## Configuration via environment variables + +Certain values can be set via environment variables, using the -e parameter on the docker command line, or the environment: section in docker-compose. + +* `UID`: user under which MeTube will run. Defaults to 1000. +* `GID`: group under which MeTube will run. Defaults to 1000. +* `UMASK`: umask value used by MeTube. Defaults to 022. +* `DOWNLOAD_DIR`: path to where the downloads will be saved. Defaults to /downloads in the docker image, and . otherwise. +* `AUDIO_DOWNLOAD_DIR`: path to where audio-only downloads will be saved, if you wish to separate them from the video downloads. Defaults to the value of DOWNLOAD_DIR. +* `CUSTOM_DIRS`: whether to enable downloading videos into custom directories within the DOWNLOAD_DIR (or AUDIO_DOWNLOAD_DIR). When enabled, a drop-down appears next to the Add button to specify the download directory. Defaults to true. +* `CREATE_CUSTOM_DIRS`: whether to support automatically creating directories within the DOWNLOAD_DIR (or AUDIO_DOWNLOAD_DIR) if they do not exist. When enabled, the download directory selector becomes supports free-text input, and the specified directory will be created recursively. Defaults to false. +* `STATE_DIR`: path to where the queue persistence files will be saved. Defaults to /downloads/.metube in the docker image, and . otherwise. +* `URL_PREFIX`: base path for the web server (for use when hosting behind a reverse proxy). Defaults to /. +* `OUTPUT_TEMPLATE`: the template for the filenames of the downloaded videos, formatted according to this spec. Defaults to %(title)s.%(ext)s. +* `OUTPUT_TEMPLATE_CHAPTER`: the template for the filenames of the downloaded videos, when split into chapters via postprocessors. Defaults to %(title)s - %(section_number)s %(section_title)s.%(ext)s. +* `YTDL_OPTIONS`: Additional options to pass to youtube-dl, in JSON format. See available options here. They roughly correspond to command-line options, though some do not have exact equivalents here, for example --recode-video has to be specified via postprocessors. Also note that dashes are replaced with underscores. + +More info in [metube](https://github.com/alexta69/metube) + diff --git a/metube/docker-compose.caddy.yml b/metube/docker-compose.caddy.yml new file mode 100644 index 0000000..b1992ae --- /dev/null +++ b/metube/docker-compose.caddy.yml @@ -0,0 +1,13 @@ +version: "3.7" + +services: + metube: + networks: + - proxy + labels: + - caddy="${FQDN}" + - caddy.reverse_proxy="{{upstreams 8081}}" + +networks: + proxy: + external: true diff --git a/metube/docker-compose.traefik.yml b/metube/docker-compose.traefik.yml new file mode 100644 index 0000000..5dafd8d --- /dev/null +++ b/metube/docker-compose.traefik.yml @@ -0,0 +1,21 @@ +version: "3.7" + +services: + metube: + networks: + - proxy + labels: + - traefik.enable=true + - traefik.http.services.metube.loadbalancer.server.port=8081 + - traefik.http.routers.metube.entrypoints=web + - traefik.http.routers.metube.rule=Host(`${FQDN}`) + - traefik.http.middlewares.metube-https-redirect.redirectscheme.scheme=websecure + - traefik.http.routers.metube.middlewares=metube-https-redirect + - traefik.http.routers.metube-secure.entrypoints=websecure + - traefik.http.routers.metube-secure.rule=Host(`${FQDN}`) + - traefik.http.routers.metube-secure.tls=true + - traefik.http.routers.metube-secure.tls.certresolver=letsencrypt + +networks: + proxy: + external: true diff --git a/metube/docker-compose.yml b/metube/docker-compose.yml new file mode 100644 index 0000000..e468877 --- /dev/null +++ b/metube/docker-compose.yml @@ -0,0 +1,15 @@ +version: "3.7" + +services: + metube: + image: alexta69/metube + container_name: metube + init: true + restart: unless-stopped + networks: + - internal + volumes: + - metube:/downloads + +volumes: + metube: 8081 diff --git a/metube/sample.env b/metube/sample.env new file mode 100644 index 0000000..4e12c8b --- /dev/null +++ b/metube/sample.env @@ -0,0 +1 @@ +FQDN=metube.tuservidor.es