feat(inventory): Enable inventory endpoint with env variable

by using an env variable the inventory endpoint can be enabled.

!3 #4
This commit is contained in:
2023-08-29 03:02:12 +09:30
parent 3439d1e361
commit 83b4e98a18

View File

@ -2,24 +2,43 @@
DocumentRoot /var/www/html/public
<Directory /var/www/html/public>
Require all granted
RewriteEngine On
# Paths:
# Reference: https://glpi-agent.readthedocs.io/en/latest/configuration.html
# - fusioninventory: /plugins/fusioninventory/
# - Native (non-GlpiInventory plugin): /front/inventory.php
# - GlpiInventory plugin (Marketplace installed): /marketplace/glpiinventory/
# - GlpiInventory plugin (plugin folder installed): /plugins/glpiinventory/
# NOTE: for glpi inventory index.php must be prepended to path so that GUI can still be accessed.
# Don't provide access to inventory on these paths
# ToDo: add inventory path for /plugins/fusioninventory/
RewriteCond %{REQUEST_URI} ^/front/inventory.php$ [OR]
RewriteCond %{REQUEST_URI} /plugins/glpiinventory
RewriteCond %{REQUEST_URI} !/plugins/glpiinventory/front/ [OR]
RewriteCond %{REQUEST_URI} /marketplace/glpiinventory
RewriteCond %{REQUEST_URI} !/marketplace/glpiinventory/front/
RewriteCond %{ENV:GLPI_INVENTORY_PATH} !/front/inventory.php
RewriteCond %{REQUEST_URI} ^/front/inventory.php$
RewriteRule ^(.*)$ - [R=404,NC]
RewriteCond %{ENV:GLPI_INVENTORY_PATH} !/plugins/glpiinventory/
RewriteCond %{REQUEST_URI} /plugins/glpiinventory
RewriteCond %{REQUEST_URI} !/plugins/glpiinventory/front/
RewriteRule ^(.*)$ - [R=404,NC]
RewriteCond %{ENV:GLPI_INVENTORY_PATH} !/marketplace/glpiinventory/
RewriteCond %{REQUEST_URI} /marketplace/glpiinventory
RewriteCond %{REQUEST_URI} !/marketplace/glpiinventory/front/
RewriteRule ^(.*)$ - [R=404,NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</Directory>
ErrorLog /var/log/apache2/error-glpi.log
LogLevel warn
CustomLog /var/log/apache2/access-glpi.log combined
</VirtualHost>