mirror of
https://github.com/DiouxX/docker-glpi.git
synced 2026-11-07 15:32:33 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
268159bfd0 | ||
|
|
c99aa8943c | ||
|
|
39b5992a89 | ||
|
|
d8a88e73b7 | ||
|
|
4dff6e4ae5 | ||
|
|
7fb771082c | ||
|
|
c67bc0b317 | ||
|
|
f8ceba3d73 | ||
|
|
f0342a357f | ||
|
|
6da5988ef3 | ||
|
|
7f7075bf06 | ||
|
|
fb5f49768c | ||
|
|
3f9a84e253 | ||
|
|
a91721b753 | ||
|
|
b97b32ebe1 | ||
|
|
af603af7b5 | ||
|
|
bfaaca8657 | ||
|
|
760591083b | ||
|
|
f5062eeb6d | ||
|
|
0bb48db140 | ||
|
|
9e702defa9 | ||
|
|
2b4db4ea20 | ||
|
|
fdbe308a26 | ||
|
|
65446fd9fe | ||
|
|
1051a4f1cf | ||
|
|
e4d30f8337 | ||
|
|
de9d8b71c1 | ||
|
|
69940f5ec1 | ||
|
|
37c78566b4 | ||
|
|
9f39374d7e | ||
|
|
a0382c3c17 | ||
|
|
5e45330a44 | ||
|
|
29142fb886 | ||
|
|
6fa1854e7d | ||
|
|
9f3a81bbd9 | ||
|
|
ecf3657deb | ||
|
|
520c287fe1 | ||
|
|
845cc6516a | ||
|
|
426fe39720 | ||
|
|
e1cc6bcac5 | ||
|
|
d3852d4f6b | ||
|
|
b9510bcaa5 | ||
|
|
e9f73a6605 | ||
|
|
5eecfdaa37 | ||
|
|
5999b1641c | ||
|
|
26b611dbb3 | ||
|
|
c76cef5961 | ||
|
|
149b46e7a8 | ||
|
|
6a55753f85 | ||
|
|
a0026fb9fa | ||
|
|
c765097e12 | ||
|
|
cd34b15ae1 | ||
|
|
77f7fbb654 | ||
|
|
d1d09adf30 | ||
|
|
7f71b6d621 | ||
|
|
3c9568c0ac | ||
|
|
41e43abf74 | ||
|
|
4a32ee01ac | ||
|
|
dd0be24762 | ||
|
|
2423b31052 | ||
|
|
d9faa67a9f | ||
|
|
9a94c82205 | ||
|
|
388dcf69a8 | ||
|
|
301356f819 | ||
|
|
438f401488 | ||
|
|
687c0e28f1 | ||
|
|
ec20aeb40e | ||
|
|
f7a9c4e92f | ||
|
|
6d3e390022 | ||
|
|
89427a845c | ||
|
|
58ff53e00b | ||
|
|
c160bc51b7 | ||
|
|
c1560a4137 | ||
|
|
6498b150b8 | ||
|
|
e7ba97f4be | ||
|
|
cc055d9e3c | ||
|
|
0dbd0e33e9 | ||
|
|
339ff3a2b4 | ||
|
|
16b5b98ce9 | ||
|
|
e1b0aeed3b | ||
|
|
29a1582714 | ||
|
|
fb5dc6cf9b | ||
|
|
3acba52bf2 | ||
|
|
8b13a3bf5c | ||
|
|
d8ff9bd5e0 | ||
|
|
c5a337fe56 | ||
|
|
d88216d498 | ||
|
|
e8a579131f | ||
|
|
c59a35788d | ||
|
|
3b2f81ab30 | ||
|
|
870a041ae7 | ||
|
|
5d78f773c3 | ||
|
|
d41c05b608 | ||
|
|
652e9ef9ee | ||
|
|
b7174c8e45 | ||
|
|
8c7fe25f3d | ||
|
|
3b77fe8f27 | ||
|
|
466c6800d0 |
No files matched your search
@@ -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
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
name: Build & Publish Docker Image PHP 7.4
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- php7.4
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
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:php7.4
|
||||||
@@ -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
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
docker-compose-test.yml
|
||||||
|
cust-entry.sh
|
||||||
|
data
|
||||||
|
start-docker.sh
|
||||||
+32
-13
@@ -1,24 +1,43 @@
|
|||||||
#On choisit une debian
|
#On choisit une debian
|
||||||
FROM debian:latest
|
FROM debian:12.5
|
||||||
|
|
||||||
|
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.3 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.3 \
|
||||||
php5-mysql \
|
php8.3-mysql \
|
||||||
php5-ldap \
|
php8.3-bcmath \
|
||||||
php5-xmlrpc \
|
php8.3-ldap \
|
||||||
php5-imap \
|
php8.3-xmlrpc \
|
||||||
curl \
|
php8.3-imap \
|
||||||
php5-curl \
|
php8.3-curl \
|
||||||
php5-gd \
|
php8.3-gd \
|
||||||
wget
|
php8.3-mbstring \
|
||||||
|
php8.3-xml \
|
||||||
|
php-cas \
|
||||||
|
php8.3-intl \
|
||||||
|
php8.3-zip \
|
||||||
|
php8.3-bz2 \
|
||||||
|
php8.3-redis \
|
||||||
|
cron \
|
||||||
|
jq \
|
||||||
|
libldap-2.5-0 \
|
||||||
|
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/
|
||||||
|
|||||||
@@ -1,49 +1,206 @@
|
|||||||
# Project to deploy GLPI with docker
|
# Project to deploy GLPI with docker
|
||||||
|
|
||||||
[](http://microbadger.com/images/diouxx/glpi "Get your own version badge on microbadger.com") [](http://microbadger.com/images/diouxx/glpi "Get your own image badge on microbadger.com")
|
  [](http://microbadger.com/images/diouxx/glpi "Get your own image badge on microbadger.com") 
|
||||||
|
|
||||||
|
# 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
|
||||||
|
```
|
||||||
+25
-33
@@ -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
|
||||||
+46
-7
@@ -1,8 +1,18 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
VERSION_GLPI=9.1.2
|
#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.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.3/apache2/php.ini
|
||||||
|
|
||||||
FOLDER_GLPI=glpi/
|
FOLDER_GLPI=glpi/
|
||||||
FOLDER_WEB=/var/www/html/
|
FOLDER_WEB=/var/www/html/
|
||||||
|
|
||||||
@@ -10,25 +20,54 @@ 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
|
||||||
if [ "$(ls ${FOLDER_WEB}${FOLDER_GLPI})" ];
|
if [ "$(ls ${FOLDER_WEB}${FOLDER_GLPI}/bin)" ];
|
||||||
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
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
MARIADB_ROOT_PASSWORD=diouxx
|
||||||
|
MARIADB_DATABASE=glpidb
|
||||||
|
MARIADB_USER=glpi_user
|
||||||
|
MARIADB_PASSWORD=glpi
|
||||||
Reference in new issue
Block a user