35 Commits

Author SHA1 Message Date
395cae112a glpi upgrade
All checks were successful
Container Publish / on-success-skip (push) Has been skipped
Container Publish / build-image (arm64) (push) Successful in 1m3s
Container Publish / build-image (amd64) (push) Successful in 3m35s
Container Publish / update docker manifest (push) Successful in 25s
2025-09-22 10:20:51 +02:00
e24e2b3d5b switched from drone to gitea actions
All checks were successful
Container Publish / on-success-skip (push) Has been skipped
Container Publish / build-image (arm64) (push) Successful in 17s
Container Publish / build-image (amd64) (push) Successful in 18s
Container Publish / update docker manifest (push) Successful in 18s
Vulnerability Scan / Daily Vulnerability Scan (arm64) (push) Successful in 5s
Vulnerability Scan / Daily Vulnerability Scan (amd64) (push) Successful in 5s
2025-06-08 13:26:56 +02:00
2cb032520a back to php 8.3
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/tag Build is passing
Vulnerability Scan / Daily Vulnerability Scan (push) Successful in 13s
2025-04-19 09:17:14 +02:00
604863c39c fix php84
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2025-04-19 09:03:30 +02:00
4218c4fac3 fix warning
Some checks failed
continuous-integration/drone/push Build is failing
2025-04-19 09:01:40 +02:00
990ac9e0a8 php update
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2025-04-19 08:50:31 +02:00
4fd2ca42dd updated glpi
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/tag Build is passing
2025-04-19 08:36:02 +02:00
46ef5a68a2 update alpine 2025-04-19 08:35:49 +02:00
e6c28c3b15 fix trivy
All checks were successful
continuous-integration/drone/push Build is passing
Vulnerability Scan / Daily Vulnerability Scan (push) Successful in 2m22s
2025-01-17 08:01:20 +01:00
d2824d0831 cached trivy db
All checks were successful
continuous-integration/drone/push Build is passing
Vulnerability Scan / Daily Vulnerability Scan (push) Successful in 10m43s
2024-12-02 16:41:18 +01:00
fb51b8e9da glpi upgrade
Some checks are pending
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
Vulnerability Scan / Daily Vulnerability Scan (push) Has started running
2024-11-06 12:02:03 +01:00
f21a2ecfbe php upgrade
Some checks failed
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
Vulnerability Scan / Daily Vulnerability Scan (push) Failing after 7s
2024-07-03 12:26:40 +02:00
d64c4d63f2 alpine update 2024-07-03 11:40:32 +02:00
47adcd273c glpi upgrade
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2024-07-03 11:30:39 +02:00
9579efb437 glpi upgrade
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
Vulnerability Scan / Daily Vulnerability Scan (push) Successful in 1m0s
2024-04-26 13:16:01 +02:00
0174c5fa3c glpi upgrade
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
Vulnerability Scan / Daily Vulnerability Scan (push) Successful in 1m0s
2024-03-14 10:55:54 +01:00
7c81af35e6 glpi upgrade
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
Vulnerability Scan / Daily Vulnerability Scan (push) Successful in 2m21s
2024-03-13 10:10:37 +01:00
75aa86c758 glpi upgrade
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2024-02-01 21:13:49 +01:00
0692319fbd performance tuning
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2024-01-05 11:39:44 +01:00
0f89e98902 add cron support 2024-01-05 11:35:26 +01:00
541641f90c don't expose PHP
All checks were successful
continuous-integration/drone/push Build is passing
2024-01-04 19:11:35 +01:00
fb1c25a18f updated compose
All checks were successful
continuous-integration/drone/push Build is passing
Vulnerability Scan / Daily Vulnerability Scan (push) Successful in 2m5s
2023-12-13 12:18:31 +01:00
72b67b640d fix drone
All checks were successful
continuous-integration/drone/push Build is passing
2023-12-13 12:04:40 +01:00
8c786b4594 fix vulnscan
Some checks failed
continuous-integration/drone/push Build encountered an error
2023-12-13 12:00:26 +01:00
cbc162e79c upgrade alpine+glpi
Some checks failed
continuous-integration/drone/push Build encountered an error
continuous-integration/drone/tag Build encountered an error
2023-12-13 11:39:04 +01:00
4c0d5f6ef9 test vulnscan action
All checks were successful
continuous-integration/drone/push Build is passing
2023-10-30 12:00:11 +01:00
8473b553f8 test vulnscan action
All checks were successful
continuous-integration/drone/push Build is passing
2023-10-30 11:57:51 +01:00
c3e2fab933 test vulnscan action
All checks were successful
continuous-integration/drone/push Build is passing
2023-10-30 11:34:34 +01:00
e7d24d8843 APK cache removed from image
All checks were successful
continuous-integration/drone/push Build is passing
2023-10-30 11:23:44 +01:00
e6b98211c9 glpi upgrade
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2023-09-25 11:39:24 +02:00
73dada42ed new drone
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2023-07-15 12:21:00 +02:00
7cd9a69fd2 build message 2023-07-13 14:40:12 +02:00
3579a5dc57 Get composer from main website
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2023-07-12 10:16:10 +02:00
01fb2b0c26 added some deps
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2023-07-12 09:54:12 +02:00
fa94e26857 updated glpi
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2023-07-11 11:25:43 +02:00
15 changed files with 226 additions and 80 deletions

View File

@@ -1,6 +0,0 @@
db/
glpi/
docker-compose.yaml
.drone.yaml
.env
.gitignore

View File

@@ -1,49 +0,0 @@
kind: pipeline
type: docker
name: default
steps:
- name: build_and_publish_tag
image: plugins/docker:linux-amd64
settings:
force_tag: true
password:
from_secret: docker_password
registry: docker.asperti.com
repo: docker.asperti.com/paspo/glpi
context: .
dockerfile: ./Dockerfile
build_args:
- GLPI_VERSION=10.0.8
username:
from_secret: docker_username
tags:
- latest
- ${DRONE_TAG}
- ${DRONE_SEMVER_MAJOR}.${DRONE_SEMVER_MINOR}
when:
event:
- tag
- name: build_and_publish
image: plugins/docker:linux-amd64
settings:
force_tag: true
password:
from_secret: docker_password
registry: docker.asperti.com
repo: docker.asperti.com/paspo/glpi
context: .
dockerfile: ./Dockerfile
build_args:
- GLPI_VERSION=10.0.8
username:
from_secret: docker_username
tags:
- latest
when:
branch:
- master
event:
- push
- cron

View File

@@ -0,0 +1,98 @@
---
name: Container Publish
env:
REGISTRY: docker.asperti.com
REPOSITORY: paspo/glpi
on:
push:
tags:
- '*'
schedule:
- cron: "0 12 3 * *"
workflow_dispatch:
workflow_call:
workflow_run:
workflows: [vulnscan.yaml]
types: [completed]
jobs:
on-success-skip:
runs-on:
labels: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- run: exit_with_success
build-image:
runs-on:
labels: [ubuntu-latest, "arch-${{ matrix.arch }}"]
container:
image: catthehacker/ubuntu:act-latest
strategy:
matrix:
arch: [amd64, arm64]
steps:
- uses: actions/checkout@v4
- name: Login to registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and publish
run: |
cd src && \
docker build \
--tag ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-${{ matrix.arch }} \
--tag ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:10-${{ matrix.arch }} \
--tag ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:10.0.20-${{ matrix.arch }} \
--build-arg "GLPI_VERSION=10.0.20" \
--build-arg "ALPINE_VERSION=3.21" \
--platform linux/${{ matrix.arch }} -f Dockerfile .
docker push ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-${{ matrix.arch }}
docker push ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:10-${{ matrix.arch }}
docker push ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:10.0.20-${{ matrix.arch }}
manifest:
name: update docker manifest
needs: build-image
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
steps:
- name: Login to registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: latest
run: |
docker manifest create \
${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest \
--amend ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-amd64 \
--amend ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-arm64
docker manifest push ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest
- name: "10"
run: |
docker manifest create \
${{ env.REGISTRY }}/${{ env.REPOSITORY }}:10 \
--amend ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:10-amd64 \
--amend ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:10-arm64
docker manifest push ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:10
- name: "10.0.20"
run: |
docker manifest create \
${{ env.REGISTRY }}/${{ env.REPOSITORY }}:10.0.20 \
--amend ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:10.0.20-amd64 \
--amend ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:10.0.20-arm64
docker manifest push ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:10.0.20

View File

@@ -0,0 +1,64 @@
---
name: Vulnerability Scan
env:
REGISTRY: docker.asperti.com
REPOSITORY: paspo/glpi
on:
schedule:
- cron: "0 14 * * *"
workflow_dispatch:
workflow_call:
workflow_run:
workflows: [build_and_publish.yaml]
types: [completed]
jobs:
scan:
name: Daily Vulnerability Scan
runs-on:
labels: [ubuntu-latest, "arch-${{ matrix.arch }}"]
container:
image: catthehacker/ubuntu:act-latest
strategy:
matrix:
arch: [amd64, arm64]
steps:
- name: Pull docker image
run: docker pull ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest
- name: Setup trivy
run: |
echo "Installing Trivy for arch: $(uname -m)"
case $(uname -m) in
x86_64)
wget -O /tmp/trivy.deb https://github.com/aquasecurity/trivy/releases/download/v0.58.2/trivy_0.58.2_Linux-64bit.deb ;;
aarch64)
wget -O /tmp/trivy.deb https://github.com/aquasecurity/trivy/releases/download/v0.58.2/trivy_0.58.2_Linux-ARM64.deb ;;
*) exit 1 ;;
esac
dpkg -i /tmp/trivy.deb
- name: Run Trivy vulnerability scanner
id: scan
run: |
trivy --server ${{ secrets.TRIVY_SERVER }} --token ${{ secrets.TRIVY_TOKEN }} image --format json ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest > trivy-results.json
# if some vulnerability is found, we fail
- name: check output
id: vulncount
run: |
echo "VULNCOUNT=$(jq '.Results[0].Vulnerabilities|length' trivy-results.json)" >> ${GITHUB_OUTPUT}
if [ $(jq '.Results[0].Vulnerabilities|length' trivy-results.json) -ne "0" ] ; then exit 1 ; fi
- name: send telegram notification
if: failure()
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: markdown
message: |
Found **${{ steps.vulncount.outputs.VULNCOUNT }}** vulnerabilities in `${{ github.repository }}`

View File

@@ -1,20 +0,0 @@
FROM alpine:3.18
ARG GLPI_VERSION=10.0.8
RUN \
mkdir -p /logs /config /files /marketplace && \
apk -U upgrade && \
apk add curl nginx php82 php82-bz2 php82-ctype php82-curl php82-dom php82-exif \
php82-fileinfo php82-fpm php82-gd php82-iconv php82-intl php82-ldap php82-mysqli \
php82-opcache php82-openssl php82-pecl-apcu php82-pecl-redis php82-phar php82-session \
php82-simplexml php82-sodium php82-xml php82-zip php82-xmlreader php82-xmlwriter && \
wget -O - https://github.com/glpi-project/glpi/releases/download/${GLPI_VERSION}/glpi-${GLPI_VERSION}.tgz | tar xz -C /var/www
COPY rootfs /
# config test
RUN nginx -t
HEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1:80/fpm-ping
ENTRYPOINT [ "/bin/sh", "/start.sh" ]

View File

@@ -7,10 +7,22 @@ Web server for GLPI deployment
## build ## build
```bash ```bash
git submodule update --init --remote cd src
docker build -t docker.asperti.com/paspo/glpi . docker build -t docker.asperti.com/paspo/glpi --build-arg "ALPINE_VERSION=3.19" --build-arg "GLPI_VERSION=10.0.11" .
``` ```
## run ## run
see [docker-compose.yaml](docker-compose.yaml) see [docker-compose.yaml](docker-compose.yaml)
## test drone config
```sh
drone starlark --format --stdout
```
## run vulnscan locally
```bash
act -W .gitea/workflows/vulnscan.yaml -j scan
```

View File

@@ -10,9 +10,16 @@ services:
- MARIADB_DATABASE=${MARIADB_DATABASE} - MARIADB_DATABASE=${MARIADB_DATABASE}
- MARIADB_USER=${MARIADB_USER} - MARIADB_USER=${MARIADB_USER}
- MARIADB_PASSWORD=${MARIADB_PASSWORD} - MARIADB_PASSWORD=${MARIADB_PASSWORD}
- MARIADB_AUTO_UPGRADE=1
logging:
options:
max-size: 10m
redis: redis:
image: redis:latest image: redis:alpine
logging:
options:
max-size: 10m
glpi: glpi:
build: . build: .
@@ -29,3 +36,6 @@ services:
- ./glpi/files:/files - ./glpi/files:/files
- ./glpi/marketplace:/marketplace - ./glpi/marketplace:/marketplace
- ./glpi/plugins:/var/www/glpi/plugins - ./glpi/plugins:/var/www/glpi/plugins
logging:
options:
max-size: 10m

30
src/Dockerfile Normal file
View File

@@ -0,0 +1,30 @@
ARG ALPINE_VERSION
FROM alpine:${ALPINE_VERSION}
ARG GLPI_VERSION
RUN \
mkdir -p /logs /config /files /marketplace && \
apk -U upgrade && \
apk add --no-cache curl nginx php83 php83-bz2 php83-ctype php83-curl php83-dom php83-exif \
php83-fileinfo php83-fpm php83-gd php83-iconv php83-intl php83-ldap php83-mysqli \
php83-opcache php83-openssl php83-pecl-apcu php83-pecl-redis php83-phar php83-session \
php83-simplexml php83-sodium php83-tokenizer php83-xml php83-zip php83-xmlreader php83-xmlwriter && \
wget -O /usr/local/bin/composer https://getcomposer.org/download/2.5.8/composer.phar && \
chmod +x /usr/local/bin/composer && \
wget -O - https://github.com/glpi-project/glpi/releases/download/${GLPI_VERSION}/glpi-${GLPI_VERSION}.tgz | tar xz -C /var/www
# GLPI 10.x will work only with PHP up to 8.3.
# do not trust README.md from glpi github (it says it works with 8.4, but it dies if >=8.4.0)
# this are needed if you want to manually install GLPI from git
# RUN \
# apk add patch npm gettext
COPY rootfs /
# config test
RUN nginx -t
HEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1:80/fpm-ping
ENTRYPOINT [ "/bin/sh", "/start.sh" ]

View File

@@ -0,0 +1,2 @@
# min hour day month weekday command
* * * * * /usr/bin/php /var/www/glpi/front/cron.php

View File

@@ -1,6 +1,8 @@
session.cookie_httponly = on session.cookie_httponly = on
memory_limit = 256M memory_limit = 512M
file_uploads = on file_uploads = on
max_execution_time = 600 max_execution_time = 600
session.auto_start = off session.auto_start = off
session.use_trans_sid = 0 session.use_trans_sid = 0
expose_php = Off
opcache.memory_consumption = 256

View File

@@ -1,13 +1,16 @@
#!/bin/sh #!/bin/sh
INSTALL_OK=${INSTALL_OK:-0}
chown -R nginx:www-data /logs /config /files /marketplace chown -R nginx:www-data /logs /config /files /marketplace
chmod -R a-x,a=rX,ug+w /logs /config /files /marketplace chmod -R a-x,a=rX,ug+w /logs /config /files /marketplace
if [ "$INSTALL_OK" = "1" ] ; then if [ "${INSTALL_OK}" = "1" ] ; then
if [ -f /var/www/glpi/install/install.php ] ; then if [ -f /var/www/glpi/install/install.php ] ; then
rm /var/www/glpi/install/install.php rm /var/www/glpi/install/install.php
fi fi
fi fi
/usr/sbin/crond -b
/usr/sbin/php-fpm* /usr/sbin/php-fpm*
/usr/sbin/nginx /usr/sbin/nginx