From 58ff53e00b650a35c9f4ebd54c338edf0988349c Mon Sep 17 00:00:00 2001 From: DiouxX Date: Fri, 28 Dec 2018 10:19:45 +0100 Subject: [PATCH 1/3] Add SNMP package --- Dockerfile | 3 ++- glpi-start.sh | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 96383d9..0bd2e29 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,8 @@ php-apcu-bc \ php-cas \ cron \ wget \ -jq +jq \ +snmpd #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..2a74219 100644 --- a/glpi-start.sh +++ b/glpi-start.sh @@ -34,13 +34,25 @@ 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 +#Activation du module rewrite d'apache +a2enmod rewrite && service apache2 restart && service apache2 stop + +###################### +# CRON CONFIGURATION # +###################### #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 -a2enmod rewrite && service apache2 restart && service apache2 stop +###################### +# SNMP CONFIGURATION # +###################### +#Replace Listen localhot SNMP and restart service +sed -ie "s/agentAddress udp:127.0.0.1:161/agentAdrress udp:161/g" /etc/snmp/snmpd.conf + +service snmpd restart #Lancement du service apache au premier plan /usr/sbin/apache2ctl -D FOREGROUND From a91721b75384c74ca93a598008410aaf68ebfd96 Mon Sep 17 00:00:00 2001 From: DiouxX Date: Fri, 22 Mar 2024 11:46:13 +0100 Subject: [PATCH 2/3] 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/ From f8ceba3d73a11991d60c012f105c34c2712c7842 Mon Sep 17 00:00:00 2001 From: DiouxX Date: Fri, 22 Mar 2024 13:38:30 +0100 Subject: [PATCH 3/3] Add Docker build and push to dev branch --- .github/workflows/docker-dev.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/docker-dev.yml diff --git a/.github/workflows/docker-dev.yml b/.github/workflows/docker-dev.yml new file mode 100644 index 0000000..586bb26 --- /dev/null +++ b/.github/workflows/docker-dev.yml @@ -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