Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PWA is not available when HTTP Auth is enabled #221

Closed
lexbritvin opened this issue Feb 17, 2023 · 8 comments
Closed

PWA is not available when HTTP Auth is enabled #221

lexbritvin opened this issue Feb 17, 2023 · 8 comments

Comments

@lexbritvin
Copy link

My server is configured to use HTTP Auth as described here https://github.com/YouROK/TorrServer#authorization
I tried to add PWA on iOS to use VLC link, but there is no Mobile App configuration view. I can't use VLC in PWA.

Steps to reproduce:
0. Use iOS

  1. Configure HTTP Auth - https://github.com/YouROK/TorrServer#authorization
  2. Open Safari and go to TS web UI
  3. Add to Home (install PWA)
  4. Open the app on Home

Expected result:
HTTP Auth is requested, PWA view is loaded, Mobile config page is available.

Actual result:
HTTP Auth is requested, PWA is not available, standard view is shown, Mobile config page is not available

I noticed: if I disable HTTP Auth, add PWA according to the steps, enable HTTP Auth again, all works as expected.
I suppose the issue may appear because PWA manifest is not available to Safari because of HTTP Auth header.

@tsynik
Copy link
Collaborator

tsynik commented Feb 21, 2023

I suppose the issue may appear because PWA manifest is not available to Safari because of HTTP Auth header.

Added site.webmanifest to always accessible path, and can't reproduce on Android PWA app added from Chrome with HTTP auth enabled. So probably it's Safari issue and can't be fixed on TorrServer side.

@lexbritvin
Copy link
Author

I found 2 similar issues:
koajs/basic-auth#19
https://thatemil.com/blog/2018/02/21/pwa-basic-auth/

Maybe we need to implement the same?

@apnagaev
Copy link

apnagaev commented Mar 13, 2023

Hi, I use v120 and can't use auth. I use docker with config:

docker run -d --name=torrserver \
            --restart=unless-stopped \
            -e TS_HTTPAUTH=1 \
            -v /docker/torrserver/db:/torrserver/db \
            -v /docker/torrserver/ts:/opt/ts \
            -v /etc/localtime:/etc/localtime:ro \
            -p 8090:8090 solopasha/torrserver

and file accs.db

{
"ust":"Pass1"
}

I tried put accs.db in /ts, /db, /ts/config, /db/config. What I do wrong? Torrserver does't ask autentification

@lexbritvin
Copy link
Author

Hi @apnagaev

It's thread related to PWA, not issues with HTTP Auth.
Please, use search (#191) or create a new support issue. Don't post in other issues.

Besides, you are using image solopasha/torrserver, some other maintainer's project with a latest version, the version is not explicitly set. We can't confirm that you actually use v120.
We also can't support other repos here, you must send a support request in the original repo. It has a different Dockerfile.

Please, better use a docker image from current repository with an exact version, which is ghcr.io/yourok/torrserver:matrix.120

Answering your question, I can confirm TS_HTTPAUTH=1 works as expected in docker.

Here is an example of docker-compose.yml that I use.

version: "3.9"
services:
  torrserver:
    image: ghcr.io/yourok/torrserver:matrix.120
    container_name: torrserver
    network_mode: host
    restart: unless-stopped
    volumes:
      - ./ts:/opt/ts
      - /etc/localtime:/etc/localtime:ro
    environment:
      TS_LOG_PATH: "/dev/null"
      TS_HTTPAUTH: "1"

You must ensure that you have the file /opt/ts/config/accs.db inside a container when you bind host FS inside a container.
In my case, it's ./ts/config/accs.db on host.
For you, according to your configuration, you have to put file in /docker/torrserver/ts/config/accs.db.

Besides, you bind -v /docker/torrserver/db:/torrserver/db. It won't be used by the original container.
The application works only inside /opt/ts.
Please, refer to the original documentation and docker image.

@apnagaev
Copy link

Sorry, youre are right, when I change image to ghcr.io/yourok/torrserver:matrix.120 torrserver started working

@tsynik
Copy link
Collaborator

tsynik commented Mar 25, 2023

probably fixed in MatriX.121 release

@tsynik
Copy link
Collaborator

tsynik commented Mar 26, 2023

Reopen if issue is still active

@tsynik tsynik closed this as completed Mar 26, 2023
@lexbritvin
Copy link
Author

Still not fixed for me

@tsynik tsynik mentioned this issue Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants