glpi-project / glpi-agent

GLPI Agent
GNU General Public License v2.0
212 stars 51 forks source link

About the server URL to use as server parameter, it will depends on your server and plugins installation #665

Closed AlexTR85 closed 1 month ago

AlexTR85 commented 1 month ago

Bug reporting acknowledgment

Yes, I read it

Professional support

I'm a GLPI partner

Describe the bug

In the documentation: "https://glpi-agent.readthedocs.io/en/latest/configuration.html" It states the following:


If you're using GLPI 10+, there are few cases regarding GlpiInventory plugin usage:

If you're not using GlpiInventory plugin:

Your server URL should look like: https://my-glpi-server/, or https://my-glpi-server/front/inventory.php

Using https://my-glpi-server/ may cause issues fixed in GLPI 10.0.6. If you use an older version, it may be better to use the full URL for now.

If you have installed GlpiInventory plugin via Marketplace:

Your server URL should look like: https://my-glpi-server/marketplace/glpiinventory/

If you have installed GlpiInventory plugin manually under /plugins GLPI folder:

Your server URL should look like: https://my-glpi-server/plugins/glpiinventory/


However, "https://my-glpi-server/" continues to function even when using the inventory plugin, so it's pointless to set up a separate agent proxy and close it off from the internet if you want to avoid exposing the GLPI inventory to the internet when only conducting local inventory. (At the firewall level, you can prevent access to "https://my-glpi-server/marketplace/glpiinventory/" from the internet while maintaining local access, but you can't do that with "https://my-glpi-server/".)

The URL "https://my-glpi-server/front/inventory.php" returns an error, but you can still send inventory to "https://my-glpi-server/" without any issues.

With the plugin activated, "https://my-glpi-server/" should not receive inventories; they should only be sent to "https://my-glpi-server/marketplace/glpiinventory/" or "https://my-glpi-server/plugins/glpiinventory/".

To reproduce

With the plugin installed, configuring an agent with the URL: "https://my-glpi-server/" and sending an inventory, GLPI collects it

Expected behavior

The expected behavior would be that with the plugin activated, only inventory reception through the plugin's URLs would function.

"https://my-glpi-server/marketplace/glpiinventory/" or "https://my-glpi-server/plugins/glpiinventory/".

Operating system

Linux

GLPI Agent version

1.7.3

GLPI version

10.0.x (See additional context below)

GLPIInventory plugin or other plugin version

GLPI Inventory v1.3.4

Additional context

No response

g-bougard commented 1 month ago

Hi @AlexTR85

you're speaking about glpi-agent documentation, but the expected behavior seems to be related to glpi-inventory plugin comportment.

The server url can always be used to send inventory and indeed glpi-inventory plugin index just loads glpi index page when you submit an inventory.

You really only require to set url to include /marketplace/glpiinventory when you really have to setup tasks.

To be honest, I think your issue is just a http server configuration issue.

Anyway, I'm closing this issue here. Feel free to open an issue on glpi-inventory project to have an answer from the really concerned GLPI team.