7 Commits

Author SHA1 Message Date
aa5f6b016b change build-action to build when tag is set
All checks were successful
build-image / release-image (push) Successful in 3m39s
2026-03-13 18:07:21 +01:00
4aac8c502a change build-action to build when tag is set
All checks were successful
build-image / release-image (push) Successful in 3m42s
2026-03-13 18:00:51 +01:00
d449fc3481 add telegram_bot
Some checks failed
trivy-scan-image / trivy_image_scan (push) Failing after 39s
trivy-scan-image / telegram-notify (push) Successful in 2s
2026-02-22 20:57:38 +01:00
d68f660595 add apt-get uppgrade to Dockerfile
Some checks failed
trivy-scan-image / trivy_image_scan (push) Failing after 39s
2026-02-15 14:17:02 +01:00
ac40105449 add triviy-imagge-scan-job for all platforms 2026-02-15 14:13:37 +01:00
49679e8c93 remove unnecessary venv
All checks were successful
trivy-scan-image / trivy_image_scan (push) Successful in 27s
2026-02-04 22:41:28 +01:00
39e65f675b rework build, requirements and pipline
Some checks failed
trivy-scan-image / trivy_image_scan (push) Failing after 35s
2026-01-19 00:04:31 +01:00
3 changed files with 70 additions and 13 deletions

View File

@@ -1,13 +1,10 @@
name: build-image name: build-image
run-name: build and push Docker-Image run-name: build and push Docker-Image :${{ github.ref_name }}
on: on:
workflow_dispatch: # Manuelles Auslösen des Workflows push:
inputs: tags:
image_tag: - "*"
description: '2. Tag für das Docker-Image (z.B. 1.0.0)'
required: true
default: '0.3.0'
env: env:
image_name: doc_rudi image_name: doc_rudi
@@ -16,7 +13,7 @@ env:
jobs: jobs:
release-image: release-image:
runs-on: ubuntu-latest runs-on: build-ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
@@ -42,5 +39,5 @@ jobs:
--file ./Dockerfile \ --file ./Dockerfile \
--platform linux/amd64,linux/386,linux/arm64,linux/arm/v7 \ --platform linux/amd64,linux/386,linux/arm64,linux/arm/v7 \
--tag ${{ env.registry }}/${{ env.user }}/${{ env.image_name }}:latest \ --tag ${{ env.registry }}/${{ env.user }}/${{ env.image_name }}:latest \
--tag ${{ env.registry }}/${{ env.user }}/${{ env.image_name }}:${{ github.event.inputs.image_tag }} \ --tag ${{ env.registry }}/${{ env.user }}/${{ env.image_name }}:${{ github.ref_name }} \
--push ./ --push ./

View File

@@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: aquasec/trivy:latest container: aquasec/trivy:latest
steps: steps:
- name: Scan image with trivy - name: Scan linux/amd64-image
run: | run: |
trivy image \ trivy image \
--username ${{ env.user }} \ --username ${{ env.user }} \
@@ -31,4 +31,65 @@ jobs:
--scanners vuln,misconfig,secret \ --scanners vuln,misconfig,secret \
--severity HIGH,CRITICAL \ --severity HIGH,CRITICAL \
--ignore-unfixed \ --ignore-unfixed \
--platform linux/amd64 \
${{ env.registry_gitea }}/${{ env.user }}/${{ env.image_name }}:${{ env.image_tag }} ${{ env.registry_gitea }}/${{ env.user }}/${{ env.image_name }}:${{ 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 }}:${{ 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 }}:${{ 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 }}:${{ 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 }}:${{ env.image_tag }}</b>
<i>$(date +"%Y-%m-%d %T")</i>
Trivy-Image-Scan of: <b><i>${{ env.image_name }}:${{ env.image_tag }}</i></b>
${{ gitea.server_url }}/${{ gitea.repository }}
\"
}"

View File

@@ -7,10 +7,10 @@ LABEL authors="tebarius"
LABEL description="netdata-DocRudi" LABEL description="netdata-DocRudi"
ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1 ENV PYTHONUNBUFFERED=1
ENV PATH="/rudi-venv/bin:$PATH"
ENV SERVER_PORT=19998 ENV SERVER_PORT=19998
RUN apt-get update && \ RUN apt-get update && \
apt-get upgrade -y && \
if [ "$TARGETPLATFORM" = "linux/arm/v7" ] || [ "$TARGETPLATFORM" = "linux/386" ]; then \ if [ "$TARGETPLATFORM" = "linux/arm/v7" ] || [ "$TARGETPLATFORM" = "linux/386" ]; then \
apt-get install -y --no-install-recommends zlib1g-dev libjpeg-dev gcc; \ apt-get install -y --no-install-recommends zlib1g-dev libjpeg-dev gcc; \
fi && \ fi && \
@@ -21,8 +21,7 @@ WORKDIR /app
COPY ./app /app/ COPY ./app /app/
RUN python -m venv /rudi-venv \ RUN python -m pip install --upgrade pip \
&& python -m pip install --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt \ && pip install --no-cache-dir -r requirements.txt \
&& useradd -m -u 1000 rudi \ && useradd -m -u 1000 rudi \
&& chown -R rudi:rudi /app && chown -R rudi:rudi /app