diff --git a/.gitea/workflows/docker.yml b/.gitea/workflows/docker.yml new file mode 100644 index 0000000..05fbdfc --- /dev/null +++ b/.gitea/workflows/docker.yml @@ -0,0 +1,40 @@ +name: Build & Push Docker Image + +on: + push: + branches: + - main + tags: + - "v*" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Log in to Gitea Container Registry + uses: docker/login-action@v3 + with: + registry: git.albert-zangerl.com + username: ${{ gitea.actor }} + password: ${{ secrets.GITEA_TOKEN }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: git.albert-zangerl.com/al/logwatch + tags: | + type=raw,value=latest,enable={{is_default_branch}} + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.gitignore b/.gitignore index 38b9b6d..111aac6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ __pycache__/ *.pyo .env .env.local +stack.env *.log diff --git a/docker-compose.yml b/docker-compose.yml index a545c41..3a22728 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,9 +6,9 @@ services: restart: unless-stopped environment: # ntfy source channel (your Watchtower notifications) - - SOURCE_URL=http://192.168.123.77/albert + - SOURCE_URL=https://ntfy.albert-zangerl.com/albert # ntfy target channel (where important stuff goes) - - TARGET_URL=http://192.168.123.77/wichtig + - TARGET_URL=https://ntfy.albert-zangerl.com/wichtig # optional: Bearer token if target channel needs auth # - TARGET_TOKEN=your-token-here - LOG_LEVEL=INFO diff --git a/portainer-stack.yml b/portainer-stack.yml index c5693ad..d8d3648 100644 --- a/portainer-stack.yml +++ b/portainer-stack.yml @@ -1,11 +1,7 @@ services: logwatch: - image: logwatch:latest + image: git.albert-zangerl.com/al/logwatch:latest container_name: logwatch restart: unless-stopped - environment: - - SOURCE_URL=https://ntfy.albert-zangerl.com/albert - - TARGET_URL=https://ntfy.albert-zangerl.com/wichtig - # - TARGET_TOKEN=your-token-here - - LOG_LEVEL=INFO - - RECONNECT_DELAY=10 + env_file: + - stack.env diff --git a/stack.env.example b/stack.env.example new file mode 100644 index 0000000..d4a5587 --- /dev/null +++ b/stack.env.example @@ -0,0 +1,11 @@ +# ntfy source channel (Watchtower notifications) +SOURCE_URL=https://ntfy.albert-zangerl.com/albert + +# ntfy target channel (important notifications only) +TARGET_URL=https://ntfy.albert-zangerl.com/wichtig + +# Optional: Bearer token for protected ntfy target channel +# TARGET_TOKEN= + +LOG_LEVEL=INFO +RECONNECT_DELAY=10