alexta69 / metube

Self-hosted YouTube downloader (web UI for youtube-dl / yt-dlp)
GNU Affero General Public License v3.0
4k stars 263 forks source link

Password protect metube UI #308

Closed suntong closed 9 months ago

suntong commented 11 months ago

Same asking as #163,

Is there any way to apply auth (username and password) in metube Web UI??

I know the given answer is,

Use "username" and "password" parameters in YTDL_OPTIONS (https://github.com/alexta69/metube#configuration-via-environment-variables).

However, I'm not sure if it is for youtube-dl username and password or the username and password for the metube Web UI instead? I tried to ask the question there several times in different ways, but no any reply, hence asking again as a new question. Thanks @alexta69.

PikuZheng commented 11 months ago

I don't think so. "username" and "password" in YTDL_OPTIONS are used for "authentication purposes" 1 2

I think a better way is to use a reverse proxy such as nginx #150 #217 #226

suntong commented 11 months ago

Yeah, agree. Thanks for the confirmation and links!

suntong commented 11 months ago

My metube is on the internet and just takes the secondary path (for ifttt). According to the access logs, no one has guessed the correct path so far. So they will just get a 404. I think metube is safe as long as address and path are not recorded in public.

Originally posted by @PikuZheng in https://github.com/alexta69/metube/issues/150#issuecomment-1157098468

I think that's good enough for me as well. Can you elaborate a bit how do you do it please?

PikuZheng commented 11 months ago

I think that's good enough for me as well. Can you elaborate a bit how do you do it please?

set docker env "URL_PREFIX" to something https://github.com/alexta69/metube#configuration-via-environment-variables

If you need to return 404 when opening the root path (instead of jumping to URL_PREFIX), delete lines 162 to 164 https://github.com/alexta69/metube/blob/8950665f0662d51ef092fc450b3b34ac50316bbf/app/main.py#L162

alexta69 commented 9 months ago

You can use Authelia to implement this, as mentioned in the README.