dutchcoders / transfer.sh

Easy and fast file sharing from the command-line.
https://github.com/dutchcoders/transfer.sh
MIT License
15.31k stars 1.54k forks source link

IP_FILTERLIST_BYPASS_HTTP_AUTH not working ? #590

Closed michaelscl closed 11 months ago

michaelscl commented 11 months ago

Hi,

Does this feature work well?

With the following configuration, a login window pops up when I try upload file:

sudo -E docker run --name transfersh -h transfersh -it --restart unless-stopped \
  -p 8880:8880 \
  -v /etc/timezone:/etc/timezone:ro \
  -v /etc/localtime:/etc/localtime:ro \
  -v ${PWD}/transfersh-basedir:/basedir \
  -v ${PWD}/transfersh-temp:/temp \
  dutchcoders/transfer.sh \
  --provider local \
  --basedir /basedir \
  --temp-path /temp \
  --listener :8880 \
  --purge-days 7 \
  --purge-interval 24 \
  --http-auth-user user --http-auth-pass user 

It is OK.

But if I use the following configuration, the login window should pop up too, but it doesn't. The file console.log uploads normally. But my IP address is different from the whitelist.

sudo -E docker run --name transfersh -h transfersh -it --restart unless-stopped \
  -p 8880:8880 \
  -v /etc/timezone:/etc/timezone:ro \
  -v /etc/localtime:/etc/localtime:ro \
  -v ${PWD}/transfersh-basedir:/basedir \
  -v ${PWD}/transfersh-temp:/temp \
  dutchcoders/transfer.sh \
  --provider local \
  --basedir /basedir \
  --temp-path /temp \
  --listener :8880 \
  --purge-days 7 \
  --purge-interval 24 \
  --http-auth-user user --http-auth-pass user \
  --http-auth-ip-whitelist 1.2.3.4
[transfer.sh]2023/12/03 12:14:54 82.202.xx.xx:0 - - [2023-12-03T12:14:54+01:00] "PUT /console.log HTTP/1.0" 200  "https://transfersh.xxxxx.cz/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0"

Am I doing something wrong or is it a bug?

best regards

Michaels

aspacca commented 11 months ago

Am I doing something wrong or is it a bug?

what version of the docker image are you using? a bug disabling http auth was fixed in 1.6.0, it affected version from 1.5.0 and onwards

also if you use the same browser window to test both configuration, http basic auth header might be cached, and that's the reason why the second time the auth dialog does not pop up

michaelscl commented 11 months ago

what version of the docker image are you using? a bug disabling http auth was fixed in 1.6.0, it affected version from 1.5.0 and onwards

Docker version 24.0.7, build afdd53b dutchcoders/transfer.sh:latest https://hub.docker.com/layers/dutchcoders/transfer.sh/latest/images/sha256-89bc158fe04597ff2f0c53fc5302f89633806ffdc243bf45441c0429e47a7fa3?context=explore

also if you use the same browser window to test both configuration, http basic auth header might be cached, and that's the reason why the second time the auth dialog does not pop up

I used a blank Brave. Newly opened. image

The file was uploaded without name and password authentication.

m.

aspacca commented 11 months ago

@michaelscl thanks for the report: bug fixed with https://github.com/dutchcoders/transfer.sh/commit/95c7e675a08e973a04aa77b23a494bd77105523e

michaelscl commented 11 months ago

Great! It works now! Thank you!