Forum

Ask, reply and learn. Join the community of Akaunting.

New Discussion

FYI fix for mixed content problem

Marco Dings   ( User )

Commented 5 years ago

I have setup akauntin in docker countainer using nginx proxy that adds letsencrypt and servers the site using https.


Wich recents browers becomming more and more "defensive" they object against .css, js resources being loaded through http ( and not https )

regardless of the setting of APP_URL in the .env
APP_URL=https://asdfadsf
the application renders recources with http://


the culprit seems to be the usage of 
    asset('
where
  secure_asset('

seems to be the better choice

After searching for quite some time i found a solution in modifying
  ./app/Providers/AppServiceProvider.php

modify the boot() by adding
   \URL::forceScheme('https');


for me that results in 


    public function boot()


    {


        // Laravel db fix


        Schema::defaultStringLength(191);


        \URL::forceScheme('https');


    }



Its a "harcoded" one-line hack that is obviously ONLY going to work when https is enabled. It however makes akaunting usable again untli a proper solution is implemented

Marco

Mohrengemuse   ( User )

Commented 4 years ago

Thanks for your help, but why isn´t there an easier way to set this up?

Please login or register to leave a response.

Showing 1 to 2 of 2 discussions