Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
0692319fbd
|
|||
|
0f89e98902
|
|||
|
541641f90c
|
|||
|
fb1c25a18f
|
|||
|
72b67b640d
|
|||
|
8c786b4594
|
|||
|
cbc162e79c
|
|||
|
4c0d5f6ef9
|
|||
|
8473b553f8
|
|||
|
c3e2fab933
|
|||
|
e7d24d8843
|
|||
|
e6b98211c9
|
@@ -1,6 +0,0 @@
|
|||||||
db/
|
|
||||||
glpi/
|
|
||||||
docker-compose.yaml
|
|
||||||
.drone.yaml
|
|
||||||
.env
|
|
||||||
.gitignore
|
|
||||||
25
.drone.star
25
.drone.star
@@ -1,19 +1,20 @@
|
|||||||
def main(ctx):
|
def main(ctx):
|
||||||
archs = ["amd64", "arm64"] ## arm
|
archs = ["amd64", "arm64"] ## arm
|
||||||
glpi_version = "10.0.9"
|
glpi_version = "10.0.11"
|
||||||
|
alpine_version = "3.19"
|
||||||
|
|
||||||
out = []
|
out = []
|
||||||
for arch in archs:
|
for arch in archs:
|
||||||
out += onpush(ctx, glpi_version, arch)
|
out += onpush(ctx, glpi_version, alpine_version, arch)
|
||||||
|
|
||||||
for arch in archs:
|
for arch in archs:
|
||||||
out += build_publish(ctx, glpi_version, arch)
|
out += build_publish(ctx, glpi_version, alpine_version, arch)
|
||||||
|
|
||||||
out += manifest_publish(ctx, glpi_version, archs)
|
out += manifest_publish(ctx, glpi_version, archs)
|
||||||
|
|
||||||
return out
|
return out
|
||||||
|
|
||||||
def onpush(ctx, glpi_version, arch):
|
def onpush(ctx, glpi_version, alpine_version, arch):
|
||||||
return [{
|
return [{
|
||||||
"kind": "pipeline",
|
"kind": "pipeline",
|
||||||
"type": "docker",
|
"type": "docker",
|
||||||
@@ -26,12 +27,13 @@ def onpush(ctx, glpi_version, arch):
|
|||||||
"name": "build_on_push",
|
"name": "build_on_push",
|
||||||
"image": "plugins/docker:linux-%s" % (arch),
|
"image": "plugins/docker:linux-%s" % (arch),
|
||||||
"settings": {
|
"settings": {
|
||||||
"context": ".",
|
"context": "src",
|
||||||
"dockerfile": "./Dockerfile",
|
"dockerfile": "src/Dockerfile",
|
||||||
"dry_run": True,
|
"dry_run": True,
|
||||||
"repo": "docker.asperti.com/paspo/glpi",
|
"repo": "docker.asperti.com/paspo/glpi",
|
||||||
"build_args": [
|
"build_args": [
|
||||||
"GLPI_VERSION=%s" % (glpi_version)
|
"GLPI_VERSION=%s" % (glpi_version),
|
||||||
|
"ALPINE_VERSION=%s" % (alpine_version)
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
@@ -40,7 +42,7 @@ def onpush(ctx, glpi_version, arch):
|
|||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def build_publish(ctx, glpi_version, arch):
|
def build_publish(ctx, glpi_version, alpine_version, arch):
|
||||||
major = glpi_version.partition(".")[0];
|
major = glpi_version.partition(".")[0];
|
||||||
return [{
|
return [{
|
||||||
"kind": "pipeline",
|
"kind": "pipeline",
|
||||||
@@ -54,10 +56,11 @@ def build_publish(ctx, glpi_version, arch):
|
|||||||
"name": "build_on_push",
|
"name": "build_on_push",
|
||||||
"image": "plugins/docker:linux-%s" % (arch),
|
"image": "plugins/docker:linux-%s" % (arch),
|
||||||
"settings": {
|
"settings": {
|
||||||
"context": ".",
|
"context": "src",
|
||||||
"dockerfile": "./Dockerfile",
|
"dockerfile": "src/Dockerfile",
|
||||||
"build_args": [
|
"build_args": [
|
||||||
"GLPI_VERSION=%s" % (glpi_version)
|
"GLPI_VERSION=%s" % (glpi_version),
|
||||||
|
"ALPINE_VERSION=%s" % (alpine_version)
|
||||||
],
|
],
|
||||||
"username": {
|
"username": {
|
||||||
"from_secret": "docker_username",
|
"from_secret": "docker_username",
|
||||||
|
|||||||
29
.gitea/workflows/vulnscan.yaml
Normal file
29
.gitea/workflows/vulnscan.yaml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
name: Vulnerability Scan
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 14 * * *"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
scan:
|
||||||
|
name: Daily Vulnerability Scan
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: catthehacker/ubuntu:act-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Pull docker image
|
||||||
|
run: docker pull docker.asperti.com/paspo/glpi:latest
|
||||||
|
|
||||||
|
- name: Run Trivy vulnerability scanner
|
||||||
|
id: scan
|
||||||
|
uses: aquasecurity/trivy-action@master
|
||||||
|
with:
|
||||||
|
image-ref: "docker.asperti.com/paspo/glpi:latest"
|
||||||
|
format: "json"
|
||||||
|
output: "trivy-results.json"
|
||||||
|
|
||||||
|
# if some vulnerability is found, we fail
|
||||||
|
- name: check output
|
||||||
|
run: if [ $(jq '.Results[0].Vulnerabilities|length' trivy-results.json) -ne "0" ] ; then exit 1 ; fi
|
||||||
10
README.md
10
README.md
@@ -7,8 +7,8 @@ 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
|
||||||
@@ -20,3 +20,9 @@ see [docker-compose.yaml](docker-compose.yaml)
|
|||||||
```sh
|
```sh
|
||||||
drone starlark --format --stdout
|
drone starlark --format --stdout
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## run vulnscan locally
|
||||||
|
|
||||||
|
```bash
|
||||||
|
act -W .gitea/workflows/vulnscan.yaml -j scan
|
||||||
|
```
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
FROM alpine:3.18
|
ARG ALPINE_VERSION
|
||||||
|
FROM alpine:${ALPINE_VERSION}
|
||||||
ARG GLPI_VERSION
|
ARG GLPI_VERSION
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
mkdir -p /logs /config /files /marketplace && \
|
mkdir -p /logs /config /files /marketplace && \
|
||||||
apk -U upgrade && \
|
apk -U upgrade && \
|
||||||
apk add curl nginx php82 php82-bz2 php82-ctype php82-curl php82-dom php82-exif \
|
apk add --no-cache 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-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-opcache php82-openssl php82-pecl-apcu php82-pecl-redis php82-phar php82-session \
|
||||||
php82-simplexml php82-sodium php82-tokenizer php82-xml php82-zip php82-xmlreader php82-xmlwriter && \
|
php82-simplexml php82-sodium php82-tokenizer php82-xml php82-zip php82-xmlreader php82-xmlwriter && \
|
||||||
wget -O /usr/local/bin/composer https://getcomposer.org/download/2.5.8/composer.phar && \
|
wget -O /usr/local/bin/composer https://getcomposer.org/download/2.5.8/composer.phar && \
|
||||||
chmod +x /usr/local/bin/composer && \
|
chmod +x /usr/local/bin/composer && \
|
||||||
ln -s /usr/bin/php82 /usr/bin/php && \
|
|
||||||
wget -O - https://github.com/glpi-project/glpi/releases/download/${GLPI_VERSION}/glpi-${GLPI_VERSION}.tgz | tar xz -C /var/www
|
wget -O - https://github.com/glpi-project/glpi/releases/download/${GLPI_VERSION}/glpi-${GLPI_VERSION}.tgz | tar xz -C /var/www
|
||||||
|
|
||||||
# this are needed if you want to manually install GLPI from git
|
# this are needed if you want to manually install GLPI from git
|
||||||
2
src/rootfs/etc/crontabs/nginx
Normal file
2
src/rootfs/etc/crontabs/nginx
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# min hour day month weekday command
|
||||||
|
* * * * * /usr/bin/php /var/www/glpi/front/cron.php
|
||||||
@@ -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
|
||||||
@@ -9,5 +9,6 @@ if [ "$INSTALL_OK" = "1" ] ; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
/usr/sbin/crond -b
|
||||||
/usr/sbin/php-fpm*
|
/usr/sbin/php-fpm*
|
||||||
/usr/sbin/nginx
|
/usr/sbin/nginx
|
||||||
Reference in New Issue
Block a user