14 Commits

Author SHA1 Message Date
f7603b0f26 .gitea/workflows/create_and_push_multiarch_container.yml aktualisiert
All checks were successful
build-image / release-image (push) Successful in 6m42s
build-image / telegram-notify (push) Successful in 2s
2026-03-20 19:22:15 +01:00
62b2c54f03 build on tag
Some checks failed
trivy-scan-image / trivy_image_scan (push) Failing after 32s
trivy-scan-image / telegram-notify (push) Successful in 2s
build-image / release-image (push) Successful in 7m36s
2026-03-13 19:37:32 +01:00
95fa832a67 add telegram_bot
All checks were successful
trivy-scan-image / trivy_image_scan (push) Successful in 42s
trivy-scan-image / telegram-notify (push) Successful in 2s
2026-02-22 20:24:53 +01:00
cb460ef18d add telegram_bot 2026-02-22 20:19:16 +01:00
7f54789e0c add telegram_bot 2026-02-22 18:17:46 +01:00
20bda0cbd5 Custom-Name for Job
All checks were successful
trivy-scan-image / trivy_image_scan (push) Successful in 40s
2026-02-15 13:43:09 +01:00
7560904223 Custom-Name for Job 2026-02-15 13:12:21 +01:00
805db14672 Custom-Name for Job 2026-02-15 13:10:35 +01:00
6cb3fc1ebb Custom-Name for Job 2026-02-15 13:07:34 +01:00
62b59d3c52 Custom-Name for Job 2026-02-15 13:05:25 +01:00
e2b2c5e89c trivy_image_scan.yml for all 4 build-plattforms 2026-02-15 12:42:36 +01:00
c6a5c83321 add pull image to trivy_image_scan.yml 2026-02-15 11:31:59 +01:00
246dd03eec add pull image to trivy_image_scan.yml 2026-02-15 11:24:33 +01:00
5053791991 add apt upgrade to Dockerfile
Some checks failed
trivy-scan-image / trivy_image_scan (push) Failing after 30s
2026-02-04 23:20:37 +01:00
3 changed files with 99 additions and 13 deletions

View File

@@ -1,13 +1,10 @@
name: build-image
run-name: build and push Docker-Image
run-name: build and push Docker-Image with tag:${{ github.ref_name }}
on:
workflow_dispatch: # Manuelles Auslösen des Workflows
inputs:
image_tag:
description: '2. Tag für das Docker-Image (außer latest) (z.B. v1.0.0)'
required: true
default: '1.6.0'
push:
tags:
- "*"
env:
image_name_gitea: flask-qr
@@ -56,10 +53,37 @@ jobs:
docker buildx build \
--file ./Dockerfile \
--platform linux/amd64,linux/386,linux/arm64,linux/arm/v7 \
--tag ${{ env.registry_gitea }}/${{ env.user }}/${{ env.image_name_gitea }}:${{ github.event.inputs.image_tag }} \
--tag ${{ env.registry_github }}/${{ env.user }}/${{ env.image_name_github }}:${{ github.event.inputs.image_tag }} \
--tag ${{ env.user }}/${{ env.image_name_dockerhub }}:${{ github.event.inputs.image_tag }} \
--tag ${{ env.registry_gitea }}/${{ env.user }}/${{ env.image_name_gitea }}:${{ github.ref_name }} \
--tag ${{ env.registry_github }}/${{ env.user }}/${{ env.image_name_github }}:${{ github.ref_name }} \
--tag ${{ env.user }}/${{ env.image_name_dockerhub }}:${{ github.ref_name }} \
--tag ${{ env.registry_gitea }}/${{ env.user }}/${{ env.image_name_gitea }}:latest \
--tag ${{ env.registry_github }}/${{ env.user }}/${{ env.image_name_github }}:latest \
--tag ${{ env.user }}/${{ env.image_name_dockerhub }}:latest \
--push ./
telegram-notify:
needs: release-image
if: always()
runs-on: ubuntu-latest
steps:
- name: Telegram Alert
run: |
case "${{ needs.release-image.result }}" in
"success") EMOJI="✅"; MSG="OK" ;;
"failure") EMOJI="❌"; MSG="WARN!" ;;
"cancelled") EMOJI="⏹️"; MSG="Canceled" ;;
*) EMOJI="❓"; MSG="Unknown-State: ${{ needs.release-image.result }}" ;;
esac
curl -s -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
-H 'Content-Type: application/json' \
-d "{
\"chat_id\": \"${{ secrets.TELEGRAM_CHAT_ID }}\",
\"parse_mode\": \"HTML\",
\"text\":
\"$EMOJI <b>$MSG - Build ${{ env.image_name_gitea }}:${{ github.ref_name }}</b>
<i>$(date +"%Y-%m-%d %T")</i>
Build of Image: <b><i>${{ env.image_name_gitea }}:${{ github.ref_name }}</i></b>
${{ gitea.server_url }}/${{ gitea.repository }}
\"
}"

View File

@@ -1,5 +1,5 @@
name: trivy-scan-image
run-name: Trivy - Scan Docker Image
run-name: Trivy - Scan Docker Image ${{ env.image_tag }}
on:
workflow_dispatch: # Manuelles Auslösen des Workflows
@@ -22,13 +22,74 @@ jobs:
runs-on: ubuntu-latest
container: aquasec/trivy:latest
steps:
- name: Scan image with trivy
- name: Scan linux/amd64-image
run: |
trivy image \
--username ${{ env.user }} \
--password ${{ secrets.DOCKER_PULL_TOKEN }} \
--exit-code 1 \
--scanners vuln,misconfig,secret \
--severity MEDIUM,HIGH,CRITICAL \
--severity HIGH,CRITICAL \
--ignore-unfixed \
--platform linux/amd64 \
${{ env.registry_gitea }}/${{ env.user }}/${{ env.image_name_gitea }}:${{ env.image_tag }}
- name: Scan linux/386-image
run: |
trivy image \
--username ${{ env.user }} \
--password ${{ secrets.DOCKER_PULL_TOKEN }} \
--exit-code 1 \
--scanners vuln,misconfig,secret \
--severity HIGH,CRITICAL \
--ignore-unfixed \
--platform linux/386 \
${{ env.registry_gitea }}/${{ env.user }}/${{ env.image_name_gitea }}:${{ env.image_tag }}
- name: Scan linux/arm64-image
run: |
trivy image \
--username ${{ env.user }} \
--password ${{ secrets.DOCKER_PULL_TOKEN }} \
--exit-code 1 \
--scanners vuln,misconfig,secret \
--severity HIGH,CRITICAL \
--ignore-unfixed \
--platform linux/arm64 \
${{ env.registry_gitea }}/${{ env.user }}/${{ env.image_name_gitea }}:${{ env.image_tag }}
- name: Scan linux/arm/v7-image
run: |
trivy image \
--username ${{ env.user }} \
--password ${{ secrets.DOCKER_PULL_TOKEN }} \
--exit-code 1 \
--scanners vuln,misconfig,secret \
--severity HIGH,CRITICAL \
--ignore-unfixed \
--platform linux/arm/v7 \
${{ env.registry_gitea }}/${{ env.user }}/${{ env.image_name_gitea }}:${{ env.image_tag }}
telegram-notify:
needs: trivy_image_scan
if: always()
runs-on: ubuntu-latest
steps:
- name: Telegram Alert
run: |
case "${{ needs.trivy_image_scan.result }}" in
"success") EMOJI="✅"; MSG="OK" ;;
"failure") EMOJI="❌"; MSG="WARN!" ;;
"cancelled") EMOJI="⏹️"; MSG="Canceled" ;;
*) EMOJI="❓"; MSG="Unknown-State: ${{ needs.trivy_image_scan.result }}" ;;
esac
curl -s -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
-H 'Content-Type: application/json' \
-d "{
\"chat_id\": \"${{ secrets.TELEGRAM_CHAT_ID }}\",
\"parse_mode\": \"HTML\",
\"text\":
\"$EMOJI <b>$MSG - Scan ${{ env.image_name_gitea }}:${{ env.image_tag }}</b>
<i>$(date +"%Y-%m-%d %T")</i>
Trivy-Image-Scan of: <b><i>${{ env.image_name_gitea }}:${{ env.image_tag }}</i></b>
${{ gitea.server_url }}/${{ gitea.repository }}
\"
}"

View File

@@ -9,6 +9,7 @@ ENV PYTHONUNBUFFERED=1
ENV HTTP_METHOD=POST
RUN apt-get update && \
apt-get upgrade -y &&\
if [ "$TARGETPLATFORM" = "linux/arm/v7" ] || [ "$TARGETPLATFORM" = "linux/386" ]; then \
apt-get install -y --no-install-recommends zlib1g-dev libjpeg-dev gcc; \
fi && \