tiredofit / docker-invoiceninja

Dockerized invoicing web application
MIT License
14 stars 3 forks source link

ARM64 - Force redirecting to HTTPS and failing to load #6

Closed armond-avanes closed 11 months ago

armond-avanes commented 11 months ago

Hello,

I'm trying to install this image on ARM64 (Raspberry Pi 4B) in a local environment without SSL/proxy (ENABLE_SSL_PROXY="FALSE" and APP_ENV="local"). The installation/initialization goes pretty well and I see the following line in the logs:

[invoiceninja] Initialization Complete. Please visit http://[IP_ADDRESS]:[PORT] and login with your credentials..

But when I try to access the app, it force-redirects me to HTTPS (httpS://[IP_ADDRESS]:[PORT]) where I get a blank page on the browser with "ERR_SSL_PROTOCOL_ERROR" error code. I don't see anything related to this in the container logs.

Looks like ENABLE_SSL_PROXY=FALSE is somehow disregarded. Is there any way to turn off this redirection and stay on HTTP ?

Thank you.

UPDATE: I tried to access that URL/port on Postman and I could see the following error line as response (just in case it can be helpful):

Error: write EPROTO 5284923608:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:../../../../src/third_party/boringssl/src/ssl/tls_record.cc:242:

tiredofit commented 11 months ago

Hm. I've never run this locally and always behind a terminating SSL proxy. https://github.com/tiredofit/docker-nginx is the image that is serving this - there are some settings in there that may help to turn off specifically stuff here https://github.com/tiredofit/docker-nginx#reverse-proxy-options .

armond-avanes commented 11 months ago

Does this mean that I can utilize any of those "NGINX_*" environment variables when I want to launch "tiredofit/invoiceninja" image?

Just as a quick start, I set NGINX_ENABLE_REVERSE_PROXY=FALSE but it didn't work.

tiredofit commented 11 months ago

Thats correct - https://github.com/tiredofit/docker-invoiceninja#base-images-used shows all the other environment variables you have access to, things are quite powerful. You might want to try the fastcgi one as that is directly related to PHP which this codebase is..

armond-avanes commented 11 months ago

I think I've found the root cause.

According to the documentation, it's ENABLE_SSL_PROXY environment variable which turns the SSL on/off. But in install/assets/defaults/30-invoiceninja file, REQUIRE_HTTPS is the variable which is being queried (with a default value of TRUE).

When I set REQUIRE_HTTPS to FALSE, it stopped force-redirecting me to HTTPS.

If you also agree that this is the root cause, you might want to either update the documentation or update the above mentioned file so that they can both be in sync.

tiredofit commented 11 months ago

I am boolean on this. I think every problem can be solved. If its working if you create a PR on the readme I will accept it to help other local hosters.

armond-avanes commented 11 months ago

Sure. Here is the PR: https://github.com/tiredofit/docker-invoiceninja/pull/7

tiredofit commented 11 months ago

Excellent! Thanks for the contribution and am certain this can help others. I have a sneaking suspicion this should work for the other laravel PHP images I have put together if you are interested in other local hosting applications. (freescout, bookstack)