85 Commits
Author SHA1 Message Date
DiouxX f0342a357f Github actions docker-dev dispatch manually 2024-03-22 13:31:46 +01:00
DiouxX 6da5988ef3 Merge pull request #112 from DiouxX/DiouxX-patch-1
Create docker-dev.yml
2024-03-22 13:21:04 +01:00
DiouxX 7f7075bf06 Create docker-dev.yml 2024-03-22 13:20:01 +01:00
DiouxX b97b32ebe1 Merge pull request #105 from levihb/master
Fix setting of session.cookie.httponly if already set
2024-03-01 15:39:07 +01:00
levihb af603af7b5 Fix setting of session.cookie.httponly if already set 2024-02-28 17:31:13 +00:00
DiouxX bfaaca8657 Merge pull request #102 from hirenshah/patch-1
Set session.cookie_httponly to "on" in glpi-start.sh
2024-01-28 16:49:16 +01:00
DiouxX 760591083b Merge pull request #100 from angy91m/master
Fix to kill apache before start it
2024-01-24 10:53:09 +01:00
Hiren Shah f5062eeb6d Set session.cookie_httponly to "on" in glpi-start.sh 2024-01-18 22:44:31 +00:00
DiouxX 0bb48db140 Merge pull request #71 from OlivierGuilloux/do_curl_only_if_necessary
Do curl only if necessary
2024-01-10 13:57:28 +01:00
Angelo Burzi 9e702defa9 updated 2024-01-10 10:33:30 +01:00
angy91m 2b4db4ea20 Fix to kill apache before start it
It's necessary because 'service apache2 stop' leaves some process alive
2023-12-15 18:41:10 +01:00
DiouxX fdbe308a26 Set up CI with Azure Pipelines
[skip ci]
2023-12-01 14:12:07 +01:00
DiouxX 65446fd9fe Merge pull request #96 from vladkvl13/patch-1
Update glpi-start.sh
2023-10-22 19:57:43 +02:00
vladkvl13 1051a4f1cf 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.
2023-07-20 08:31:31 +03:00
DiouxX e4d30f8337 Merge pull request #91 from DiouxX/issue-apache
Fix issue vhost apache regarding GLPI version
2023-04-28 11:43:45 +02:00
DiouxX de9d8b71c1 Fix issue vhost apache regarding GLPI version 2023-04-28 11:38:43 +02:00
DiouxX 69940f5ec1 Fix issue after update to php 8 2023-04-27 17:28:11 +02:00
DiouxX 37c78566b4 Merge pull request #87 from DiouxX/dev-php8
Update to PHP8.1
2023-04-27 10:09:22 +02:00
DiouxX 9f39374d7e Update to PHP8.1 2023-04-27 10:03:55 +02:00
DiouxX a0382c3c17 Merge pull request #86 from p1ne/master
Make apache config compatible with 10.0.7
2023-04-27 09:06:34 +02:00
p1ne 5e45330a44 Make apache config compatible with 10.0.7
See https://glpi-install.readthedocs.io/en/develop/prerequisites.html#apache-configuration for updated apache format
2023-04-25 17:12:02 +03:00
DiouxX 29142fb886 Add Github actions to Build and Push 2023-02-24 18:12:54 +01:00
DiouxX 6fa1854e7d Update components 2023-01-22 10:54:46 +01:00
DiouxX 9f3a81bbd9 Merge pull request #77 from paspo/redis
added redis package
2022-11-10 14:57:29 +01:00
Paolo Asperti ecf3657deb added redis package 2022-11-09 10:30:48 +01:00
Olivier Guilloux 520c287fe1 Do curl only if necessary 2022-08-22 14:18:42 +02:00
DiouxX 845cc6516a Add mariadb.env 2022-04-08 16:17:59 +02:00
DiouxX 426fe39720 Replace mysql.env by mariadb.env 2022-04-08 16:17:06 +02:00
DiouxX e1cc6bcac5 Merge pull request #55 from DiouxX/revert-51-master
Revert "Extend the GLPI installed check"
2022-03-07 15:30:18 +01:00
DiouxX d3852d4f6b Revert "Extend the GLPI installed check" 2022-03-07 15:30:00 +01:00
DiouxX b9510bcaa5 Merge pull request #51 from monstermichl/master
Extend the GLPI installed check
2022-03-06 20:32:08 +01:00
DiouxX e9f73a6605 Merge pull request #52 from Toumash/feature/readme-default-credentials
add default accounts to the readme
2022-03-06 20:26:28 +01:00
Tomasz Dłuski 5eecfdaa37 add default accounts to the readme 2022-02-23 20:31:17 +01:00
monstermichl 5999b1641c 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.
2022-02-18 08:17:27 +01:00
DiouxX 26b611dbb3 Merge pull request #47 from Tchello-Slackware/master
Update docker-compose.yml to correct misspelling
2022-01-29 07:40:06 +01:00
marcelorosa c76cef5961 Update docker-compose.yml 2022-01-26 09:52:48 -03:00
DiouxX 149b46e7a8 Move ldap dependances to Dockerfile 2021-12-28 09:07:14 +01:00
DiouxX 6a55753f85 Add a deployment of specific version wih docker-compose 2021-12-28 08:52:35 +01:00
DiouxX a0026fb9fa Update docker-compose file with mariadb 2021-12-26 11:04:58 +01:00
DiouxX c765097e12 Update Readme from mysql to mariadb 2021-12-14 20:44:41 +01:00
DiouxX cd34b15ae1 Replace deprecated MAINTAINER label 2021-12-13 09:27:16 +01:00
DiouxX 77f7fbb654 LDAP bug fix after upgarde to Debian 11 2021-12-13 09:24:33 +01:00
DiouxX d1d09adf30 Change the timezone files location to PHP7.4 2021-12-12 21:10:52 +01:00
DiouxX 7f71b6d621 Upgrade to Debian 11.1 and CVE-2021-40438 fix 2021-12-12 20:52:17 +01:00
DiouxX 3c9568c0ac Merge pull request #37 from psychoz971/master
Add Timezone support for php CLI
2021-08-05 08:09:33 +02:00
Laurent Vergerolle - IPEOS 41e43abf74 Add Timezone support for php CLI 2021-08-03 15:22:58 -04:00
DiouxX 4a32ee01ac Update mysql version 2021-07-11 11:15:35 +02:00
DiouxX dd0be24762 Merge pull request #30 from petersonbasso/update_dockerfile
Updating the dockerfile with some dependencies
2020-07-07 16:24:34 +02:00
Peterson Basso 2423b31052 update dockerfile with php extensions 2020-07-07 11:03:35 -03:00
DiouxX d9faa67a9f Reduce size with --no-install-recommends 2020-07-07 13:24:58 +02:00
DiouxX 9a94c82205 Fix Debian and PHP version 2020-07-06 16:04:57 +02:00
DiouxX 388dcf69a8 Add microbadge to readme 2019-10-02 22:28:59 +02:00
DiouxX 301356f819 Update README 2019-04-16 21:29:33 +02:00
DiouxX 438f401488 spelling error 2019-03-01 10:06:07 +01:00
DiouxX 687c0e28f1 Add docker-compose without persistance data to quickly test 2019-03-01 10:01:28 +01:00
DiouxX ec20aeb40e Update docker-compose section on README 2019-03-01 09:49:52 +01:00
DiouxX f7a9c4e92f Update Dpeloy GLPI persistance data section on README 2019-03-01 09:44:42 +01:00
DiouxX 6d3e390022 Update Deploy GLPI without database section on README 2019-03-01 09:30:01 +01:00
DiouxX 89427a845c modify docker-compose to remove obsolet links line 2019-03-01 09:13:07 +01:00
DiouxX c160bc51b7 Remove useless Busybox container 2018-11-15 20:06:22 +01:00
DiouxX c1560a4137 Specified Mysql version to avoid error connection with Mysql vesion 8 2018-10-08 08:47:02 +02:00
DiouxX 6498b150b8 Add CAS plugin 2018-08-24 16:26:18 +02:00
DiouxX e7ba97f4be Merge pull request #16 from pcortellezzi/master
Use GitHub API to retrieve the release download url
2018-08-24 15:22:56 +02:00
pcortellezzi cc055d9e3c Revert change on wrong test gplpi directory empty 2018-08-24 14:58:06 +02:00
Philippe CORTELLEZZI 0dbd0e33e9 Use GitHub API to retrieve the release download url 2018-07-19 09:00:53 +02:00
DiouxX 339ff3a2b4 Add Read Only to volume timezone and localtime 2018-04-23 11:48:58 +02:00
DiouxX 16b5b98ce9 Update README 2018-04-11 16:29:51 +02:00
DiouxX e1b0aeed3b delete docker-compose-test.yml file 2018-04-11 16:04:17 +02:00
DiouxX 29a1582714 add environnement varibales on docker-compose 2018-04-11 15:54:26 +02:00
DiouxX fb5dc6cf9b add .gitignore file 2018-04-11 15:51:17 +02:00
DiouxX 3acba52bf2 Add timezone settings 2018-04-11 15:38:51 +02:00
DiouxX 8b13a3bf5c Merge pull request #9 from Lunaden/master
Fix Cron
2018-04-11 14:40:43 +02:00
DiouxX d8ff9bd5e0 Merge branch 'master' into master 2018-04-11 14:40:22 +02:00
root c5a337fe56 Remove leftover timezone.ini file 2018-04-11 14:20:29 +02:00
root d88216d498 Fix timezone where somtimes apache / php timezone differ from container timezone 2018-04-11 14:09:54 +02:00
DiouxX e8a579131f Cron feature Fix 2018-04-11 11:36:51 +02:00
Drouin Amaury c59a35788d Try to fix timezone in apache2 / php 2018-04-11 11:28:49 +02:00
Drouin Amaury 3b2f81ab30 Add cron to Dockerfile install. Change glpi-start.sh to add cron file to
the right directory and start cron at start before apache2ctl
2018-04-11 11:15:45 +02:00
DiouxX 870a041ae7 Add scheduled task features by cron 2017-12-17 16:10:45 +01:00
DiouxX 5d78f773c3 Merge pull request #5 from sylvainrolland/master
add  latest release for GLPI_VERSION
2017-09-05 09:08:11 +02:00
sylvainrolland d41c05b608 Update README.md 2017-08-18 11:46:11 +02:00
sylvainrolland 652e9ef9ee update readme for release choice
add specific release choice
2017-08-18 11:35:51 +02:00
sylvainrolland b7174c8e45 change VERSION_GLPI for latest release
change VERSION_GLPI for get latest release if undifined when container initialization.
2017-08-18 11:31:48 +02:00
DiouxX 8c7fe25f3d Change php version with debian stretch and add php extensions 2017-07-11 12:18:02 +02:00
DiouxX 3b77fe8f27 Add version 9.1.4 2017-07-11 11:51:41 +02:00
10 changed files with 345 additions and 70 deletions

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
name: Build & Publish Dev Docker image
on:
push:
branches:
- "dev"
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5.3.0
with:
push: true
tags: diouxx/glpi:dev
+27
View File
@@ -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
+4
View File
@@ -0,0 +1,4 @@
docker-compose-test.yml
cust-entry.sh
data
start-docker.sh
+31 -13
View File
@@ -1,24 +1,42 @@
#On choisit une debian #On choisit une debian
FROM debian:latest FROM debian:11.6
LABEL org.opencontainers.image.authors="github@diouxx.be"
MAINTAINER DiouxX "github@diouxx.be"
#Ne pas poser de question à l'installation #Ne pas poser de question à l'installation
ENV DEBIAN_FRONTEND noninteractive ENV DEBIAN_FRONTEND noninteractive
#Installation d'apache et de php5 avec extension #Installation d'apache et de php8.1 avec extension
RUN apt update \ RUN apt update \
&& apt -y install \ && 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 \ apache2 \
php5 \ php8.1 \
php5-mysql \ php8.1-mysql \
php5-ldap \ php8.1-ldap \
php5-xmlrpc \ php8.1-xmlrpc \
php5-imap \ php8.1-imap \
curl \ php8.1-curl \
php5-curl \ php8.1-gd \
php5-gd \ php8.1-mbstring \
wget php8.1-xml \
php-cas \
php8.1-intl \
php8.1-zip \
php8.1-bz2 \
php8.1-redis \
cron \
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 #Copie et execution du script pour l'installation et l'initialisation de GLPI
COPY glpi-start.sh /opt/ COPY glpi-start.sh /opt/
+171 -14
View File
@@ -1,49 +1,206 @@
# Project to deploy GLPI with docker # 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)
- [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)
- [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 a specific release](#deploy-a-specific-release)
- [Deploy with persistence data](#deploy-with-persistence-data)
- [mariadb.env](#mariadbenv)
- [docker-compose .yml](#docker-compose-yml)
- [Environnment variables](#environnment-variables)
- [TIMEZONE](#timezone)
# Introduction
Install and run an GLPI instance with docker Install and run an GLPI instance with docker
## Deploy GLPI without database ## 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
## Deploy GLPI
```sh ```sh
docker run --name glpi -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 ## Deploy GLPI with existing database
```sh ```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 persistance container data (Recommended) ## 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 data container * First, create MariaDB container with volume
```sh ```sh
docker create --name glpi-data --volume /var/www/html/glpi:/var/www/html/glpi busybox /bin/true 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, you link your data container with GLPI container * Then, create GLPI container with volume and link MariaDB container
```sh ```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 mariadb:mariadb --volume /var/www/html/glpi:/var/www/html/glpi -p 80:80 -d diouxx/glpi
``` ```
Enjoy :) Enjoy :)
## Deploy with docker-compose ## 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 set specific release.
Here an example for release 9.1.6 :
```sh
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
```
To deploy with docker compose, you use *docker-compose.yml* and *mysql.env* file. # Deploy with docker-compose
You can modify **_mysql.env_** to personalize settings like :
* MySQL root password ## Deploy without persistence data ( for quickly test )
```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
ports:
- "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.
You can modify **_mariadb.env_** to personalize settings like :
* MariaDB root password
* GLPI database * GLPI database
* GLPI user database * GLPI user database
* GLPI user password * GLPI user password
### mariadb.env
```
MARIADB_ROOT_PASSWORD=diouxx
MARIADB_DATABASE=glpidb
MARIADB_USER=glpi_user
MARIADB_PASSWORD=glpi
```
### docker-compose .yml
```yaml
version: "3.2"
services:
#MariaDB Container
mariadb:
image: mariadb:10.7
container_name: mariadb
hostname: mariadb
volumes:
- /var/lib/mysql:/var/lib/mysql
env_file:
- ./mariadb.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 To deploy, just run the following command on the same directory as files
```sh ```sh
docker-compose up -d docker-compose up -d
``` ```
# Environnment variables
## TIMEZONE
If you need to set timezone for Apache and PHP
From commande line
```sh
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
Modify this settings
```yaml
environment:
TIMEZONE=Europe/Brussels
```
+15
View File
@@ -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)'
+25 -33
View File
@@ -1,36 +1,28 @@
#Mysql Persitance Data version: "3.2"
mysql-data:
image: busybox
container_name: mysql-data
volumes:
- /var/lib/mysql:/var/lib/mysql
#Mysql Container services:
mysql: #MariaDB Container
image: mysql mariadb:
container_name: mysql image: mariadb:10.7
hostname: mysql container_name: mariadb
volumes_from: hostname: mariadb
- mysql-data volumes:
env_file: - /var/lib/mysql:/var/lib/mysql
- ./mysql.env env_file:
- ./mariadb.env
#GLPI Pesitance Data restart: always
glpi-data:
image: busybox
container_name: glpi-data
volumes:
- /var/www/html/glpi:/var/www/html/glpi
#GLPI Container #GLPI Container
glpi: glpi:
image: diouxx/glpi image: diouxx/glpi
container_name : glpi container_name : glpi
hostname: glpi hostname: glpi
ports: ports:
- "80:80" - "80:80"
links: volumes:
- mysql:mysql - /etc/timezone:/etc/timezone:ro
volumes_from: - /etc/localtime:/etc/localtime:ro
- glpi-data - /var/www/html/glpi/:/var/www/html/glpi
restart: always environment:
- TIMEZONE=Europe/Brussels
restart: always
+45 -6
View File
@@ -1,8 +1,18 @@
#!/bin/bash #!/bin/bash
VERSION_GLPI=9.1.3 #Controle du choix de version ou prise de la latest
SRC_GLPI=https://github.com/glpi-project/glpi/releases/download/${VERSION_GLPI}/glpi-${VERSION_GLPI}.tgz [[ ! "$VERSION_GLPI" ]] \
TAR_GLPI=glpi-${VERSION_GLPI}.tgz && 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/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 = *\(on\|off\|true\|false\|0\|1\)\?,session.cookie_httponly = on,gi' /etc/php/8.1/apache2/php.ini
FOLDER_GLPI=glpi/ FOLDER_GLPI=glpi/
FOLDER_WEB=/var/www/html/ FOLDER_WEB=/var/www/html/
@@ -10,7 +20,7 @@ FOLDER_WEB=/var/www/html/
if !(grep -q "TLS_REQCERT" /etc/ldap/ldap.conf) if !(grep -q "TLS_REQCERT" /etc/ldap/ldap.conf)
then then
echo "TLS_REQCERT isn't present" 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 fi
#Téléchargement et extraction des sources de GLPI #Téléchargement et extraction des sources de GLPI
@@ -18,17 +28,46 @@ if [ "$(ls ${FOLDER_WEB}${FOLDER_GLPI})" ];
then then
echo "GLPI is already installed" echo "GLPI is already installed"
else 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} wget -P ${FOLDER_WEB} ${SRC_GLPI}
tar -xzf ${FOLDER_WEB}${TAR_GLPI} -C ${FOLDER_WEB} tar -xzf ${FOLDER_WEB}${TAR_GLPI} -C ${FOLDER_WEB}
rm -Rf ${FOLDER_WEB}${TAR_GLPI} rm -Rf ${FOLDER_WEB}${TAR_GLPI}
chown -R www-data:www-data ${FOLDER_WEB}${FOLDER_GLPI} chown -R www-data:www-data ${FOLDER_WEB}${FOLDER_GLPI}
fi fi
#Modification du vhost par défaut #Adapt the Apache server according to the version of GLPI installed
echo -e "<VirtualHost *:80>\n\tDocumentRoot /var/www/html/glpi\n\n\t<Directory /var/www/html/glpi>\n\t\tAllowOverride All\n\t\tOrder Allow,Deny\n\t\tAllow from all\n\t</Directory>\n\n\tErrorLog /var/log/apache2/error-glpi.log\n\tLogLevel warn\n\tCustomLog /var/log/apache2/access-glpi.log combined\n</VirtualHost>" > /etc/apache2/sites-available/000-default.conf ## 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 "<VirtualHost *:80>\n\tDocumentRoot /var/www/html/glpi\n\n\t<Directory /var/www/html/glpi>\n\t\tAllowOverride All\n\t\tOrder Allow,Deny\n\t\tAllow from all\n\t</Directory>\n\n\tErrorLog /var/log/apache2/error-glpi.log\n\tLogLevel warn\n\tCustomLog /var/log/apache2/access-glpi.log combined\n</VirtualHost>" > /etc/apache2/sites-available/000-default.conf
else
set +H
echo -e "<VirtualHost *:80>\n\tDocumentRoot /var/www/html/glpi/public\n\n\t<Directory /var/www/html/glpi/public>\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</Directory>\n\n\tErrorLog /var/log/apache2/error-glpi.log\n\tLogLevel warn\n\tCustomLog /var/log/apache2/access-glpi.log combined\n</VirtualHost>" > /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
#Start cron service
service cron start
#Activation du module rewrite d'apache #Activation du module rewrite d'apache
a2enmod rewrite && service apache2 restart && service apache2 stop a2enmod rewrite && service apache2 restart && service apache2 stop
#Fix to really stop apache
pkill -9 apache
#Lancement du service apache au premier plan #Lancement du service apache au premier plan
/usr/sbin/apache2ctl -D FOREGROUND /usr/sbin/apache2ctl -D FOREGROUND
+4
View File
@@ -0,0 +1,4 @@
MARIADB_ROOT_PASSWORD=diouxx
MARIADB_DATABASE=glpidb
MARIADB_USER=glpi_user
MARIADB_PASSWORD=glpi
-4
View File
@@ -1,4 +0,0 @@
MYSQL_ROOT_PASSWORD=diouxx
MYSQL_DATABASE=glpidb
MYSQL_USER=glpi_user
MYSQL_PASSWORD=glpi