Rudloff / alltube

Web GUI for youtube-dl
GNU General Public License v3.0
2.94k stars 584 forks source link

Deployment in Docker behind reverse-proxy (Traefik) #371

Closed v-bulynkin closed 2 years ago

v-bulynkin commented 2 years ago

Publish Alltube via /url

Your environment

In Docker:

Please answer these questions when reporting a new issue:

What is your operating system (Windows, Linux, OSX, etc.)? Alpine Linux

What is your web server (Apache, IIS, etc.)? nginx

What version of AllTube are you using? 3.0.0

How did you install AllTube (with Git or with a release package)? Release package

What version of PHP are you using? 7.4

What version of Python are you using? 3.9

What version of youtube-dl are you using? Not yet

Do you get any PHP-related errors in your webserver's logs? One of errors:

2021/08/23 11:46:04 [error] 31#31: *1 FastCGI sent in stderr: "PHP message: PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'session_get_cookie_params' not found or invalid function name in /var/www/html/vendor/aura/session/src/Phpfunc.php on line 33PHP message: PHP Warning: array_merge(): Expected parameter 1 to be an array, null given in /var/www/html/vendor/aura/session/src/Session.php on line 480PHP message: PHP Notice: Trying to access array offset on value of type null in /var/www/html/vendor/aura/session/src/Session.php on line 482PHP message: PHP Notice: Trying to access array offset on value of type null in /var/www/html/vendor/aura/session/src/Session.php on line 483PHP message: PHP Notice: Trying to access array offset on value of type null in /var/www/html/vendor/aura/session/src/Session.php on line 484PHP message: PHP Notice: Trying to access array offset on value of type null in /var/www/html/vendor/aura/session/src/Session.php on line 485PHP message: PHP Notice: Trying to access array offset on value of type null in /var/www/html/vendor/aura/session/src/Session.php on line 486PHP message: PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'session_set_cookie_params' not found or invalid function name in /var/www/html/vendor/aura/session/src/Phpfunc.php on line 33PHP message: PHP Warning: array_merge(): Expected parameter 1 to be an array, null given in /var/www/html/vendor/aura/session/src/Session.php on line 480PHP message: PHP Notice: Trying to access array offset on value of type null in /var/www/html/vendor/aura/session/src/Session.php on line 482PHP message: PHP Notice: Trying to access array offset on value of type null in /var/www/html/vendor/aura/session/src/Session.php on line 483PHP message: PHP Notice: Trying to access array offset on value of type null in /var/www/html/vendor/aura/session/src/Session.php on line 484PHP message: PHP Notice: Trying to access array offset on value of type null in /

What is the content of your config/config.yml file? There is no such file yet

Describe your issue

I have a following Docker deployment:

I' trying to install Alltube to https://docker/alltube. Could you tell me, how to achieve that? My all services, except Wordpress, installed in containers in subfolders: /var/www/html/cloud, /var/www/html/wiki, /var/www/html/webtrees. I've tried the same approach to Alltube, but failed, because I received errors like above or "Bad gateway".

Now I have the following config and receive "Bad gateway" error.

version: '3.7'

services:

  reverse-proxy:
    image: traefik
    container_name: reverse-proxy
    command:
      --providers.docker=true
      --providers.docker.exposedByDefault=false
      --entryPoints.web.address=:80
      --entrypoints.web.http.redirections.entryPoint.to=websecure
      --entrypoints.web.http.redirections.entryPoint.scheme=https
      --entryPoints.websecure.address=:443
      --accesslog=true
    ports:
      - 80:80
      - 443:443
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

  alltube:
    container_name: alltube
    build: ./alltube
    depends_on:
      - alltube-php
    volumes:
      - alltube:/var/www/html
    labels:
      - traefik.enable=true
      - traefik.http.routers.alltube.rule=PathPrefix(`/alltube`)
      - traefik.http.routers.alltube.tls=true
      - traefik.http.routers.alltube.middlewares=alltube-stripprefix,alltube-headers
#      - traefik.http.routers.alltube.middlewares=alltube-stripprefix
#      - traefik.http.routers.alltube.middlewares=alltube-headers
      - traefik.http.middlewares.alltube-stripprefix.stripprefix.prefixes=/alltube
      - traefik.http.middlewares.alltube-headers.headers.customrequestheaders.X-Forwarded-Path=/alltube
      - traefik.http.middlewares.alltube-headers.headers.customresponseheaders.X-Forwarded-Path=/alltube

  alltube-php:
    container_name: alltube-php
    build: ./alltube-php
    volumes:
      - alltube:/var/www/html

How to configure Alltube + Traefik for correct working?

v-bulynkin commented 2 years ago

Solution:

  alltube:
    container_name: alltube
    image: rudloff/alltube
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.alltube.rule=PathPrefix(`/alltube`)"
      - "traefik.http.routers.alltube.middlewares=alltube-strip,alltube-xpath"
      - "traefik.http.middlewares.alltube-strip.stripprefix.prefixes=/alltube"
      - "traefik.http.middlewares.alltube-xpath.headers.customrequestheaders.X-Forwarded-Path=/alltube"