snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
10.92k stars 3.15k forks source link

Fields not populating after using Cloudflare Tunnel #14863

Closed ricardokalloo closed 1 week ago

ricardokalloo commented 3 months ago

Debug mode

Describe the bug

After creating a subdomain to point to my Snipe servers IP to access it outside of our network there are some fields that are not being populated when attempting to create assets or assets models and even to add companies to users. URL is resolving to the appropriate domain and I am able to login and create users, companies etc, however when I attempt to create asset models in the drop down fields under category it just shows the loading wheel as well as if I attempt to add a company to said asset I would like to create.

Note that to get it to initial even work with the URL I had to change the APP_URL to my subdomain first before I was able to access it via the said subdomain. asset model asset company

Reproduction steps

  1. Did another fresh install under non sudo user
  2. Attempted to create an alias to do the redirects
  3. Attempted to force https viz the htaccess file (subsequently broke it completely)
  4. Changed APP_TRUSTED_PROXIES value to 'REMOTE_ADDR"

Expected behavior

Was hoping to be able to access my app via a web browser outside of my network using a subdomain and be able to use the app to its full functionality.

Screenshots

No response

Snipe-IT Version

6.4.2

Operating System

Ubuntu Server 20.04

Web Server

Apache

PHP Version

7.4.3

Operating System

Windows 11

Browser

Chrome

Version

No response

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

This is a fresh install and I used the install.sh method. No data was edited in the database.

welcome[bot] commented 3 months ago

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

snipe commented 3 months ago

What's in your browser console?

knychtell commented 1 week ago

Hi @snipe

I have the same problem after integrating snipeit with Cloudflare.

All fields are not updated, cant see what's happening when I click import and selected the file. Even though it says I have 6 users, it does not show any or even if I added a new one.

Version v6.4.2 - build 13487 (master) Hosted on Ubuntu 22.0.4 Composer version 2.7.6 2024-05-04 23:03:15 PHP 8.1.2-1ubuntu2.18 (cli)

When its not in Cloudflare and just within the intranet (192.168.x.x) all seems to be fine. Not until, when it's passing through cloudflare.

Thanks, Knychtell

snipe commented 1 week ago

Other users have reported that making sure the APP_URL is set to use https:// instead of http:// and also setting APP_FORCE_TLS=true in your .env works with Cloudflare tunneling. You may also need to run php artisan config:clear to have your .env changes picked up.