linuxserver / docker-pyload-ng

GNU General Public License v3.0
83 stars 10 forks source link

Being redirected to HTTP when serving app via HTTPS #5

Closed Stolz closed 2 years ago

Stolz commented 2 years ago

linuxserver.io


Expected Behavior

Internal redirects should use HTTPS when the application is accessed via HTTPS. The application should properly detect the protocol used to access it or alternatively it should provide some environment variable(s) to configure the base URL used for links and redirects.

Current Behavior

If you serve the application via a reverse proxy with HTTPS enabled, when you visit the HTTPS home page of the application, you are redicted to the HTTP (not HTTPS) login page.

Steps to Reproduce

  1. Run the app behind a reverse proxy that exposes it via HTTPS.
  2. Visit the app using HTTPS protocol.
  3. You will be redirected to the HTTP login page instead of HTTPS.
wget -S -v -O- https://pyload.example.com/
--2022-01-27 00:39:09--  https://pyload.example.com/
Resolving pyload.example.com... 192.168.0.9
Connecting to pyload.example.com|192.168.0.9|:443... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 302 Found
  Content-Length: 315
  Content-Type: text/html; charset=utf-8
  Date: Wed, 26 Jan 2022 16:38:56 GMT
  Location: http://pyload.example.com/login?next=http%3A%2F%2Fpyload.example.com%2F
  Server: Cheroot/8.6.0
Location: http://pyload.example.com/login?next=http%3A%2F%2Fpyload.example.com%2F [following]
--2022-01-27 00:39:09--  http://pyload.example.com/login?next=http%3A%2F%2Fpyload.example.com%2F
Connecting to pyload.example.com|192.168.0.9|:80...

Environment

OS: Gentoo Linux CPU architecture: x86_64 How docker service was installed: from the distro repo

Command used to create docker container

version: '3'
services:
  pyload:
    container_name: pyload
    environment:
      PGID: 1000
      PUID: 1000
      TZ: Asia/Hong_Kong
    hostname: pyload
    image: lscr.io/linuxserver/pyload-ng:latest
    labels:
      - traefik.enable=true
      - traefik.http.routers.pyload.tls.certresolver=le
      - traefik.http.services.pyload.loadbalancer.server.port=8000
    networks:
      - proxy
    restart: unless-stopped
    volumes:
      - ./config:/config
      - /storage/downloads:/downloads
networks:
  proxy:
    external: true

Docker logs

[2022-01-27 00:31:42]  INFO                pyload  *** Welcome to pyLoad 0.5.0 ***
[2022-01-27 00:31:42]  DEBUG               pyload  Indexing plugins...
[2022-01-27 00:31:42]  INFO                pyload  Activated plugins: ClickNLoad, ExternalScripts, TORRENT, UnSkipOnFail, UserAgentSwitcher
[2022-01-27 00:31:42]  INFO                pyload  Deactivate plugins: AndroidPhoneNotify, AntiCaptcha, AntiStandby, AntiVirus, AppriseNotify, BypassCaptcha, Captcha9Kw, Checksum, CloudFlareDdos, DeathByCaptcha, DeleteFinished, DiscordNotifier, DownloadScheduler, ExpertDecoders, ExtractArchive, HotFolder, IRC, ImageTyperz, JustPremium, LinkFilter, LinkdecrypterComHook, LogMarker, MergeFiles, MultiHome, PushBullet, PushOver, RestartFailed, SkipRev, TransmissionRPC, UpdateManager, WindowsPhoneNotify, XFileSharing, XMPP
[2022-01-27 00:31:42]  DEBUG               pyload  Starting core...
[2022-01-27 00:31:42]  DEBUG               pyload  Debug level: TRACE
[2022-01-27 00:31:42]  DEBUG               pyload  Setup language...
[2022-01-27 00:31:42]  DEBUG               pyload  Setup permissions...
[2022-01-27 00:31:42]  INFO                pyload  User directory: /config
[2022-01-27 00:31:42]  INFO                pyload  Cache directory: /tmp/pyLoad
[2022-01-27 00:31:42]  INFO                pyload  Storage directory: /downloads
[2022-01-27 00:31:42]  INFO                pyload  Storage free space: 128.22 GiB
[2022-01-27 00:31:42]  DEBUG               pyload  Setup network...
[2022-01-27 00:31:42]  INFO                pyload  Activating accounts...
[2022-01-27 00:31:42]  INFO                pyload  Activating Plugins...
[2022-01-27 00:31:42]  DEBUG               pyload  ADDON ExternalScripts: No script found under folder `pyload_start`
[2022-01-27 00:31:42]  WARNING             pyload  ADDON TORRENT: torrents / magnets are not associated with any plugin
[2022-01-27 00:31:42]  WARNING       pyload.webui  Starting webserver: http://0.0.0.0:8000
[2022-01-27 00:31:42]  DEBUG               pyload  *** pyLoad is up and running ***
[2022-01-27 00:31:47]  DEBUG               pyload  ADDON ClickNLoad: Backend found on http://127.0.0.1:8000
[2022-01-27 00:31:47]  INFO                pyload  ADDON ClickNLoad: Proxy listening on 0.0.0.0:9666
github-actions[bot] commented 2 years ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

aptalca commented 2 years ago

That sounds like an app issue and not a container one (assuming it's not an issue with your reverse proxy). It should be reported upstream to pyload

Stolz commented 2 years ago

OK, thanks. I'll report it upstream