feat(inventory): Authenticated access

!3 #4
This commit is contained in:
2023-08-29 17:14:23 +09:30
parent 23886773af
commit 04999a8b57
2 changed files with 22 additions and 1 deletions

View File

@ -88,7 +88,10 @@ COPY --from=prepare /tmp/glpi /var/www/html
RUN chown www-data:www-data -R /var/www; \
ln -s /var/www/html/bin/console /bin/console;
ln -s /var/www/html/bin/console /bin/console; \
touch /apache-passwd-glpi-inventory; \
chown www-data:www-data /apache-passwd-glpi-inventory; \
chmod 740 /apache-passwd-glpi-inventory;
VOLUME /var/www/html/config

View File

@ -1,6 +1,24 @@
<VirtualHost *:80>
DocumentRoot /var/www/html/public
<Location "/plugins/glpiinventory/index.php">
<If "%{ENV:GLPI_INVENTORY_PATH} != ''">
<If "%{ENV:GLPI_INVENTORY_AUTH} == ''">
AuthType Basic
AuthName "Restricted Access"
AuthUserFile /apache-passwd-glpi-inventory
Require valid-user
</If>
</If>
</Location>
<Directory /var/www/html/public>
Require all granted