From 89427a845ce9cbb953896e5b5c3a14bff3be8b5e Mon Sep 17 00:00:00 2001 From: DiouxX Date: Fri, 1 Mar 2019 09:13:07 +0100 Subject: [PATCH 01/42] modify docker-compose to remove obsolet links line --- docker-compose.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 3a5ec77..d620157 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: "3" +version: "3.2" services: #Mysql Container @@ -10,6 +10,7 @@ services: - /var/lib/mysql:/var/lib/mysql env_file: - ./mysql.env + restart: always #GLPI Container glpi: @@ -18,8 +19,6 @@ services: hostname: glpi ports: - "80:80" - links: - - mysql:mysql volumes: - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro From 6d3e3900220274c3a7bf816eed17ccd42c32c09b Mon Sep 17 00:00:00 2001 From: DiouxX Date: Fri, 1 Mar 2019 09:30:01 +0100 Subject: [PATCH 02/42] Update Deploy GLPI without database section on README --- README.md | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 3bbb0f5..d64cc26 100644 --- a/README.md +++ b/README.md @@ -3,15 +3,17 @@ [![](https://images.microbadger.com/badges/version/diouxx/glpi.svg)](http://microbadger.com/images/diouxx/glpi "Get your own version badge on microbadger.com") [![](https://images.microbadger.com/badges/image/diouxx/glpi.svg)](http://microbadger.com/images/diouxx/glpi "Get your own image badge on microbadger.com") # Table of Contents -1. [Introduction](#introduction) -2. [Deploy CLI](#deploy-with-CLI) - - [Deploy GLPI without database](#deploy-glpi-without-database) - - [Deploy GLPI with existing database](#deploy-glpi-with-existing-database) - - [Deploy GLPI with database and persistance container data](#deploy-glpi-with-database-and-persistance-container-data) - - [Deploy a specific release of GLPI](#deploy-a-specific-release-of-glpi) -3. [Deploy docker-compose](#deploy-with-docker-compose) -4. [Environnment variables](#environnment-variables) - - [Timezone](#timezone) +- [Project to deploy GLPI with docker](#project-to-deploy-glpi-with-docker) +- [Table of Contents](#table-of-contents) +- [Introduction](#introduction) +- [Deploy with CLI](#deploy-with-cli) + - [Deploy GLPI](#deploy-glpi) + - [Deploy GLPI with existing database](#deploy-glpi-with-existing-database) + - [Deploy GLPI with database and persistance container data](#deploy-glpi-with-database-and-persistance-container-data) + - [Deploy a specific release of GLPI](#deploy-a-specific-release-of-glpi) +- [Deploy with docker-compose](#deploy-with-docker-compose) +- [Environnment variables](#environnment-variables) + - [TIMEZONE](#timezone) # Introduction @@ -19,9 +21,10 @@ Install and run an GLPI instance with docker. # Deploy with CLI -## Deploy GLPI without database +## Deploy GLPI ```sh -docker run --name glpi -p 80:80 -d diouxx/glpi +docker run --name mysql -e MYSQL_ROOT_PASSWORD=diouxx -e MYSQL_DATABASE=glpidb -e MYSQL_USER=glpi_user -e MYSQL_PASSWORD=glpi -d mysql:5.7.23 +docker run --name glpi --link mysql:mysql -p 80:80 -d diouxx/glpi ``` ## Deploy GLPI with existing database From f7a9c4e92f6d5af031fbab1d061b15d0a5bc29cc Mon Sep 17 00:00:00 2001 From: DiouxX Date: Fri, 1 Mar 2019 09:44:42 +0100 Subject: [PATCH 03/42] Update Dpeloy GLPI persistance data section on README --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d64cc26..ab3dd90 100644 --- a/README.md +++ b/README.md @@ -36,16 +36,16 @@ docker run --name glpi --link yourdatabase:mysql -p 80:80 -d diouxx/glpi For an usage on production environnement or daily usage, it's recommanded to use a data container for persistent data. -* First, create data container +* First, create MySQL container with volume ```sh -docker create --name glpi-data --volume /var/www/html/glpi:/var/www/html/glpi busybox /bin/true +docker run --name mysql -e MYSQL_ROOT_PASSWORD=diouxx -e MYSQL_DATABASE=glpidb -e MYSQL_USER=glpi_user -e MYSQL_PASSWORD=glpi --volume /var/lib/mysql:/var/lib/mysql -d mysql:5.7.23 ``` -* Then, you link your data container with GLPI container +* Then, create GLPI container with volume and link MySQL container ```sh -docker run --name glpi --hostname glpi --link mysql:mysql --volumes-from glpi-data -p 80:80 -d diouxx/glpi +docker run --name glpi --link mysql:mysql --volume /var/www/html/glpi:/var/www/html/glpi -p 80:80 -d diouxx/glpi ``` Enjoy :) @@ -55,7 +55,7 @@ Default, docker run will use the latest release of GLPI. For an usage on production environnement, it's recommanded to use the latest release. Here an example for release 9.1.6 : ```sh -docker run --name glpi --hostname glpi --link mysql:mysql --volumes-from glpi-data -p 80:80 --env "VERSION_GLPI=9.1.6" -d diouxx/glpi +docker run --name glpi --hostname glpi --link mysql:mysql --volume /var/www/html/glpi:/var/www/html/glpi -p 80:80 --env "VERSION_GLPI=9.1.6" -d diouxx/glpi ``` # Deploy with docker-compose From ec20aeb40e03a14cf5f1c421b10319bcc7420eb8 Mon Sep 17 00:00:00 2001 From: DiouxX Date: Fri, 1 Mar 2019 09:49:52 +0100 Subject: [PATCH 04/42] Update docker-compose section on README --- README.md | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ab3dd90..90b508b 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ - [Deploy GLPI with database and persistance container data](#deploy-glpi-with-database-and-persistance-container-data) - [Deploy a specific release of GLPI](#deploy-a-specific-release-of-glpi) - [Deploy with docker-compose](#deploy-with-docker-compose) + - [mysql.env](#mysqlenv) + - [docker-compose .yml](#docker-compose-yml) - [Environnment variables](#environnment-variables) - [TIMEZONE](#timezone) @@ -52,7 +54,7 @@ Enjoy :) ## Deploy a specific release of GLPI Default, docker run will use the latest release of GLPI. -For an usage on production environnement, it's recommanded to use the latest release. +For an usage on production environnement, it's recommanded to set specific release. Here an example for release 9.1.6 : ```sh docker run --name glpi --hostname glpi --link mysql:mysql --volume /var/www/html/glpi:/var/www/html/glpi -p 80:80 --env "VERSION_GLPI=9.1.6" -d diouxx/glpi @@ -68,6 +70,47 @@ You can modify **_mysql.env_** to personalize settings like : * GLPI user database * GLPI user password + +## mysql.env +``` +MYSQL_ROOT_PASSWORD=diouxx +MYSQL_DATABASE=glpidb +MYSQL_USER=glpi_user +MYSQL_PASSWORD=glpi +``` + +## docker-compose .yml +```yaml +version: "3.2" + +services: +#Mysql Container + mysql: + image: mysql:5.7.23 + container_name: mysql + hostname: mysql + volumes: + - /var/lib/mysql:/var/lib/mysql + env_file: + - ./mysql.env + restart: always + +#GLPI Container + glpi: + image: diouxx/glpi + container_name : glpi + hostname: glpi + ports: + - "80:80" + volumes: + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + - /var/www/html/glpi/:/var/www/html/glpi + environment: + - TIMEZONE=Europe/Brussels + restart: always +``` + To deploy, just run the following command on the same directory as files ```sh From 687c0e28f195d33e612f7ac1da18ed563c1dc4aa Mon Sep 17 00:00:00 2001 From: DiouxX Date: Fri, 1 Mar 2019 10:01:28 +0100 Subject: [PATCH 05/42] Add docker-compose without persistance data to quickly test --- README.md | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 90b508b..14264c1 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,10 @@ - [Deploy GLPI with database and persistance container data](#deploy-glpi-with-database-and-persistance-container-data) - [Deploy a specific release of GLPI](#deploy-a-specific-release-of-glpi) - [Deploy with docker-compose](#deploy-with-docker-compose) - - [mysql.env](#mysqlenv) - - [docker-compose .yml](#docker-compose-yml) + - [Deploy without persistance data ( for quickly test )](#deploy-without-persistance-data--for-quickly-test) + - [Deploy with persistance data](#deploy-with-persistance-data) + - [mysql.env](#mysqlenv) + - [docker-compose .yml](#docker-compose-yml) - [Environnment variables](#environnment-variables) - [TIMEZONE](#timezone) @@ -62,6 +64,33 @@ docker run --name glpi --hostname glpi --link mysql:mysql --volume /var/www/html # Deploy with docker-compose +## Deploy without persistance data ( for quickly test ) +```yaml +version: "3.2" + +services: +#Mysql Container + mysql: + image: mysql:5.7.23 + container_name: mysql + hostname: mysql + environment: + - MYSQL_ROOT_PASSWORD=password + - MYSQL_DATABASE=glpidb + - MYSQL_USER=glpi_user + - MYSQL_PASSWORD=glpi + +#GLPI Container + glpi: + image: diouxx/glpi + container_name : glpi + hostname: glpi + ports: + - "80:80" +``` + +## Deploy with persistance data + To deploy with docker compose, you use *docker-compose.yml* and *mysql.env* file. You can modify **_mysql.env_** to personalize settings like : @@ -71,7 +100,7 @@ You can modify **_mysql.env_** to personalize settings like : * GLPI user password -## mysql.env +### mysql.env ``` MYSQL_ROOT_PASSWORD=diouxx MYSQL_DATABASE=glpidb @@ -79,7 +108,7 @@ MYSQL_USER=glpi_user MYSQL_PASSWORD=glpi ``` -## docker-compose .yml +### docker-compose .yml ```yaml version: "3.2" From 438f401488162bf4167e3194ff35caf817ca7a0c Mon Sep 17 00:00:00 2001 From: DiouxX Date: Fri, 1 Mar 2019 10:06:07 +0100 Subject: [PATCH 06/42] spelling error --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 14264c1..d3e0d69 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,11 @@ - [Deploy with CLI](#deploy-with-cli) - [Deploy GLPI](#deploy-glpi) - [Deploy GLPI with existing database](#deploy-glpi-with-existing-database) - - [Deploy GLPI with database and persistance container data](#deploy-glpi-with-database-and-persistance-container-data) + - [Deploy GLPI with database and persistence container data](#deploy-glpi-with-database-and-persistence-container-data) - [Deploy a specific release of GLPI](#deploy-a-specific-release-of-glpi) - [Deploy with docker-compose](#deploy-with-docker-compose) - - [Deploy without persistance data ( for quickly test )](#deploy-without-persistance-data--for-quickly-test) - - [Deploy with persistance data](#deploy-with-persistance-data) + - [Deploy without persistence data ( for quickly test )](#deploy-without-persistence-data--for-quickly-test) + - [Deploy with persistence data](#deploy-with-persistence-data) - [mysql.env](#mysqlenv) - [docker-compose .yml](#docker-compose-yml) - [Environnment variables](#environnment-variables) @@ -36,7 +36,7 @@ docker run --name glpi --link mysql:mysql -p 80:80 -d diouxx/glpi docker run --name glpi --link yourdatabase:mysql -p 80:80 -d diouxx/glpi ``` -## Deploy GLPI with database and persistance container data +## Deploy GLPI with database and persistence container data For an usage on production environnement or daily usage, it's recommanded to use a data container for persistent data. @@ -64,7 +64,7 @@ docker run --name glpi --hostname glpi --link mysql:mysql --volume /var/www/html # Deploy with docker-compose -## Deploy without persistance data ( for quickly test ) +## Deploy without persistence data ( for quickly test ) ```yaml version: "3.2" @@ -89,7 +89,7 @@ services: - "80:80" ``` -## Deploy with persistance data +## Deploy with persistence data To deploy with docker compose, you use *docker-compose.yml* and *mysql.env* file. You can modify **_mysql.env_** to personalize settings like : @@ -159,7 +159,7 @@ docker run --name glpi --hostname glpi --link mysql:mysql --volumes-from glpi-da From docker-compose Modify this settings -```yml +```yaml environment: TIMEZONE=Europe/Brussels ``` \ No newline at end of file From 301356f819d40307249be58ccf10430d04454dfb Mon Sep 17 00:00:00 2001 From: DiouxX Date: Tue, 16 Apr 2019 21:29:33 +0200 Subject: [PATCH 07/42] Update README --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d3e0d69..821f6d0 100644 --- a/README.md +++ b/README.md @@ -36,9 +36,9 @@ docker run --name glpi --link mysql:mysql -p 80:80 -d diouxx/glpi docker run --name glpi --link yourdatabase:mysql -p 80:80 -d diouxx/glpi ``` -## Deploy GLPI with database and persistence container data +## Deploy GLPI with database and persistence data -For an usage on production environnement or daily usage, it's recommanded to use a data container for persistent data. +For an usage on production environnement or daily usage, it's recommanded to use container with volumes to persistent data. * First, create MySQL container with volume @@ -162,4 +162,4 @@ Modify this settings ```yaml environment: TIMEZONE=Europe/Brussels -``` \ No newline at end of file +``` From 388dcf69a8dc29293b08d3fdb3a3ba11a67532fa Mon Sep 17 00:00:00 2001 From: DiouxX Date: Wed, 2 Oct 2019 22:28:59 +0200 Subject: [PATCH 08/42] Add microbadge to readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 821f6d0..b9894ac 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Project to deploy GLPI with docker -[![](https://images.microbadger.com/badges/version/diouxx/glpi.svg)](http://microbadger.com/images/diouxx/glpi "Get your own version badge on microbadger.com") [![](https://images.microbadger.com/badges/image/diouxx/glpi.svg)](http://microbadger.com/images/diouxx/glpi "Get your own image badge on microbadger.com") +![Docker Pulls](https://img.shields.io/docker/pulls/diouxx/glpi) ![Docker Stars](https://img.shields.io/docker/stars/diouxx/glpi) [![](https://images.microbadger.com/badges/image/diouxx/glpi.svg)](http://microbadger.com/images/diouxx/glpi "Get your own image badge on microbadger.com") ![Docker Cloud Automated build](https://img.shields.io/docker/cloud/automated/diouxx/glpi) # Table of Contents - [Project to deploy GLPI with docker](#project-to-deploy-glpi-with-docker) From 9a94c822052d8dd266048e21fcabc1a822d68963 Mon Sep 17 00:00:00 2001 From: DiouxX Date: Mon, 6 Jul 2020 16:04:57 +0200 Subject: [PATCH 09/42] Fix Debian and PHP version --- Dockerfile | 30 +++++++++++++++--------------- glpi-start.sh | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 96383d9..15c9ccc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,31 +1,31 @@ #On choisit une debian -FROM debian:latest +FROM debian:10.4 MAINTAINER DiouxX "github@diouxx.be" #Ne pas poser de question à l'installation ENV DEBIAN_FRONTEND noninteractive -#Installation d'apache et de php5 avec extension +#Installation d'apache et de php7.3 avec extension RUN apt update \ -&& apt -y upgrade \ -&& apt -y install \ +&& apt --yes install \ apache2 \ -php \ -php-mysql \ -php-ldap \ -php-xmlrpc \ -php-imap \ +php7.3 \ +php7.3-mysql \ +php7.3-ldap \ +php7.3-xmlrpc \ +php7.3-imap \ curl \ -php-curl \ -php-gd \ -php-mbstring \ -php-xml \ -php-apcu-bc \ +php7.3-curl \ +php7.3-gd \ +php7.3-mbstring \ +php7.3-xml \ +php7.3-apcu-bc \ php-cas \ cron \ wget \ -jq +jq \ +&& rm -rf /var/lib/apt/lists/* #Copie et execution du script pour l'installation et l'initialisation de GLPI COPY glpi-start.sh /opt/ diff --git a/glpi-start.sh b/glpi-start.sh index 2cab106..dd044cc 100644 --- a/glpi-start.sh +++ b/glpi-start.sh @@ -5,7 +5,7 @@ && VERSION_GLPI=$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/latest | grep tag_name | cut -d '"' -f 4) if [[ -z "${TIMEZONE}" ]]; then echo "TIMEZONE is unset"; -else echo "date.timezone = \"$TIMEZONE\"" > /etc/php/7.0/apache2/conf.d/timezone.ini; +else echo "date.timezone = \"$TIMEZONE\"" > /etc/php/7.3/apache2/conf.d/timezone.ini; fi SRC_GLPI=$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/tags/${VERSION_GLPI} | jq .assets[0].browser_download_url | tr -d \") From d9faa67a9f4a5f83402e18fed7b2d23a1d81adbc Mon Sep 17 00:00:00 2001 From: DiouxX Date: Tue, 7 Jul 2020 13:24:58 +0200 Subject: [PATCH 10/42] Reduce size with --no-install-recommends --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 15c9ccc..bb01f3e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ ENV DEBIAN_FRONTEND noninteractive #Installation d'apache et de php7.3 avec extension RUN apt update \ -&& apt --yes install \ +&& apt install --yes --no-install-recommends \ apache2 \ php7.3 \ php7.3-mysql \ @@ -24,6 +24,7 @@ php7.3-apcu-bc \ php-cas \ cron \ wget \ +ca-certificates \ jq \ && rm -rf /var/lib/apt/lists/* From 2423b31052f76bf7c5a9712c2d739afd62f6cca1 Mon Sep 17 00:00:00 2001 From: Peterson Basso Date: Tue, 7 Jul 2020 11:03:35 -0300 Subject: [PATCH 11/42] update dockerfile with php extensions --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 15c9ccc..89f93e8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,6 +22,9 @@ php7.3-mbstring \ php7.3-xml \ php7.3-apcu-bc \ php-cas \ +php7.3-intl \ +php7.3-zip \ +php7.3-bz2 \ cron \ wget \ jq \ From 4a32ee01ac224c64e5e7ff63ebcbedbd5a06dbdc Mon Sep 17 00:00:00 2001 From: DiouxX Date: Sun, 11 Jul 2021 11:15:35 +0200 Subject: [PATCH 12/42] Update mysql version --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index d620157..3a4bef0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ version: "3.2" services: #Mysql Container mysql: - image: mysql:5.7.23 + image: mysql:5.7.34 container_name: mysql hostname: mysql volumes: @@ -25,4 +25,4 @@ services: - /var/www/html/glpi/:/var/www/html/glpi environment: - TIMEZONE=Europe/Brussels - restart: always \ No newline at end of file + restart: always From 41e43abf74a9fda5b513b04f46109b90636466ee Mon Sep 17 00:00:00 2001 From: Laurent Vergerolle - IPEOS Date: Tue, 3 Aug 2021 15:22:58 -0400 Subject: [PATCH 13/42] Add Timezone support for php CLI --- glpi-start.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/glpi-start.sh b/glpi-start.sh index dd044cc..8e1319b 100644 --- a/glpi-start.sh +++ b/glpi-start.sh @@ -5,7 +5,9 @@ && VERSION_GLPI=$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/latest | grep tag_name | cut -d '"' -f 4) if [[ -z "${TIMEZONE}" ]]; then echo "TIMEZONE is unset"; -else echo "date.timezone = \"$TIMEZONE\"" > /etc/php/7.3/apache2/conf.d/timezone.ini; +else +echo "date.timezone = \"$TIMEZONE\"" > /etc/php/7.3/apache2/conf.d/timezone.ini; +echo "date.timezone = \"$TIMEZONE\"" > /etc/php/7.3/cli/conf.d/timezone.ini; fi SRC_GLPI=$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/tags/${VERSION_GLPI} | jq .assets[0].browser_download_url | tr -d \") From 7f71b6d621a3577ff25fa67fad6dbb1e949ea80e Mon Sep 17 00:00:00 2001 From: DiouxX Date: Sun, 12 Dec 2021 20:52:17 +0100 Subject: [PATCH 14/42] Upgrade to Debian 11.1 and CVE-2021-40438 fix --- Dockerfile | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0c37521..5192645 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,30 +1,30 @@ #On choisit une debian -FROM debian:10.4 +FROM debian:11.1 MAINTAINER DiouxX "github@diouxx.be" #Ne pas poser de question à l'installation ENV DEBIAN_FRONTEND noninteractive -#Installation d'apache et de php7.3 avec extension +#Installation d'apache et de php7.4 avec extension RUN apt update \ && apt install --yes --no-install-recommends \ apache2 \ -php7.3 \ -php7.3-mysql \ -php7.3-ldap \ -php7.3-xmlrpc \ -php7.3-imap \ +php7.4 \ +php7.4-mysql \ +php7.4-ldap \ +php7.4-xmlrpc \ +php7.4-imap \ curl \ -php7.3-curl \ -php7.3-gd \ -php7.3-mbstring \ -php7.3-xml \ -php7.3-apcu-bc \ +php7.4-curl \ +php7.4-gd \ +php7.4-mbstring \ +php7.4-xml \ +php7.4-apcu-bc \ php-cas \ -php7.3-intl \ -php7.3-zip \ -php7.3-bz2 \ +php7.4-intl \ +php7.4-zip \ +php7.4-bz2 \ cron \ wget \ ca-certificates \ From d1d09adf30d86fabd0504bf703a83dc7e5194898 Mon Sep 17 00:00:00 2001 From: DiouxX Date: Sun, 12 Dec 2021 21:10:52 +0100 Subject: [PATCH 15/42] Change the timezone files location to PHP7.4 --- glpi-start.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glpi-start.sh b/glpi-start.sh index 8e1319b..5c6afb6 100644 --- a/glpi-start.sh +++ b/glpi-start.sh @@ -6,8 +6,8 @@ if [[ -z "${TIMEZONE}" ]]; then echo "TIMEZONE is unset"; else -echo "date.timezone = \"$TIMEZONE\"" > /etc/php/7.3/apache2/conf.d/timezone.ini; -echo "date.timezone = \"$TIMEZONE\"" > /etc/php/7.3/cli/conf.d/timezone.ini; +echo "date.timezone = \"$TIMEZONE\"" > /etc/php/7.4/apache2/conf.d/timezone.ini; +echo "date.timezone = \"$TIMEZONE\"" > /etc/php/7.4/cli/conf.d/timezone.ini; fi SRC_GLPI=$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/tags/${VERSION_GLPI} | jq .assets[0].browser_download_url | tr -d \") From 77f7fbb654c44806b953b74b9e35ba5045dc8869 Mon Sep 17 00:00:00 2001 From: DiouxX Date: Mon, 13 Dec 2021 09:24:33 +0100 Subject: [PATCH 16/42] LDAP bug fix after upgarde to Debian 11 --- glpi-start.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/glpi-start.sh b/glpi-start.sh index 5c6afb6..0592e37 100644 --- a/glpi-start.sh +++ b/glpi-start.sh @@ -16,10 +16,16 @@ FOLDER_GLPI=glpi/ FOLDER_WEB=/var/www/html/ #check if TLS_REQCERT is present +if [ ! -f /etc/ldap/ldapd.conf ] +then + echo "The file /etc/ldap/ldap.conf does not exit" + apt update && apt install -y libldap-2.4-2 libldap-common libsasl2-2 libsasl2-modules libsasl2-modules-db +fi + if !(grep -q "TLS_REQCERT" /etc/ldap/ldap.conf) then echo "TLS_REQCERT isn't present" - echo -e "TLS_REQCERT\tnever" >> /etc/ldap/ldap.conf + echo -e "TLS_REQCERT\tnever" >> /etc/ldap/ldap.conf fi #Téléchargement et extraction des sources de GLPI From cd34b15ae14a51c1a88433e3d360b8b74641d658 Mon Sep 17 00:00:00 2001 From: DiouxX Date: Mon, 13 Dec 2021 09:27:16 +0100 Subject: [PATCH 17/42] Replace deprecated MAINTAINER label --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5192645..5171e99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,8 @@ #On choisit une debian FROM debian:11.1 -MAINTAINER DiouxX "github@diouxx.be" +LABEL org.opencontainers.image.authors="github@diouxx.be" + #Ne pas poser de question à l'installation ENV DEBIAN_FRONTEND noninteractive From c765097e123560fedc0e56e86877c4ff75477c8d Mon Sep 17 00:00:00 2001 From: DiouxX Date: Tue, 14 Dec 2021 20:44:41 +0100 Subject: [PATCH 18/42] Update Readme from mysql to mariadb --- README.md | 72 +++++++++++++++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index b9894ac..402a714 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,12 @@ - [Deploy with CLI](#deploy-with-cli) - [Deploy GLPI](#deploy-glpi) - [Deploy GLPI with existing database](#deploy-glpi-with-existing-database) - - [Deploy GLPI with database and persistence container data](#deploy-glpi-with-database-and-persistence-container-data) + - [Deploy GLPI with database and persistence data](#deploy-glpi-with-database-and-persistence-data) - [Deploy a specific release of GLPI](#deploy-a-specific-release-of-glpi) - [Deploy with docker-compose](#deploy-with-docker-compose) - - [Deploy without persistence data ( for quickly test )](#deploy-without-persistence-data--for-quickly-test) + - [Deploy without persistence data ( for quickly test )](#deploy-without-persistence-data--for-quickly-test-) - [Deploy with persistence data](#deploy-with-persistence-data) - - [mysql.env](#mysqlenv) + - [mariadb.env](#mariadbenv) - [docker-compose .yml](#docker-compose-yml) - [Environnment variables](#environnment-variables) - [TIMEZONE](#timezone) @@ -27,29 +27,29 @@ Install and run an GLPI instance with docker. ## Deploy GLPI ```sh -docker run --name mysql -e MYSQL_ROOT_PASSWORD=diouxx -e MYSQL_DATABASE=glpidb -e MYSQL_USER=glpi_user -e MYSQL_PASSWORD=glpi -d mysql:5.7.23 -docker run --name glpi --link mysql:mysql -p 80:80 -d diouxx/glpi +docker run --name mariadb -e MARIADB_ROOT_PASSWORD=diouxx -e MARIADB_DATABASE=glpidb -e MARIADB_USER=glpi_user -e MARIADB_PASSWORD=glpi -d mariadb:10.7 +docker run --name glpi --link mariadb:mariadb -p 80:80 -d diouxx/glpi ``` ## Deploy GLPI with existing database ```sh -docker run --name glpi --link yourdatabase:mysql -p 80:80 -d diouxx/glpi +docker run --name glpi --link yourdatabase:mariadb -p 80:80 -d diouxx/glpi ``` ## Deploy GLPI with database and persistence data For an usage on production environnement or daily usage, it's recommanded to use container with volumes to persistent data. -* First, create MySQL container with volume +* First, create MariaDB container with volume ```sh -docker run --name mysql -e MYSQL_ROOT_PASSWORD=diouxx -e MYSQL_DATABASE=glpidb -e MYSQL_USER=glpi_user -e MYSQL_PASSWORD=glpi --volume /var/lib/mysql:/var/lib/mysql -d mysql:5.7.23 +docker run --name mariadb -e MARIADB_ROOT_PASSWORD=diouxx -e MARIADB_DATABASE=glpidb -e MARIADB_USER=glpi_user -e MARIADB_PASSWORD=glpi --volume /var/lib/mysql:/var/lib/mysql -d mariadb:10.7 ``` -* Then, create GLPI container with volume and link MySQL container +* Then, create GLPI container with volume and link MariaDB container ```sh -docker run --name glpi --link mysql:mysql --volume /var/www/html/glpi:/var/www/html/glpi -p 80:80 -d diouxx/glpi +docker run --name glpi --link mariadb:mariadb --volume /var/www/html/glpi:/var/www/html/glpi -p 80:80 -d diouxx/glpi ``` Enjoy :) @@ -59,26 +59,26 @@ Default, docker run will use the latest release of GLPI. For an usage on production environnement, it's recommanded to set specific release. Here an example for release 9.1.6 : ```sh -docker run --name glpi --hostname glpi --link mysql:mysql --volume /var/www/html/glpi:/var/www/html/glpi -p 80:80 --env "VERSION_GLPI=9.1.6" -d diouxx/glpi +docker run --name glpi --hostname glpi --link mariadb:mariadb --volume /var/www/html/glpi:/var/www/html/glpi -p 80:80 --env "VERSION_GLPI=9.1.6" -d diouxx/glpi ``` # Deploy with docker-compose ## Deploy without persistence data ( for quickly test ) ```yaml -version: "3.2" +version: "3.8" services: -#Mysql Container - mysql: - image: mysql:5.7.23 - container_name: mysql - hostname: mysql +#MariaDB Container + mariadb: + image: mariadb:10.7 + container_name: mariadb + hostname: mariadb environment: - - MYSQL_ROOT_PASSWORD=password - - MYSQL_DATABASE=glpidb - - MYSQL_USER=glpi_user - - MYSQL_PASSWORD=glpi + - MARIADB_ROOT_PASSWORD=password + - MARIADB_DATABASE=glpidb + - MARIADB_USER=glpi_user + - MARIADB_PASSWORD=glpi #GLPI Container glpi: @@ -91,21 +91,21 @@ services: ## Deploy with persistence data -To deploy with docker compose, you use *docker-compose.yml* and *mysql.env* file. -You can modify **_mysql.env_** to personalize settings like : +To deploy with docker compose, you use *docker-compose.yml* and *mariadb.env* file. +You can modify **_mariadb.env_** to personalize settings like : -* MySQL root password +* MariaDB root password * GLPI database * GLPI user database * GLPI user password -### mysql.env +### mariadb.env ``` -MYSQL_ROOT_PASSWORD=diouxx -MYSQL_DATABASE=glpidb -MYSQL_USER=glpi_user -MYSQL_PASSWORD=glpi +MARIADB_ROOT_PASSWORD=diouxx +MARIADB_DATABASE=glpidb +MARIADB_USER=glpi_user +MARIADB_PASSWORD=glpi ``` ### docker-compose .yml @@ -113,15 +113,15 @@ MYSQL_PASSWORD=glpi version: "3.2" services: -#Mysql Container - mysql: - image: mysql:5.7.23 - container_name: mysql - hostname: mysql +#MariaDB Container + mariadb: + image: mariadb:10.7 + container_name: mariadb + hostname: mariadb volumes: - /var/lib/mysql:/var/lib/mysql env_file: - - ./mysql.env + - ./mariadb.env restart: always #GLPI Container @@ -153,7 +153,7 @@ If you need to set timezone for Apache and PHP From commande line ```sh -docker run --name glpi --hostname glpi --link mysql:mysql --volumes-from glpi-data -p 80:80 --env "TIMEZONE=Europe/Brussels" -d diouxx/glpi +docker run --name glpi --hostname glpi --link mariadb:mariadb --volumes-from glpi-data -p 80:80 --env "TIMEZONE=Europe/Brussels" -d diouxx/glpi ``` From docker-compose From a0026fb9fa845a8d5c373384f3583f66157d8272 Mon Sep 17 00:00:00 2001 From: DiouxX Date: Sun, 26 Dec 2021 11:04:58 +0100 Subject: [PATCH 19/42] Update docker-compose file with mariadb --- docker-compose.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 3a4bef0..b92b69e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,15 +1,15 @@ version: "3.2" services: -#Mysql Container - mysql: - image: mysql:5.7.34 - container_name: mysql - hostname: mysql +#MariaDB Container + mariadb: + image: mariadb:10.7 + container_name: mariadb + hostname: mariadb volumes: - /var/lib/mysql:/var/lib/mysql env_file: - - ./mysql.env + - ./ariadb.env restart: always #GLPI Container From 6a55753f85a395b9d7d9fa79797da7eff14ad7ae Mon Sep 17 00:00:00 2001 From: DiouxX Date: Tue, 28 Dec 2021 08:52:35 +0100 Subject: [PATCH 20/42] Add a deployment of specific version wih docker-compose --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index 402a714..e49ed0e 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ - [Deploy a specific release of GLPI](#deploy-a-specific-release-of-glpi) - [Deploy with docker-compose](#deploy-with-docker-compose) - [Deploy without persistence data ( for quickly test )](#deploy-without-persistence-data--for-quickly-test-) + - [Deploy a specific release](#deploy-a-specific-release) - [Deploy with persistence data](#deploy-with-persistence-data) - [mariadb.env](#mariadbenv) - [docker-compose .yml](#docker-compose-yml) @@ -89,6 +90,34 @@ services: - "80:80" ``` +## Deploy a specific release + +```yaml +version: "3.8" + +services: +#MariaDB Container + mariadb: + image: mariadb:10.7 + container_name: mariadb + hostname: mariadb + environment: + - MARIADB_ROOT_PASSWORD=password + - MARIADB_DATABASE=glpidb + - MARIADB_USER=glpi_user + - MARIADB_PASSWORD=glpi + +#GLPI Container + glpi: + image: diouxx/glpi + container_name : glpi + hostname: glpi + environment: + - VERSION_GLPI=9.5.6 + ports: + - "80:80" +``` + ## Deploy with persistence data To deploy with docker compose, you use *docker-compose.yml* and *mariadb.env* file. From 149b46e7a83a4bd7038d6cb1bb90c21d738d3ff7 Mon Sep 17 00:00:00 2001 From: DiouxX Date: Tue, 28 Dec 2021 09:07:14 +0100 Subject: [PATCH 21/42] Move ldap dependances to Dockerfile --- Dockerfile | 5 +++++ glpi-start.sh | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5171e99..5c37500 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,6 +30,11 @@ cron \ wget \ ca-certificates \ jq \ +libldap-2.4-2 \ +libldap-common \ +libsasl2-2 \ +libsasl2-modules \ +libsasl2-modules-db \ && rm -rf /var/lib/apt/lists/* #Copie et execution du script pour l'installation et l'initialisation de GLPI diff --git a/glpi-start.sh b/glpi-start.sh index 0592e37..92063aa 100644 --- a/glpi-start.sh +++ b/glpi-start.sh @@ -16,12 +16,6 @@ FOLDER_GLPI=glpi/ FOLDER_WEB=/var/www/html/ #check if TLS_REQCERT is present -if [ ! -f /etc/ldap/ldapd.conf ] -then - echo "The file /etc/ldap/ldap.conf does not exit" - apt update && apt install -y libldap-2.4-2 libldap-common libsasl2-2 libsasl2-modules libsasl2-modules-db -fi - if !(grep -q "TLS_REQCERT" /etc/ldap/ldap.conf) then echo "TLS_REQCERT isn't present" From c76cef5961ccea5f2484d6748d40e29328bdb151 Mon Sep 17 00:00:00 2001 From: marcelorosa Date: Wed, 26 Jan 2022 09:52:48 -0300 Subject: [PATCH 22/42] Update docker-compose.yml --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index b92b69e..edd2f30 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: volumes: - /var/lib/mysql:/var/lib/mysql env_file: - - ./ariadb.env + - ./mariadb.env restart: always #GLPI Container From 5999b1641c2d77b9adfe09acdf91b8cb48a2d7a9 Mon Sep 17 00:00:00 2001 From: monstermichl Date: Fri, 18 Feb 2022 08:17:27 +0100 Subject: [PATCH 23/42] Extend the GLPI installed check Extending the GLPI installed check by making sure that not only the plugins folder is present. This way it is possible to install plugins before GLPI is started which makes it easier to build custom Docker images based on diouxx/glpi. --- glpi-start.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/glpi-start.sh b/glpi-start.sh index 92063aa..656a1e5 100644 --- a/glpi-start.sh +++ b/glpi-start.sh @@ -22,11 +22,13 @@ then echo -e "TLS_REQCERT\tnever" >> /etc/ldap/ldap.conf fi -#Téléchargement et extraction des sources de GLPI -if [ "$(ls ${FOLDER_WEB}${FOLDER_GLPI})" ]; +# Check if GLPI, but not only the plugins folder is present. This way it is possible to install plugins +# before GLPI is started which makes it easier to build custom Docker images based on diouxx/glpi. +if [ -d "${FOLDER_WEB}${FOLDER_GLPI}" ] && [ "$(ls ${FOLDER_WEB}${FOLDER_GLPI})" != "plugins" ]; then echo "GLPI is already installed" else + #Téléchargement et extraction des sources de GLPI wget -P ${FOLDER_WEB} ${SRC_GLPI} tar -xzf ${FOLDER_WEB}${TAR_GLPI} -C ${FOLDER_WEB} rm -Rf ${FOLDER_WEB}${TAR_GLPI} From 5eecfdaa37e65064c3ef56132b3bf103d6787fb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C5=82uski?= Date: Wed, 23 Feb 2022 20:31:17 +0100 Subject: [PATCH 24/42] add default accounts to the readme --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e49ed0e..d13c27a 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ - [Project to deploy GLPI with docker](#project-to-deploy-glpi-with-docker) - [Table of Contents](#table-of-contents) - [Introduction](#introduction) + - [Default accounts](#default-accounts) - [Deploy with CLI](#deploy-with-cli) - [Deploy GLPI](#deploy-glpi) - [Deploy GLPI with existing database](#deploy-glpi-with-existing-database) @@ -22,7 +23,18 @@ # Introduction -Install and run an GLPI instance with docker. +Install and run an GLPI instance with docker + +## Default accounts + +More info in the 📄[Docs](https://glpi-install.readthedocs.io/en/latest/install/wizard.html#end-of-installation) + +| Login/Password | Role | +|-------------------- |------------------- | +| glpi/glpi | admin account | +| tech/tech | technical account | +| normal/normal | "normal" account | +| post-only/postonly | post-only account | # Deploy with CLI From d3852d4f6b4a9548daa06db91e779b1f78af99fa Mon Sep 17 00:00:00 2001 From: DiouxX Date: Mon, 7 Mar 2022 15:30:00 +0100 Subject: [PATCH 25/42] Revert "Extend the GLPI installed check" --- glpi-start.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/glpi-start.sh b/glpi-start.sh index 656a1e5..92063aa 100644 --- a/glpi-start.sh +++ b/glpi-start.sh @@ -22,13 +22,11 @@ then echo -e "TLS_REQCERT\tnever" >> /etc/ldap/ldap.conf fi -# Check if GLPI, but not only the plugins folder is present. This way it is possible to install plugins -# before GLPI is started which makes it easier to build custom Docker images based on diouxx/glpi. -if [ -d "${FOLDER_WEB}${FOLDER_GLPI}" ] && [ "$(ls ${FOLDER_WEB}${FOLDER_GLPI})" != "plugins" ]; +#Téléchargement et extraction des sources de GLPI +if [ "$(ls ${FOLDER_WEB}${FOLDER_GLPI})" ]; then echo "GLPI is already installed" else - #Téléchargement et extraction des sources de GLPI wget -P ${FOLDER_WEB} ${SRC_GLPI} tar -xzf ${FOLDER_WEB}${TAR_GLPI} -C ${FOLDER_WEB} rm -Rf ${FOLDER_WEB}${TAR_GLPI} From 426fe39720dcd12c9533d8d1b756428fc8fcf238 Mon Sep 17 00:00:00 2001 From: DiouxX Date: Fri, 8 Apr 2022 16:17:06 +0200 Subject: [PATCH 26/42] Replace mysql.env by mariadb.env --- mysql.env | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 mysql.env diff --git a/mysql.env b/mysql.env deleted file mode 100644 index 8862982..0000000 --- a/mysql.env +++ /dev/null @@ -1,4 +0,0 @@ -MYSQL_ROOT_PASSWORD=diouxx -MYSQL_DATABASE=glpidb -MYSQL_USER=glpi_user -MYSQL_PASSWORD=glpi From 845cc6516a16548e9a827476d36a7feb283a2627 Mon Sep 17 00:00:00 2001 From: DiouxX Date: Fri, 8 Apr 2022 16:17:59 +0200 Subject: [PATCH 27/42] Add mariadb.env --- mariadb.env | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 mariadb.env diff --git a/mariadb.env b/mariadb.env new file mode 100644 index 0000000..43cb75a --- /dev/null +++ b/mariadb.env @@ -0,0 +1,4 @@ +MARIADB_ROOT_PASSWORD=diouxx +MARIADB_DATABASE=glpidb +MARIADB_USER=glpi_user +MARIADB_PASSWORD=glpi \ No newline at end of file From 520c287fe12bcbd58bfe9f5ba48929e9bf717556 Mon Sep 17 00:00:00 2001 From: Olivier Guilloux Date: Mon, 22 Aug 2022 14:18:42 +0200 Subject: [PATCH 28/42] Do curl only if necessary --- glpi-start.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/glpi-start.sh b/glpi-start.sh index 92063aa..3804d2a 100644 --- a/glpi-start.sh +++ b/glpi-start.sh @@ -10,8 +10,6 @@ echo "date.timezone = \"$TIMEZONE\"" > /etc/php/7.4/apache2/conf.d/timezone.ini; echo "date.timezone = \"$TIMEZONE\"" > /etc/php/7.4/cli/conf.d/timezone.ini; fi -SRC_GLPI=$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/tags/${VERSION_GLPI} | jq .assets[0].browser_download_url | tr -d \") -TAR_GLPI=$(basename ${SRC_GLPI}) FOLDER_GLPI=glpi/ FOLDER_WEB=/var/www/html/ @@ -27,6 +25,9 @@ if [ "$(ls ${FOLDER_WEB}${FOLDER_GLPI})" ]; then echo "GLPI is already installed" else + SRC_GLPI=$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/tags/${VERSION_GLPI} | jq .assets[0].browser_download_url | tr -d \") + TAR_GLPI=$(basename ${SRC_GLPI}) + wget -P ${FOLDER_WEB} ${SRC_GLPI} tar -xzf ${FOLDER_WEB}${TAR_GLPI} -C ${FOLDER_WEB} rm -Rf ${FOLDER_WEB}${TAR_GLPI} From ecf3657debfb709b2109042cfdceedb653715446 Mon Sep 17 00:00:00 2001 From: Paolo Asperti Date: Wed, 9 Nov 2022 10:30:48 +0100 Subject: [PATCH 29/42] added redis package --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 5c37500..673d9ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,6 +26,7 @@ php-cas \ php7.4-intl \ php7.4-zip \ php7.4-bz2 \ +php7.4-redis \ cron \ wget \ ca-certificates \ From 6fa1854e7df50d43c5ad056c7e7b89e0a47711e1 Mon Sep 17 00:00:00 2001 From: DiouxX Date: Sun, 22 Jan 2023 10:54:46 +0100 Subject: [PATCH 30/42] Update components --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 673d9ed..e1d3b0c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ #On choisit une debian -FROM debian:11.1 +FROM debian:11.6 LABEL org.opencontainers.image.authors="github@diouxx.be" From 29142fb886f440b86af2e46ef8dd9b49c186b664 Mon Sep 17 00:00:00 2001 From: DiouxX Date: Fri, 24 Feb 2023 18:12:54 +0100 Subject: [PATCH 31/42] Add Github actions to Build and Push --- .github/workflows/docker.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..bc00a38 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,27 @@ +name: Build & Publish Docker Image + +on: + push: + branches: + - master + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Set output + id: vars + run: echo ::set-output name=tag::$ + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: true + tags: diouxx/glpi:latest From 5e45330a4495172cd509155c57194d9d1ffa6b3d Mon Sep 17 00:00:00 2001 From: p1ne <8995611+p1ne@users.noreply.github.com> Date: Tue, 25 Apr 2023 17:12:02 +0300 Subject: [PATCH 32/42] Make apache config compatible with 10.0.7 See https://glpi-install.readthedocs.io/en/develop/prerequisites.html#apache-configuration for updated apache format --- glpi-start.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/glpi-start.sh b/glpi-start.sh index 92063aa..2f29845 100644 --- a/glpi-start.sh +++ b/glpi-start.sh @@ -34,7 +34,8 @@ else fi #Modification du vhost par défaut -echo -e "\n\tDocumentRoot /var/www/html/glpi\n\n\t\n\t\tAllowOverride All\n\t\tOrder Allow,Deny\n\t\tAllow from all\n\t\n\n\tErrorLog /var/log/apache2/error-glpi.log\n\tLogLevel warn\n\tCustomLog /var/log/apache2/access-glpi.log combined\n" > /etc/apache2/sites-available/000-default.conf +set +H +echo -e "\n\tDocumentRoot /var/www/html/glpi/public\n\n\t\n\t\tRequire all granted\n\t\tRewriteEngine On\n\t\tRewriteCond %{REQUEST_FILENAME} !-f\n\t\n\t\tRewriteRule ^(.*)$ index.php [QSA,L]\n\t\n\n\tErrorLog /var/log/apache2/error-glpi.log\n\tLogLevel warn\n\tCustomLog /var/log/apache2/access-glpi.log combined\n" > /etc/apache2/sites-available/000-default.conf #Add scheduled task by cron and enable echo "*/2 * * * * www-data /usr/bin/php /var/www/html/glpi/front/cron.php &>/dev/null" >> /etc/cron.d/glpi From 9f39374d7e4f5ddce42eecb8c4de357c456a925c Mon Sep 17 00:00:00 2001 From: DiouxX Date: Thu, 27 Apr 2023 10:03:55 +0200 Subject: [PATCH 33/42] Update to PHP8.1 --- Dockerfile | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index e1d3b0c..a357a80 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,29 +7,29 @@ LABEL org.opencontainers.image.authors="github@diouxx.be" #Ne pas poser de question à l'installation ENV DEBIAN_FRONTEND noninteractive -#Installation d'apache et de php7.4 avec extension +#Installation d'apache et de php8.1 avec extension RUN apt update \ +&& apt install --yes ca-certificates apt-transport-https lsb-release wget curl \ +&& curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg \ +&& sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' \ +&& apt update \ && apt install --yes --no-install-recommends \ apache2 \ -php7.4 \ -php7.4-mysql \ -php7.4-ldap \ -php7.4-xmlrpc \ -php7.4-imap \ -curl \ -php7.4-curl \ -php7.4-gd \ -php7.4-mbstring \ -php7.4-xml \ -php7.4-apcu-bc \ +php8.1 \ +php8.1-mysql \ +php8.1-ldap \ +php8.1-xmlrpc \ +php8.1-imap \ +php8.1-curl \ +php8.1-gd \ +php8.1-mbstring \ +php8.1-xml \ php-cas \ -php7.4-intl \ -php7.4-zip \ -php7.4-bz2 \ -php7.4-redis \ +php8.1-intl \ +php8.1-zip \ +php8.1-bz2 \ +php8.1-redis \ cron \ -wget \ -ca-certificates \ jq \ libldap-2.4-2 \ libldap-common \ From 69940f5ec132637a6631e4ecbf221eabb8d30e0f Mon Sep 17 00:00:00 2001 From: DiouxX Date: Thu, 27 Apr 2023 17:28:11 +0200 Subject: [PATCH 34/42] Fix issue after update to php 8 --- glpi-start.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glpi-start.sh b/glpi-start.sh index 2f29845..fade9ee 100644 --- a/glpi-start.sh +++ b/glpi-start.sh @@ -6,8 +6,8 @@ if [[ -z "${TIMEZONE}" ]]; then echo "TIMEZONE is unset"; else -echo "date.timezone = \"$TIMEZONE\"" > /etc/php/7.4/apache2/conf.d/timezone.ini; -echo "date.timezone = \"$TIMEZONE\"" > /etc/php/7.4/cli/conf.d/timezone.ini; +echo "date.timezone = \"$TIMEZONE\"" > /etc/php/8.1/apache2/conf.d/timezone.ini; +echo "date.timezone = \"$TIMEZONE\"" > /etc/php/8.1/cli/conf.d/timezone.ini; fi SRC_GLPI=$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/tags/${VERSION_GLPI} | jq .assets[0].browser_download_url | tr -d \") From de9d8b71c17ba041a391a7bf4f2d7dc71aec0332 Mon Sep 17 00:00:00 2001 From: DiouxX Date: Fri, 28 Apr 2023 11:38:43 +0200 Subject: [PATCH 35/42] Fix issue vhost apache regarding GLPI version --- glpi-start.sh | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/glpi-start.sh b/glpi-start.sh index 2f29845..63ce74e 100644 --- a/glpi-start.sh +++ b/glpi-start.sh @@ -33,9 +33,26 @@ else chown -R www-data:www-data ${FOLDER_WEB}${FOLDER_GLPI} fi -#Modification du vhost par défaut -set +H -echo -e "\n\tDocumentRoot /var/www/html/glpi/public\n\n\t\n\t\tRequire all granted\n\t\tRewriteEngine On\n\t\tRewriteCond %{REQUEST_FILENAME} !-f\n\t\n\t\tRewriteRule ^(.*)$ index.php [QSA,L]\n\t\n\n\tErrorLog /var/log/apache2/error-glpi.log\n\tLogLevel warn\n\tCustomLog /var/log/apache2/access-glpi.log combined\n" > /etc/apache2/sites-available/000-default.conf +#Adapt the Apache server according to the version of GLPI installed +## Extract local version installed +LOCAL_GLPI_VERSION=$(ls ${FOLDER_WEB}/${FOLDER_GLPI}/version) +## Extract major version number +LOCAL_GLPI_MAJOR_VERSION=$(echo $LOCAL_GLPI_VERSION | cut -d. -f1) +## Remove dots from version string +LOCAL_GLPI_VERSION_NUM=${LOCAL_GLPI_VERSION//./} + +## Target value is GLPI 1.0.7 +TARGET_GLPI_VERSION="10.0.7" +TARGET_GLPI_VERSION_NUM=${TARGET_GLPI_VERSION//./} +TARGET_GLPI_MAJOR_VERSION=$(echo $TARGET_GLPI_VERSION | cut -d. -f1) + +# Compare the numeric value of the version number to the target number +if [[ $LOCAL_GLPI_VERSION_NUM -lt $TARGET_GLPI_VERSION_NUM || $LOCAL_GLPI_MAJOR_VERSION -lt $TARGET_GLPI_MAJOR_VERSION ]]; then + echo -e "\n\tDocumentRoot /var/www/html/glpi\n\n\t\n\t\tAllowOverride All\n\t\tOrder Allow,Deny\n\t\tAllow from all\n\t\n\n\tErrorLog /var/log/apache2/error-glpi.log\n\tLogLevel warn\n\tCustomLog /var/log/apache2/access-glpi.log combined\n" > /etc/apache2/sites-available/000-default.conf +else + set +H + echo -e "\n\tDocumentRoot /var/www/html/glpi/public\n\n\t\n\t\tRequire all granted\n\t\tRewriteEngine On\n\t\tRewriteCond %{REQUEST_FILENAME} !-f\n\t\n\t\tRewriteRule ^(.*)$ index.php [QSA,L]\n\t\n\n\tErrorLog /var/log/apache2/error-glpi.log\n\tLogLevel warn\n\tCustomLog /var/log/apache2/access-glpi.log combined\n" > /etc/apache2/sites-available/000-default.conf +fi #Add scheduled task by cron and enable echo "*/2 * * * * www-data /usr/bin/php /var/www/html/glpi/front/cron.php &>/dev/null" >> /etc/cron.d/glpi From 1051a4f1cf3ba1a4857f2d48a7d5f1575ae6fb7b Mon Sep 17 00:00:00 2001 From: vladkvl13 <66673141+vladkvl13@users.noreply.github.com> Date: Thu, 20 Jul 2023 08:31:31 +0300 Subject: [PATCH 36/42] Update glpi-start.sh When the container starts, this command append the line every time. After 13 months of daily container restarts (because of bareos backup), whe have /etc/cron.d/glpi with more than 500+ line of similar crons. This make a critical CPU utilize on server. After changes all works fine. --- glpi-start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glpi-start.sh b/glpi-start.sh index a3fee58..562c79f 100644 --- a/glpi-start.sh +++ b/glpi-start.sh @@ -55,7 +55,7 @@ else fi #Add scheduled task by cron and enable -echo "*/2 * * * * www-data /usr/bin/php /var/www/html/glpi/front/cron.php &>/dev/null" >> /etc/cron.d/glpi +echo "*/2 * * * * www-data /usr/bin/php /var/www/html/glpi/front/cron.php &>/dev/null" > /etc/cron.d/glpi #Start cron service service cron start From fdbe308a26d8d43636510e8fce11a356807df89f Mon Sep 17 00:00:00 2001 From: DiouxX Date: Fri, 1 Dec 2023 14:12:07 +0100 Subject: [PATCH 37/42] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..23d450e --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,15 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +trigger: +- master + +pool: + vmImage: ubuntu-latest + +steps: +- task: WhiteSource@21 + inputs: + cwd: '$(System.DefaultWorkingDirectory)' From 2b4db4ea20dd0e50c7585f814802850ff30eb4c2 Mon Sep 17 00:00:00 2001 From: angy91m <100099034+angy91m@users.noreply.github.com> Date: Fri, 15 Dec 2023 18:41:10 +0100 Subject: [PATCH 38/42] Fix to kill apache before start it It's necessary because 'service apache2 stop' leaves some process alive --- glpi-start.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/glpi-start.sh b/glpi-start.sh index 562c79f..d7ecece 100644 --- a/glpi-start.sh +++ b/glpi-start.sh @@ -62,5 +62,8 @@ service cron start #Activation du module rewrite d'apache a2enmod rewrite && service apache2 restart && service apache2 stop +#Fix to really stop apache +pkill -9 apache + #Lancement du service apache au premier plan /usr/sbin/apache2ctl -D FOREGROUND From 9e702defa97ecdfa24dbb304ded4e1d43e12307f Mon Sep 17 00:00:00 2001 From: Angelo Burzi Date: Wed, 10 Jan 2024 10:33:30 +0100 Subject: [PATCH 39/42] updated --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 332333c..86a208c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ docker-compose-test.yml +cust-entry.sh +data +start-docker.sh \ No newline at end of file From f5062eeb6d501d8d053beb07737d4655d9eeb57e Mon Sep 17 00:00:00 2001 From: Hiren Shah Date: Thu, 18 Jan 2024 22:44:31 +0000 Subject: [PATCH 40/42] Set session.cookie_httponly to "on" in glpi-start.sh --- glpi-start.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/glpi-start.sh b/glpi-start.sh index eb02f19..e358433 100644 --- a/glpi-start.sh +++ b/glpi-start.sh @@ -10,6 +10,9 @@ echo "date.timezone = \"$TIMEZONE\"" > /etc/php/8.1/apache2/conf.d/timezone.ini; echo "date.timezone = \"$TIMEZONE\"" > /etc/php/8.1/cli/conf.d/timezone.ini; fi +#Enable session.cookie_httponly +sed -i 's,session.cookie_httponly =,session.cookie_httponly = on,g' /etc/php/8.1/apache2/php.ini + FOLDER_GLPI=glpi/ FOLDER_WEB=/var/www/html/ From af603af7b5006e4f616f83c87612bf1ab8d5034e Mon Sep 17 00:00:00 2001 From: levihb Date: Wed, 28 Feb 2024 17:31:13 +0000 Subject: [PATCH 41/42] Fix setting of session.cookie.httponly if already set --- glpi-start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glpi-start.sh b/glpi-start.sh index 522397d..f2d689e 100644 --- a/glpi-start.sh +++ b/glpi-start.sh @@ -11,7 +11,7 @@ echo "date.timezone = \"$TIMEZONE\"" > /etc/php/8.1/cli/conf.d/timezone.ini; fi #Enable session.cookie_httponly -sed -i 's,session.cookie_httponly =,session.cookie_httponly = on,g' /etc/php/8.1/apache2/php.ini +sed -i 's,session.cookie_httponly = *\(on\|off\|true\|false\|0\|1\)\?,session.cookie_httponly = on,gi' /etc/php/8.1/apache2/php.ini FOLDER_GLPI=glpi/ FOLDER_WEB=/var/www/html/ From a91721b75384c74ca93a598008410aaf68ebfd96 Mon Sep 17 00:00:00 2001 From: DiouxX Date: Fri, 22 Mar 2024 11:46:13 +0100 Subject: [PATCH 42/42] Upgrade to Debian 12 --- Dockerfile | 32 ++++++++++++++++---------------- azure-pipelines.yml | 15 --------------- glpi-start.sh | 6 +++--- 3 files changed, 19 insertions(+), 34 deletions(-) delete mode 100644 azure-pipelines.yml diff --git a/Dockerfile b/Dockerfile index a357a80..b424812 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ #On choisit une debian -FROM debian:11.6 +FROM debian:12.5 LABEL org.opencontainers.image.authors="github@diouxx.be" @@ -7,7 +7,7 @@ LABEL org.opencontainers.image.authors="github@diouxx.be" #Ne pas poser de question à l'installation ENV DEBIAN_FRONTEND noninteractive -#Installation d'apache et de php8.1 avec extension +#Installation d'apache et de php8.3 avec extension RUN apt update \ && apt install --yes ca-certificates apt-transport-https lsb-release wget curl \ && curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg \ @@ -15,23 +15,23 @@ RUN apt update \ && apt update \ && apt install --yes --no-install-recommends \ apache2 \ -php8.1 \ -php8.1-mysql \ -php8.1-ldap \ -php8.1-xmlrpc \ -php8.1-imap \ -php8.1-curl \ -php8.1-gd \ -php8.1-mbstring \ -php8.1-xml \ +php8.3 \ +php8.3-mysql \ +php8.3-ldap \ +php8.3-xmlrpc \ +php8.3-imap \ +php8.3-curl \ +php8.3-gd \ +php8.3-mbstring \ +php8.3-xml \ php-cas \ -php8.1-intl \ -php8.1-zip \ -php8.1-bz2 \ -php8.1-redis \ +php8.3-intl \ +php8.3-zip \ +php8.3-bz2 \ +php8.3-redis \ cron \ jq \ -libldap-2.4-2 \ +libldap-2.5-0 \ libldap-common \ libsasl2-2 \ libsasl2-modules \ diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 23d450e..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,15 +0,0 @@ -# Starter pipeline -# Start with a minimal pipeline that you can customize to build and deploy your code. -# Add steps that build, run tests, deploy, and more: -# https://aka.ms/yaml - -trigger: -- master - -pool: - vmImage: ubuntu-latest - -steps: -- task: WhiteSource@21 - inputs: - cwd: '$(System.DefaultWorkingDirectory)' diff --git a/glpi-start.sh b/glpi-start.sh index f2d689e..0600d63 100644 --- a/glpi-start.sh +++ b/glpi-start.sh @@ -6,12 +6,12 @@ if [[ -z "${TIMEZONE}" ]]; then echo "TIMEZONE is unset"; else -echo "date.timezone = \"$TIMEZONE\"" > /etc/php/8.1/apache2/conf.d/timezone.ini; -echo "date.timezone = \"$TIMEZONE\"" > /etc/php/8.1/cli/conf.d/timezone.ini; +echo "date.timezone = \"$TIMEZONE\"" > /etc/php/8.3/apache2/conf.d/timezone.ini; +echo "date.timezone = \"$TIMEZONE\"" > /etc/php/8.3/cli/conf.d/timezone.ini; fi #Enable session.cookie_httponly -sed -i 's,session.cookie_httponly = *\(on\|off\|true\|false\|0\|1\)\?,session.cookie_httponly = on,gi' /etc/php/8.1/apache2/php.ini +sed -i 's,session.cookie_httponly = *\(on\|off\|true\|false\|0\|1\)\?,session.cookie_httponly = on,gi' /etc/php/8.3/apache2/php.ini FOLDER_GLPI=glpi/ FOLDER_WEB=/var/www/html/