Bubka / 2FAuth

A Web app to manage your Two-Factor Authentication (2FA) accounts and generate their security codes
https://docs.2fauth.app/
GNU Affero General Public License v3.0
2.28k stars 152 forks source link

Setting ASSET_URL is needed since 5.x but not documented #275

Closed pinae closed 10 months ago

pinae commented 10 months ago

Version

5.0.2

Details & Steps to reproduce

2FAuth was updated to Version 5 on my Server running docker-compose. After the Update the page stayed blank because the Javascript and CSS files did not load anymore. The issue was that the requested URLs started with http:// instead of https://. I was able to fix this by setting ASSET_URL as a environment variable in my compose file to the same value as APP_URL but with a trailing /.

This easy fix was hard to find because ASSET_URL is not mentioned in the documentation. I do not fully understand what implications it has to set this so I am unable to write the documentation for that myself. But I hope that this report helps to pin down what went wrong in my case and add two or three sentences to the documentation.

Expectation

Add documentation for the environment variable ASSET_URL.

Error & Logs

No response

Execution environment

No response

Containerization

Additional information

No response

Bubka commented 10 months ago

Hi, Sorry for that, this is an issue caused by the new js compiler which I did not identity before the release of v5. Since then, I have released 2 minor versions to provide some fixes so I haven't had the time to update the documentation.

However, I'm surprised you face the problem even with v5.0.2. Does your APP_URL value start with https ?

Please try this:

darkknight7777777 commented 10 months ago

I just ran into this issue today. I tried the above php artisan commands and it still displays a blank page when loading the external URL. Once I uncomment ASSET_URL variable and restart it loads the login page per usual.

harrhunt commented 10 months ago

I also ran into this today with a fresh install of F2Auth via docker compose. I had the APP_URL set with https from the very beginning and was met with the same blank page (blocked loading mixed active content). Setting ASSET_URL solved the issue for me as well.

Bubka commented 10 months ago

@harrhunt Is 2FAuth behind a proxy in your setup? Did you run the artisan commands and check if that fixes the blank page before enabling ASSET_URL?

harrhunt commented 10 months ago

@Bubka I am behind an nginx reverse proxy. I didn't even think to run the commands since I just did a fresh install and assumed there wouldn't be anything cached. Apologies, I should have run them just to double check.

Michaelwucoc commented 6 months ago

256 is the same /lol/