From a2bbcf2d69074487670a37156a2e0ee45fffb69b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Panasiewicz?= Date: Thu, 22 Jun 2023 21:50:47 +0200 Subject: [PATCH 01/17] Add windows batch for install glpi with mariadb --- ...stall_upgrade_glpi_with_mariadb_docker.cmd | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 install scripts/install_upgrade_glpi_with_mariadb_docker.cmd diff --git a/install scripts/install_upgrade_glpi_with_mariadb_docker.cmd b/install scripts/install_upgrade_glpi_with_mariadb_docker.cmd new file mode 100644 index 0000000..6f0fb6b --- /dev/null +++ b/install scripts/install_upgrade_glpi_with_mariadb_docker.cmd @@ -0,0 +1,93 @@ +@ECHO OFF +REM GLPI Install Environment +REM names containers +SET GLPI_container=GLPI +SET DB_Container=MariaDB +REM GLPI Docker repository and dockerhub tags +SET docker_repository=wolvverine/docker-glpi +SET docker_tag=nginx-74-10.0.6-3.6 + +REM aktualne tagi dla kontenera GLPI +REM www_server-php_version-glpi_version-container_version +REM nginx-82-10.0.6-3.6 +REM nginx-74-10.0.6-3.6 +REM nginx-82-xdebug-10.0.6-3.6 +REM nginx-74-xdebug-10.0.6-3.6 +REM https://hub.docker.com/r/wolvverine/docker-glpi/tags + +REM Database Docker repository and dockerhub tags +SET docker_DB_repository=mariadb +SET docker_DB_tag=latest + +REM Password and user for DB +SET password=your_db_password + +REM External ports for containers +SET GLPI_port=6080 +SET DB_port=6303 + + +REM #################################################################### + +ECHO Volumes for container %GLPI_container% +docker volume create %GLPI_container%-data +docker volume create %GLPI_container%-config +docker volume create %GLPI_container%-plugins +docker volume create %GLPI_container%-marketplace + +ECHO Dedicated internal network for containers: %GLPI_container% and %DB_Container% +docker network create %GLPI_container%-network + +ECHO Remove old container %GLPI_container% and pull new image +docker stop %GLPI_container% +docker rm %GLPI_container% && ^ +docker pull %docker_repository%:%docker_tag% + +ECHO Running %GLPI_container% container +docker run --restart unless-stopped --name %GLPI_container% ^ + --publish %GLPI_port%:80 ^ + --volume %GLPI_container%-files:/var/www/files ^ + --volume "%GLPI_container%"-config:/var/www/config ^ + --volume "%GLPI_container%"-plugins:/var/www/plugins ^ + --volume "%GLPI_container%"-marketplace:/var/www/marketplace ^ + --net "%GLPI_container%"-network ^ + -e GLPI_CHMOD_PATHS_FILES=yes ^ + -e GLPI_REMOVE_INSTALLER=no ^ + -e GLPI_ENABLE_CRONJOB=yes ^ + -e TZ="Europe/Warsaw" ^ + -e GLPI_INSTALL_PLUGINS="fusioninventory|https://github.com/fusioninventory/fusioninventory-for-glpi/releases/download/glpi10.0.6+1.1/fusioninventory-10.0.6+1.1.tar.bz2,fields|https://github.com/pluginsGLPI/fields/releases/download/1.20.6/glpi-fields-1.20.6.tar.bz2,datainjection|https://github.com/pluginsGLPI/datainjection/releases/download/2.13.1/glpi-datainjection-2.13.1.tar.bz2,genericobject|https://github.com/pluginsGLPI/genericobject/releases/download/2.14.3/glpi-genericobject-2.14.3.tar.bz2" ^ + -d %docker_repository%:%docker_tag% + +REM #################################################################### +ECHO MARIADB + +ECHO Volume for %DB_Container% container +docker volume create %DB_Container%-%GLPI_container%-data + +ECHO Remove old %DB_Container% container and pull new image +docker stop %DB_Container% +docker rm %DB_Container% && ^ +docker pull %docker_DB_repository%:%docker_DB_tag% + +ECHO Running %DB_Container% container +docker run --restart always --name %DB_Container% --net %GLPI_container%-network ^ + -p %DB_port%:3306 ^ + --volume %DB_Container%-%GLPI_container%-data:/var/lib/mysql ^ + -e MYSQL_ROOT_PASSWORD=%password% ^ + -d %docker_DB_repository%:%docker_DB_tag% + +ECHO Commands in %DB_Container% container - wait +REM TODO wait for full start container server +timeout 60 > NUL +ECHO Check databases +docker exec -it %DB_Container% mariadb-check --all-databases --check-upgrade --auto-repair -u root --password=%password% +ECHO Upgrade databases +docker exec -it %DB_Container% mariadb-upgrade -u root --password=%password% +ECHO Timezone +docker exec -it %DB_Container% sh -c "export TZ='Europe/Warsaw'" +docker exec -it %DB_Container% sh -c "rm /etc/localtime" +docker exec -it %DB_Container% sh -c "ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone" +timeout 5 > NUL +start "" http://localhost:%GLPI_port% +start "" \\wsl$\docker-desktop-data\data\docker\volumes +PAUSE \ No newline at end of file From 1ec2111807f0d0db52f2bc9d52c20ad2af1421a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Panasiewicz?= Date: Thu, 22 Jun 2023 21:54:50 +0200 Subject: [PATCH 02/17] Remove unused volume --- install scripts/install_upgrade_glpi_with_mariadb_docker.cmd | 1 - 1 file changed, 1 deletion(-) diff --git a/install scripts/install_upgrade_glpi_with_mariadb_docker.cmd b/install scripts/install_upgrade_glpi_with_mariadb_docker.cmd index 6f0fb6b..5357c54 100644 --- a/install scripts/install_upgrade_glpi_with_mariadb_docker.cmd +++ b/install scripts/install_upgrade_glpi_with_mariadb_docker.cmd @@ -30,7 +30,6 @@ SET DB_port=6303 REM #################################################################### ECHO Volumes for container %GLPI_container% -docker volume create %GLPI_container%-data docker volume create %GLPI_container%-config docker volume create %GLPI_container%-plugins docker volume create %GLPI_container%-marketplace From 8193acbb5fd798c7e8f62235f9e8f950c5251277 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Panasiewicz?= Date: Thu, 22 Jun 2023 21:57:11 +0200 Subject: [PATCH 03/17] DB password in variable --- install scripts/install_upgrade_mariadb_docker.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/install scripts/install_upgrade_mariadb_docker.sh b/install scripts/install_upgrade_mariadb_docker.sh index 00a4b6f..f8ed277 100644 --- a/install scripts/install_upgrade_mariadb_docker.sh +++ b/install scripts/install_upgrade_mariadb_docker.sh @@ -7,6 +7,7 @@ imagename="mariadb" imagetag="latest" restartpolicy="unless-stopped" glpicontainername="glpi" +dbpassword="your_db_root_password" #first time docker volume create "$containername"-"$glpicontainername"-data @@ -23,11 +24,11 @@ docker run --detach --restart $restartpolicy --name "$containername" \ -p 3306:3306 \ --volume "$containername"-"$glpicontainername"-data:/var/lib/mysql:Z \ --volume "$containername"-"$glpicontainername"-config:/etc/mysql:Z \ - -e MYSQL_ROOT_PASSWORD='xxxxxxxxxxxxxx' \ + -e MYSQL_ROOT_PASSWORD="$dbpassword" \ $imagename:$imagetag -docker exec -it $containername mysqlcheck -u root -p --all-databases --check-upgrade --auto-repair -docker exec -it $containername mysql_upgrade -u root -p +docker exec -it $containername mariadb-check --all-databases --check-upgrade --auto-repair -u root --password="$dbpassword" +docker exec -it $containername mariadb-upgrade -u root --password="$dbpassword" docker exec -it $containername /bin/sh -c "export TZ='Europe/Warsaw'" docker exec -it $containername /bin/sh -c "rm /etc/localtime" docker exec -it $containername /bin/sh -c "ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone" From 1da6eb9486f037ad30f2b2dc8e409ffa9768ec91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Panasiewicz?= Date: Tue, 12 Sep 2023 12:02:09 +0200 Subject: [PATCH 04/17] extend install scripts --- install scripts/install_upgrade_glpi_with_mariadb_docker.cmd | 3 ++- install scripts/install_upgrade_mariadb_docker.sh | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/install scripts/install_upgrade_glpi_with_mariadb_docker.cmd b/install scripts/install_upgrade_glpi_with_mariadb_docker.cmd index 5357c54..b9e8a3c 100644 --- a/install scripts/install_upgrade_glpi_with_mariadb_docker.cmd +++ b/install scripts/install_upgrade_glpi_with_mariadb_docker.cmd @@ -53,8 +53,9 @@ docker run --restart unless-stopped --name %GLPI_container% ^ -e GLPI_CHMOD_PATHS_FILES=yes ^ -e GLPI_REMOVE_INSTALLER=no ^ -e GLPI_ENABLE_CRONJOB=yes ^ + -e PHP_MEMORY_LIMIT=128M ^ -e TZ="Europe/Warsaw" ^ - -e GLPI_INSTALL_PLUGINS="fusioninventory|https://github.com/fusioninventory/fusioninventory-for-glpi/releases/download/glpi10.0.6+1.1/fusioninventory-10.0.6+1.1.tar.bz2,fields|https://github.com/pluginsGLPI/fields/releases/download/1.20.6/glpi-fields-1.20.6.tar.bz2,datainjection|https://github.com/pluginsGLPI/datainjection/releases/download/2.13.1/glpi-datainjection-2.13.1.tar.bz2,genericobject|https://github.com/pluginsGLPI/genericobject/releases/download/2.14.3/glpi-genericobject-2.14.3.tar.bz2" ^ + -e GLPI_INSTALL_PLUGINS="fusioninventory|https://github.com/fusioninventory/fusioninventory-for-glpi/releases/download/glpi10.0.6+1.1/fusioninventory-10.0.6+1.1.tar.bz2,fields|https://github.com/pluginsGLPI/fields/releases/download/1.20.6/glpi-fields-1.20.6.tar.bz2,datainjection|https://github.com/pluginsGLPI/datainjection/releases/download/2.13.2/glpi-datainjection-2.13.2.tar.bz2,genericobject|https://github.com/pluginsGLPI/genericobject/releases/download/2.14.3/glpi-genericobject-2.14.3.tar.bz2" ^ -d %docker_repository%:%docker_tag% REM #################################################################### diff --git a/install scripts/install_upgrade_mariadb_docker.sh b/install scripts/install_upgrade_mariadb_docker.sh index f8ed277..56c4bed 100644 --- a/install scripts/install_upgrade_mariadb_docker.sh +++ b/install scripts/install_upgrade_mariadb_docker.sh @@ -27,8 +27,10 @@ docker run --detach --restart $restartpolicy --name "$containername" \ -e MYSQL_ROOT_PASSWORD="$dbpassword" \ $imagename:$imagetag +echo "Wait for start container $containername ." +sleep 60 docker exec -it $containername mariadb-check --all-databases --check-upgrade --auto-repair -u root --password="$dbpassword" docker exec -it $containername mariadb-upgrade -u root --password="$dbpassword" docker exec -it $containername /bin/sh -c "export TZ='Europe/Warsaw'" docker exec -it $containername /bin/sh -c "rm /etc/localtime" -docker exec -it $containername /bin/sh -c "ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone" +docker exec -it $containername /bin/sh -c "ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone" \ No newline at end of file From d0aa4c28b0f9d58924fcbf74f1f819818de80e17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Panasiewicz?= Date: Tue, 12 Sep 2023 12:02:44 +0200 Subject: [PATCH 05/17] GLPI v.10.0.9 --- .github/workflows/github-actions-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-actions-build.yml b/.github/workflows/github-actions-build.yml index 2f4822d..605847d 100644 --- a/.github/workflows/github-actions-build.yml +++ b/.github/workflows/github-actions-build.yml @@ -6,8 +6,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - glpiversion: [10.0.6,10.0.7] - imagevariant: [nginx-74,nginx-82] + glpiversion: [10.0.9] + imagevariant: [nginx-82] phpxdebug: [yes,no] steps: - From b81267662a8c1b078df460a3d075d20f909d4926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Panasiewicz?= Date: Tue, 31 Oct 2023 11:28:41 +0100 Subject: [PATCH 06/17] GLPI v.10.0.10 --- .github/workflows/github-actions-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-build.yml b/.github/workflows/github-actions-build.yml index 605847d..4a4c9a1 100644 --- a/.github/workflows/github-actions-build.yml +++ b/.github/workflows/github-actions-build.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - glpiversion: [10.0.9] + glpiversion: [10.0.10] imagevariant: [nginx-82] phpxdebug: [yes,no] steps: From 8d993d27297c78f00b2e3274602fd012d15225f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Panasiewicz?= Date: Wed, 31 Jan 2024 15:18:49 +0100 Subject: [PATCH 07/17] GLPI v.10.0.11 --- .github/workflows/github-actions-build.yml | 2 +- .travis.yml | 4 ++-- Dockerfile_nginx-82 | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/github-actions-build.yml b/.github/workflows/github-actions-build.yml index 4a4c9a1..4fea492 100644 --- a/.github/workflows/github-actions-build.yml +++ b/.github/workflows/github-actions-build.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - glpiversion: [10.0.10] + glpiversion: [10.0.11] imagevariant: [nginx-82] phpxdebug: [yes,no] steps: diff --git a/.travis.yml b/.travis.yml index 07b1179..c6e7dea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,8 +15,8 @@ env: # READ!!! https://docs.travis-ci.com/user/encryption-keys/#note-on-escaping-certain-symbols matrix: # Provide a list of GLPI version to build - - GLPI_VERSION=10.0.5 IMAGE_VARIANT=nginx-74 UPDATE_README=1 UPDATE_LATEST=1 - - GLPI_VERSION=10.0.5 IMAGE_VARIANT=nginx-74 UPDATE_README=1 GLPI_PHP_XDEBUG=yes + - GLPI_VERSION=10.0.11 IMAGE_VARIANT=nginx-82 UPDATE_README=1 UPDATE_LATEST=1 + - GLPI_VERSION=10.0.11 IMAGE_VARIANT=nginx-82 UPDATE_README=1 GLPI_PHP_XDEBUG=yes before_install: - sudo apt update diff --git a/Dockerfile_nginx-82 b/Dockerfile_nginx-82 index 2c8b42e..0cedfbc 100644 --- a/Dockerfile_nginx-82 +++ b/Dockerfile_nginx-82 @@ -41,6 +41,10 @@ ENV PHPFPM_PM_MAX_SPARE_SERVERS 8 ENV PHPFPM_PM_PROCESS_IDLE_TIMEOUT 120s ENV PHPFPM_PM_MAX_REQUEST 2000 +ENV LANG en_US.UTF-8 +ENV LC_ALL en_US.UTF-8 + + # Install dependencies RUN set -ex; \ PHP_XDEBUG=$(echo "${PHP_XDEBUG}" | tr '[:upper:]' '[:lower:]') ; \ From 925c2f541d161f07f28b2eecc3db4ca33392a2c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Panasiewicz?= Date: Thu, 1 Feb 2024 11:39:50 +0100 Subject: [PATCH 08/17] v3.7 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 3faf9b8..548d713 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.6 \ No newline at end of file +3.7 \ No newline at end of file From 46182559ee813917a0f8fd59cdee27e2ed939eaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Panasiewicz?= Date: Thu, 1 Feb 2024 13:41:38 +0100 Subject: [PATCH 09/17] fix error: externally-managed-environment --- Dockerfile_nginx-82 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile_nginx-82 b/Dockerfile_nginx-82 index 0cedfbc..20bb269 100644 --- a/Dockerfile_nginx-82 +++ b/Dockerfile_nginx-82 @@ -61,7 +61,7 @@ RUN set -ex; \ tar \ tzdata \ ; \ - pip3 install \ + pip3 install --break-system-packages \ j2cli \ jinja2-getenv-extension \ ; \ From de9017bdc47941b6e81f66a51053355a74066464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Panasiewicz?= Date: Thu, 1 Feb 2024 14:41:32 +0100 Subject: [PATCH 10/17] GLPI v.10.0.12 --- .github/workflows/github-actions-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-build.yml b/.github/workflows/github-actions-build.yml index 4fea492..4bba71b 100644 --- a/.github/workflows/github-actions-build.yml +++ b/.github/workflows/github-actions-build.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - glpiversion: [10.0.11] + glpiversion: [10.0.12] imagevariant: [nginx-82] phpxdebug: [yes,no] steps: From 4890899833e79cd23ff209083d02b8ed700ffaec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Panasiewicz?= Date: Tue, 26 Mar 2024 19:38:29 +0100 Subject: [PATCH 11/17] nginx.conf: add security options redirect from old fusioninventory to native inventory --- root/etc/nginx/nginx.conf | 44 +++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/root/etc/nginx/nginx.conf b/root/etc/nginx/nginx.conf index a2ea33a..78652b0 100644 --- a/root/etc/nginx/nginx.conf +++ b/root/etc/nginx/nginx.conf @@ -28,12 +28,12 @@ http { # Timeout for keep-alive connections. Server will close connections after # this time. keepalive_timeout 600; - proxy_connect_timeout 600; proxy_send_timeout 600; proxy_read_timeout 600; fastcgi_send_timeout 600; fastcgi_read_timeout 600; + add_header Strict-Transport-Security 'max-age = 604800'; # Sendfile copies data between one FD and other from within the kernel, # which is more efficient than read() + write(). @@ -49,10 +49,10 @@ http { # Enable gzipping of responses. #gzip on; - + # Set the Vary HTTP header as defined in the RFC 2616. gzip_vary on; - + # Enable checking the existence of precompressed files. #gzip_static on; @@ -60,7 +60,11 @@ http { ## HTTP configuration listen 80 default_server; listen [::]:80 default_server; - + + #TODO + # server_name glpi.local.glpi; + # return 301 https://$host$request_uri; # Redirect HTTP to HTTPS + ## NETWORK LIMITATIONS client_max_body_size 30M; client_body_buffer_size 128k; @@ -68,12 +72,20 @@ http { ## DIRECTORY root /var/www; index index.php; - + ## LOCATION location / { try_files $uri $uri/ =404; } - + + # Redirect all plugins/fusioninventory requests to /front/inventory.php + location ~ ^/plugins/fusioninventory/ { + if ($http_x_forwarded_proto ~ "^https?$") { + return 301 $http_x_forwarded_proto://$host/front/inventory.php; + } + return 301 $scheme://$host/front/inventory.php; + } + location = /api/ { if ($http_x_forwarded_proto ~ "^https?$") { return 301 $http_x_forwarded_proto://$host/apirest.php; @@ -99,33 +111,39 @@ http { fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors on; } - + + # Explicitly handle requests to *.php, ensuring fastcgi parameters are correctly passed location ~ [^/]\.php(/|$) { # regex to split $uri to $fastcgi_script_name and $fastcgi_path fastcgi_split_path_info ^(.+\.php)(/.+)$; - + # Check that the PHP script exists before passing it try_files $fastcgi_script_name =404; - + include fastcgi_params; - + # Bypass the fact that try_files resets $fastcgi_path_info # # see: http://trac.nginx.org/nginx/ticket/321 set $path_info $fastcgi_path_info; fastcgi_param PATH_INFO $path_info; - + fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SERVER_NAME $host; - + # allow directory index fastcgi_index index.php; fastcgi_pass unix:/var/run/php-fpm.sock; } - + # deny access to some ressources location ~ /(config|files)/ { deny all; } + + # Deny access to .htaccess and other hidden files + location ~ /\.ht { + deny all; + } } } \ No newline at end of file From 0c5aafa5b9136f58762ba9b2037387b092f49a31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Panasiewicz?= Date: Tue, 26 Mar 2024 20:28:24 +0100 Subject: [PATCH 12/17] GLPI v.10.0.14 --- .github/workflows/github-actions-build.yml | 2 +- .travis.yml | 4 +- README.md | 93 ++++++++++--------- .../install_upgrade_glpi_docker.sh | 2 +- ...stall_upgrade_glpi_with_mariadb_docker.cmd | 8 +- 5 files changed, 57 insertions(+), 52 deletions(-) diff --git a/.github/workflows/github-actions-build.yml b/.github/workflows/github-actions-build.yml index 4bba71b..52b06fc 100644 --- a/.github/workflows/github-actions-build.yml +++ b/.github/workflows/github-actions-build.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - glpiversion: [10.0.12] + glpiversion: [10.0.14] imagevariant: [nginx-82] phpxdebug: [yes,no] steps: diff --git a/.travis.yml b/.travis.yml index c6e7dea..ce97b6e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,8 +15,8 @@ env: # READ!!! https://docs.travis-ci.com/user/encryption-keys/#note-on-escaping-certain-symbols matrix: # Provide a list of GLPI version to build - - GLPI_VERSION=10.0.11 IMAGE_VARIANT=nginx-82 UPDATE_README=1 UPDATE_LATEST=1 - - GLPI_VERSION=10.0.11 IMAGE_VARIANT=nginx-82 UPDATE_README=1 GLPI_PHP_XDEBUG=yes + - GLPI_VERSION=10.0.14 IMAGE_VARIANT=nginx-82 UPDATE_README=1 UPDATE_LATEST=1 + - GLPI_VERSION=10.0.14 IMAGE_VARIANT=nginx-82 UPDATE_README=1 GLPI_PHP_XDEBUG=yes before_install: - sudo apt update diff --git a/README.md b/README.md index a075e8c..537994c 100644 --- a/README.md +++ b/README.md @@ -10,17 +10,14 @@ This images contains an instance of GLPI web application served by nginx and php ## Supported tags, image variants and respective Dockerfile links -* nginx and PHP7.4 embedded [Dockerfile](https://github.com/Wolvverine/docker-glpi/blob/master/Dockerfile_nginx-74) +* nginx and PHP8.2 embedded [Dockerfile](https://github.com/Wolvverine/docker-glpi/blob/master/Dockerfile_nginx-82) - * `nginx-74-9.5.9-3.5.1` - * `nginx-74-10.0.3-3.5.1` + * `nginx-82-10.0.14-3.7` * Development versions with and without Xdebug: - - * `nginx-74-9.5.9-3.5.1-develop` - * `nginx-74-10.0.3-3.5.1-develop` - * `nginx-74-xdebug-9.5.9-3.5.1-develop` - * `nginx-74-xdebug-10.0.3-3.5.1-develop` + + * `nginx-82-10.0.14-3.7-develop` + * `nginx-82-xdebug-10.0.14-3.7-develop` ## Docker Informations @@ -35,28 +32,31 @@ This images contains an instance of GLPI web application served by nginx and php * This image takes theses environnements variables as parameters -| Environment | Type | Usage | Default | -| ------------------------------ | ---------------- | ------------------------------------------------------------------------- | -------- | -| TZ | String | Contains the timezone | | -| GLPI_REMOVE_INSTALLER | Boolean (yes/no) | Set to yes if it's not the first installation of glpi | no | -| GLPI_CHMOD_PATHS_FILES | Boolean (yes/no) | Set to yes to apply chmod/chown on /var/www/files (useful for host mount) | no | -| GLPI_INSTALL_PLUGINS | String | Comma separated list of plugins to install (see below) | | -| PHP_MEMORY_LIMIT | String | see PHP memory_limit configuration | 64M | -| PHP_UPLOAD_MAX_FILESIZE | String | see PHP upload filesize configuration | 16M | -| PHP_MAX_EXECUTION_TIME | String | see PHP max execution time configuration | 3600 | -| PHP_POST_MAX_SIZE | String | see PHP post_max_size configuration | 20M | -| PHP_OPCACHE_MEM_CONSUMPTION | String | see PHP opcache_mem_consumption configuration | 256 | -| PHPFPM_PM | String | see PHPFPM pm configuration | dynamic | -| PHPFPM_PM_MAX_CHILDREN | Integer | see PHPFPM pm.max_children configuration | 30 | -| PHPFPM_PM_START_SERVERS | Integer | see PHPFPM pm.start_servers configuration | 4 | -| PHPFPM_PM_MIN_SPARE_SERVERS | Integer | see PHPFPM pm.min_spare_servers configuration | 4 | -| PHPFPM_PM_MAX_SPARE_SERVERS | Integer | see PHPFPM pm.max_spare_servers configuration | 8 | -| PHPFPM_PM_PROCESS_IDLE_TIMEOUT | Mixed | see PHPFPM pm.process_idle_timeout configuration | 120s | -| PHPFPM_PM_MAX_REQUEST | Integer | see PHPFPM pm.max_request configuration | 2000 | -| ------------------------------ | ---------------- | ------------------------------------------------------------------------- | -------- | -| PHPFPM_XDEBUG_CLIENT_PORT | Integer | Contains xdebug client host port | | -| PHPFPM_XDEBUG_CLIENT_HOST | String | Contains xdebug client host IP or DNS name | | -| ______________________________ | ________________ | _________________________________________________________________________ | ________ | +| Environment | Type | Usage | Default | +| ------------------------------ | ---------------- | ------------------------------------------------------------------------- | ----------- | +| TZ | String | Contains the timezone | | +| GLPI_REMOVE_INSTALLER | Boolean (yes/no) | Set to yes if it's not the first installation of glpi | no | +| GLPI_CHMOD_PATHS_FILES | Boolean (yes/no) | Set to yes to apply chmod/chown on /var/www/files (useful for host mount) | no | +| GLPI_INSTALL_PLUGINS | String | Comma separated list of plugins to install (see below) | | +| PHP_MEMORY_LIMIT | String | see PHP memory_limit configuration | 64M | +| PHP_UPLOAD_MAX_FILESIZE | String | see PHP upload filesize configuration | 16M | +| PHP_MAX_EXECUTION_TIME | String | see PHP max execution time configuration | 3600 | +| PHP_POST_MAX_SIZE | String | see PHP post_max_size configuration | 20M | +| PHP_OPCACHE_MEM_CONSUMPTION | String | see PHP opcache_mem_consumption configuration | 256 | +| PHPFPM_PM | String | see PHPFPM pm configuration | dynamic | +| PHPFPM_PM_MAX_CHILDREN | Integer | see PHPFPM pm.max_children configuration | 30 | +| PHPFPM_PM_START_SERVERS | Integer | see PHPFPM pm.start_servers configuration | 4 | +| PHPFPM_PM_MIN_SPARE_SERVERS | Integer | see PHPFPM pm.min_spare_servers configuration | 4 | +| PHPFPM_PM_MAX_SPARE_SERVERS | Integer | see PHPFPM pm.max_spare_servers configuration | 8 | +| PHPFPM_PM_PROCESS_IDLE_TIMEOUT | Mixed | see PHPFPM pm.process_idle_timeout configuration | 120s | +| PHPFPM_PM_MAX_REQUEST | Integer | see PHPFPM pm.max_request configuration | 2000 | +| PHP_MAX_INPUT_VARS | Integer | see PHPF max_input_vars | 3000 | +| LANG | String | Contains the locale | en_US.UTF-8 | +| LC_ALL | String | Contains the locale | en_US.UTF-8 | +| ------------------------------ | ---------------- | ------------------------------------------------------------------------- | ----------- | +| PHPFPM_XDEBUG_CLIENT_PORT | Integer | Contains xdebug client host port | | +| PHPFPM_XDEBUG_CLIENT_HOST | String | Contains xdebug client host IP or DNS name | | +| ______________________________ | ________________ | _________________________________________________________________________ | ___________ | The GLPI_INSTALL_PLUGINS variable must contains the list of plugins to install (download and extract) before starting glpi. This environment variable is a comma separated list of plugins definitions. Each plugin definition must be like this "PLUGINNAME|URL". @@ -69,10 +69,19 @@ For better example see at the end of this file. * The following volumes are exposed by this image -| Volume | Usage | -| ------------------ | ------------------------------------------------ | -| /var/www/files | The data path of GLPI | -| /var/www/config | The configuration path of GLPI | +| Volume | Usage | +| ------------------ | --------------------------------------------- | +| /var/www/files | The data path of GLPI | +| /var/www/config | The configuration path of GLPI | +| __________________________________________________________________ | + +Optional for developers: + +| Volume | Usage | +| -------------------- | -------------------------------------------- | +| /var/www/plugins | The installed manual plugins path | +| /var/www/marketplace | The installed plugins from marketplace path | +| ___________________________________________________________________ | ## Application Informations @@ -117,10 +126,9 @@ Please refer to the GLPI documentations to handle this at database level https:/ ## Installation ``` -docker pull wolvverine/docker-glpi:nginx-72-latest +docker pull wolvverine/docker-glpi:nginx-82-10.0.14-3.7 ``` - ## Usage The first time you run this image, set the GLPI_REMOVE_INSTALLER variable to 'no', then after this first installation set it to 'yes' to remove the installer. @@ -128,7 +136,7 @@ The first time you run this image, set the GLPI_REMOVE_INSTALLER variable to 'no ### Without database link (you can use an ip address or a domain name in the installer gui) ``` -docker run --name glpi --publish 8000:80 --volume data-glpi:/var/www/files --volume data-glpi-config:/var/www/config wolvverine/docker-glpi:nginx-56-latest +docker run --name glpi --publish 8000:80 --volume data-glpi:/var/www/files --volume data-glpi-config:/var/www/config wolvverine/docker-glpi:nginx-82-10.0.14-3.7 ``` ### With database link (if you have any MySQL/MariaDB as a docker container) @@ -148,7 +156,7 @@ docker run --name mysql -d --net glpi-network -e MYSQL_DATABASE=glpi -e MYSQL_US #### Start a GLPI instance ``` -docker run --name glpi --publish 8000:80 --volume data-glpi:/var/www/files --volume data-glpi-config:/var/www/config --net glpi-network wolvverine/docker-glpi:nginx-56-latest +docker run --name glpi --publish 8000:80 --volume data-glpi:/var/www/files --volume data-glpi-config:/var/www/config --net glpi-network wolvverine/docker-glpi:nginx-82-10.0.14-3.7 ``` #### Cron task on Docker host @@ -160,18 +168,17 @@ docker run --name glpi --publish 8000:80 --volume data-glpi:/var/www/files --vol ### Docker-compose Specific configuration examples -* Production configuration with already installed GLPI with FusionInventory and dashboard plugin : +* Production configuration with already installed GLPI and dashboard plugin : ``` version: '2.1' services: - + glpi: - image: wolvverine/docker-glpi:nginx-74-latest + image: wolvverine/docker-glpi:nginx-82-10.0.14-3.7 environment: GLPI_REMOVE_INSTALLER: 'no' GLPI_INSTALL_PLUGINS: " - fusioninventory|https://github.com/fusioninventory/fusioninventory-for-glpi/releases/download/glpi9.4%2B2.4/fusioninventory-9.4+2.4.tar.bz2,\ dumpentity|https://forge.glpi-project.org/attachments/download/2089/glpi-dumpentity-1.4.0.tar.gz\ " ports: @@ -187,7 +194,7 @@ services: glpi-network: aliases: - glpi - + mysqldb: image: mysql healthcheck: diff --git a/install scripts/install_upgrade_glpi_docker.sh b/install scripts/install_upgrade_glpi_docker.sh index bd5ee50..b6c7fc6 100644 --- a/install scripts/install_upgrade_glpi_docker.sh +++ b/install scripts/install_upgrade_glpi_docker.sh @@ -3,7 +3,7 @@ set -a set -x containername="glpi" -imagetag="nginx-74-10.0.3-3.5.1" +imagetag="nginx-82-10.0.14-3.7" imagename="wolvverine/docker-glpi" restartpolicy="unless-stopped" diff --git a/install scripts/install_upgrade_glpi_with_mariadb_docker.cmd b/install scripts/install_upgrade_glpi_with_mariadb_docker.cmd index b9e8a3c..1975fec 100644 --- a/install scripts/install_upgrade_glpi_with_mariadb_docker.cmd +++ b/install scripts/install_upgrade_glpi_with_mariadb_docker.cmd @@ -5,14 +5,12 @@ SET GLPI_container=GLPI SET DB_Container=MariaDB REM GLPI Docker repository and dockerhub tags SET docker_repository=wolvverine/docker-glpi -SET docker_tag=nginx-74-10.0.6-3.6 +SET docker_tag=nginx-82-10.0.14-3.7 REM aktualne tagi dla kontenera GLPI REM www_server-php_version-glpi_version-container_version -REM nginx-82-10.0.6-3.6 -REM nginx-74-10.0.6-3.6 -REM nginx-82-xdebug-10.0.6-3.6 -REM nginx-74-xdebug-10.0.6-3.6 +REM nginx-82-10.0.14-3.7 +REM nginx-82-xdebug-10.0.14-3.7 REM https://hub.docker.com/r/wolvverine/docker-glpi/tags REM Database Docker repository and dockerhub tags From 5854c0c9fab31ef4399d4891266e9b4f418fcc9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Panasiewicz?= Date: Mon, 8 Apr 2024 18:14:57 +0200 Subject: [PATCH 13/17] rewrite path for fusioninventory to glpi inventory plugin --- root/etc/nginx/nginx.conf | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/root/etc/nginx/nginx.conf b/root/etc/nginx/nginx.conf index 78652b0..e4c721f 100644 --- a/root/etc/nginx/nginx.conf +++ b/root/etc/nginx/nginx.conf @@ -68,7 +68,7 @@ http { ## NETWORK LIMITATIONS client_max_body_size 30M; client_body_buffer_size 128k; - + ## DIRECTORY root /var/www; index index.php; @@ -78,18 +78,26 @@ http { try_files $uri $uri/ =404; } - # Redirect all plugins/fusioninventory requests to /front/inventory.php + # Redirect all /plugins/fusioninventory/ requests to /front/inventory.php - native only inventory +# location ~ ^/plugins/fusioninventory/ { +# if ($http_x_forwarded_proto ~ "^https?$") { +# return 301 $http_x_forwarded_proto://$host/front/inventory.php$is_args$args; +# } +# return 301 $scheme://$host/front/inventory.php$is_args$args; +# } + + # OR redirect all /plugins/fusioninventory/ requests to /marketplace/glpiinventory/ - native plugin inventory location ~ ^/plugins/fusioninventory/ { - if ($http_x_forwarded_proto ~ "^https?$") { - return 301 $http_x_forwarded_proto://$host/front/inventory.php; - } - return 301 $scheme://$host/front/inventory.php; +# if ($http_x_forwarded_proto ~ "^https?$") { +# return 301 $http_x_forwarded_proto://$host/marketplace/glpiinventory/; +# } + return 301 $scheme://$host/marketplace/glpiinventory/; } location = /api/ { - if ($http_x_forwarded_proto ~ "^https?$") { - return 301 $http_x_forwarded_proto://$host/apirest.php; - } +# if ($http_x_forwarded_proto ~ "^https?$") { +# return 301 $http_x_forwarded_proto://$host/apirest.php; +# } return 301 $scheme://$host/apirest.php; } From 2e3e0f324e2bb2d6cccca612e829d9250b60c158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Panasiewicz?= Date: Mon, 8 Apr 2024 18:16:13 +0200 Subject: [PATCH 14/17] version 3.8 --- VERSION | 2 +- install scripts/install_upgrade_glpi_with_mariadb_docker.cmd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 548d713..98fccd6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.7 \ No newline at end of file +3.8 \ No newline at end of file diff --git a/install scripts/install_upgrade_glpi_with_mariadb_docker.cmd b/install scripts/install_upgrade_glpi_with_mariadb_docker.cmd index 1975fec..1659114 100644 --- a/install scripts/install_upgrade_glpi_with_mariadb_docker.cmd +++ b/install scripts/install_upgrade_glpi_with_mariadb_docker.cmd @@ -5,7 +5,7 @@ SET GLPI_container=GLPI SET DB_Container=MariaDB REM GLPI Docker repository and dockerhub tags SET docker_repository=wolvverine/docker-glpi -SET docker_tag=nginx-82-10.0.14-3.7 +SET docker_tag=nginx-82-10.0.14-3.8 REM aktualne tagi dla kontenera GLPI REM www_server-php_version-glpi_version-container_version From 62679fd262a034bb6e7edaa9ea33795d4bf12da7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Panasiewicz?= Date: Tue, 16 Apr 2024 22:04:14 +0200 Subject: [PATCH 15/17] Directing all traffic to the public/index.php router --- VERSION | 2 +- root/etc/nginx/nginx.conf | 51 +++++++++++++++++++++------------------ 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/VERSION b/VERSION index 98fccd6..aaaff91 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.8 \ No newline at end of file +3.8.1 \ No newline at end of file diff --git a/root/etc/nginx/nginx.conf b/root/etc/nginx/nginx.conf index e4c721f..b04d723 100644 --- a/root/etc/nginx/nginx.conf +++ b/root/etc/nginx/nginx.conf @@ -70,12 +70,13 @@ http { client_body_buffer_size 128k; ## DIRECTORY - root /var/www; + root /var/www/public; index index.php; ## LOCATION + # Correctly route requests to index.php if the requested file or directory does not exist location / { - try_files $uri $uri/ =404; + try_files $uri $uri/ /index.php$is_args$args; } # Redirect all /plugins/fusioninventory/ requests to /front/inventory.php - native only inventory @@ -120,29 +121,33 @@ http { fastcgi_intercept_errors on; } + # Explicitly handle requests to index.php, ensuring fastcgi parameters are correctly passed + location ~ ^/index\.php$ { + fastcgi_pass unix:/var/run/php-fpm.sock; + fastcgi_split_path_info ^(.+\.php)(/.*)$; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + } + # Explicitly handle requests to *.php, ensuring fastcgi parameters are correctly passed - location ~ [^/]\.php(/|$) { - # regex to split $uri to $fastcgi_script_name and $fastcgi_path - fastcgi_split_path_info ^(.+\.php)(/.+)$; + # location ~ [^/]\.php(/|$) { + # # regex to split $uri to $fastcgi_script_name and $fastcgi_path + # fastcgi_split_path_info ^(.+\.php)(/.+)$; + # # Check that the PHP script exists before passing it + # try_files $fastcgi_script_name =404; + # include fastcgi_params; + # # Bypass the fact that try_files resets $fastcgi_path_info + # # # see: http://trac.nginx.org/nginx/ticket/321 + # set $path_info $fastcgi_path_info; - # Check that the PHP script exists before passing it - try_files $fastcgi_script_name =404; - - include fastcgi_params; - - # Bypass the fact that try_files resets $fastcgi_path_info - # # see: http://trac.nginx.org/nginx/ticket/321 - set $path_info $fastcgi_path_info; - fastcgi_param PATH_INFO $path_info; - - fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param SERVER_NAME $host; - - # allow directory index - fastcgi_index index.php; - fastcgi_pass unix:/var/run/php-fpm.sock; - } + # fastcgi_param PATH_INFO $path_info; + # fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name; + # fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + # fastcgi_param SERVER_NAME $host; + # # allow directory index + # fastcgi_index index.php; + # fastcgi_pass unix:/var/run/php-fpm.sock; + # } # deny access to some ressources location ~ /(config|files)/ { From aa57c5dea131af13ce4da563cd2db04bb0e9dabe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Panasiewicz?= Date: Tue, 16 Apr 2024 22:05:54 +0200 Subject: [PATCH 16/17] container v3.8.1 typo in plugins list --- install scripts/install_upgrade_glpi_docker.sh | 4 +--- .../install_upgrade_glpi_with_mariadb_docker.cmd | 8 ++++---- install scripts/plugins_repo_list.csv | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/install scripts/install_upgrade_glpi_docker.sh b/install scripts/install_upgrade_glpi_docker.sh index b6c7fc6..789c6df 100644 --- a/install scripts/install_upgrade_glpi_docker.sh +++ b/install scripts/install_upgrade_glpi_docker.sh @@ -3,7 +3,7 @@ set -a set -x containername="glpi" -imagetag="nginx-82-10.0.14-3.7" +imagetag="nginx-82-10.0.14-3.8.1" imagename="wolvverine/docker-glpi" restartpolicy="unless-stopped" @@ -32,8 +32,6 @@ docker run --restart "$restartpolicy" --detach --name "$containername" \ -e GLPI_CHMOD_PATHS_FILES=yes -e GLPI_REMOVE_INSTALLER=yes \ -e GLPI_ENABLE_CRONJOB=yes -e TZ="Europe/Warsaw" \ -e GLPI_INSTALL_PLUGINS="\ -behaviors|https://github.com/yllen/behaviors/releases/download/v2.7.1/glpi-behaviors-2.7.1.tar.gz,\ -pdf|https://github.com/yllen/pdf/releases/download/v2.1.0/glpi-pdf-2.1.0.tar.gz,\ vip|https://github.com/InfotelGLPI/vip/releases/download/1.8.1/glpi-vip-1.8.1.tar.bz2,\ statecheck|https://github.com/ericferon/glpi-statecheck/releases/download/v2.3.7/statecheck-v2.3.7.tar.gz" \ "$imagename:$imagetag" diff --git a/install scripts/install_upgrade_glpi_with_mariadb_docker.cmd b/install scripts/install_upgrade_glpi_with_mariadb_docker.cmd index 1659114..c9bdae0 100644 --- a/install scripts/install_upgrade_glpi_with_mariadb_docker.cmd +++ b/install scripts/install_upgrade_glpi_with_mariadb_docker.cmd @@ -5,12 +5,12 @@ SET GLPI_container=GLPI SET DB_Container=MariaDB REM GLPI Docker repository and dockerhub tags SET docker_repository=wolvverine/docker-glpi -SET docker_tag=nginx-82-10.0.14-3.8 +SET docker_tag=nginx-82-10.0.14-3.8.1 REM aktualne tagi dla kontenera GLPI REM www_server-php_version-glpi_version-container_version -REM nginx-82-10.0.14-3.7 -REM nginx-82-xdebug-10.0.14-3.7 +REM nginx-82-10.0.14-3.8 +REM nginx-82-xdebug-10.0.14-3.8 REM https://hub.docker.com/r/wolvverine/docker-glpi/tags REM Database Docker repository and dockerhub tags @@ -53,7 +53,7 @@ docker run --restart unless-stopped --name %GLPI_container% ^ -e GLPI_ENABLE_CRONJOB=yes ^ -e PHP_MEMORY_LIMIT=128M ^ -e TZ="Europe/Warsaw" ^ - -e GLPI_INSTALL_PLUGINS="fusioninventory|https://github.com/fusioninventory/fusioninventory-for-glpi/releases/download/glpi10.0.6+1.1/fusioninventory-10.0.6+1.1.tar.bz2,fields|https://github.com/pluginsGLPI/fields/releases/download/1.20.6/glpi-fields-1.20.6.tar.bz2,datainjection|https://github.com/pluginsGLPI/datainjection/releases/download/2.13.2/glpi-datainjection-2.13.2.tar.bz2,genericobject|https://github.com/pluginsGLPI/genericobject/releases/download/2.14.3/glpi-genericobject-2.14.3.tar.bz2" ^ + -e GLPI_INSTALL_PLUGINS="" ^ -d %docker_repository%:%docker_tag% REM #################################################################### diff --git a/install scripts/plugins_repo_list.csv b/install scripts/plugins_repo_list.csv index 1cfc09a..c8c1885 100644 --- a/install scripts/plugins_repo_list.csv +++ b/install scripts/plugins_repo_list.csv @@ -30,4 +30,4 @@ reports,yllen,reports statecheck,ericferon,glpi-statecheck treeview,pluginsGLPI,treeview typology,InfotelGLPI,typology -vip,InfotelGLPI,vip \ No newline at end of file +vip,InfotelGLPI,vip From 87f2fce6332a1e6be06b2869bc980229e86907c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Panasiewicz?= Date: Tue, 7 May 2024 16:35:52 +0200 Subject: [PATCH 17/17] GLPI v.10.0.15 --- .github/workflows/github-actions-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-build.yml b/.github/workflows/github-actions-build.yml index 52b06fc..cfb34b2 100644 --- a/.github/workflows/github-actions-build.yml +++ b/.github/workflows/github-actions-build.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - glpiversion: [10.0.14] + glpiversion: [10.0.15] imagevariant: [nginx-82] phpxdebug: [yes,no] steps: