snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

v5.0.0 on Docker: hostname without protocol in resources

Open ghost opened this issue 6 years ago • 5 comments

Please confirm you have done the following before posting your bug report:

Describe the bug In v5.0.0 Docker image in a Rancher2 envirnment with tls-terminating nginx ingress some resources like js and css have the hostname without https://, so they won't load.

APP_URL and TRESTED_PROXIES variable are correctly set, v 4.9.x was working right before the upgrade

Screenshots If applicable, add screenshots to help explain your problem. image

Server (please complete the following information):

  • Snipe-IT Version: v5.0.0
  • ENV: Official Docker COntainer

ghost avatar Oct 20 '20 13:10 ghost

Update: the problem semmes to be that APP_TRUSTED_PROXIES is ignored, because editing config/trustedproxy.php by hand correct the problem.

Anyway in a docker environment this is not the right solution.

ghost avatar Oct 20 '20 15:10 ghost

Yes, editing /var/www/html/config/trustedproxy.php and uncommenting 'proxies' => '*', will temporarily fix the issue but as @Cobra1978 said this issue should be generally fixed.

mahdi avatar Oct 20 '20 16:10 mahdi

Hey! Same for me.

copying APP_TRUSTED_PROXIES from ENV to settings has been removed at commit 533649f24e011732c66b11bbfb872216b7b0862c

Diff: https://github.com/snipe/snipe-it/commit/533649f24e011732c66b11bbfb872216b7b0862c#diff-65b9650370ce063c0ae4c2d172d40fb6aafd2d2e8fe478dae7da21732d4d36dd

removed code:

    'proxies' => env('APP_TRUSTED_PROXIES') !== null ?
        explode(',', env('APP_TRUSTED_PROXIES')) : '*',

Especially for Docker environments we need this ENV settingg

Kind Regards Folke

fashberg avatar Oct 20 '20 22:10 fashberg

Yes, can also confirm. Running Snipe-IT through our Snipe-IT Helm Chart behind the nginx ingress controller results in css and js loading issues. Uncommenting the line in trustedproxy.php stated above, works fine.

mschmidt291 avatar Oct 21 '20 06:10 mschmidt291

This doesn't help me. Editing /var/www/html/config/trustedproxy.php and uncommenting 'proxies' => '*', doesn't fix my problem. It is still here. Any Idea?

Sylencer91 avatar Oct 21 '20 11:10 Sylencer91