Skip to content

feat: external monitoring mode + CI/CD pipeline#2

Open
ViktorPalchynskyi wants to merge 11 commits intomasterfrom
dev
Open

feat: external monitoring mode + CI/CD pipeline#2
ViktorPalchynskyi wants to merge 11 commits intomasterfrom
dev

Conversation

@ViktorPalchynskyi
Copy link
Contributor

@ViktorPalchynskyi ViktorPalchynskyi commented Feb 17, 2026

Summary

  • Add external monitoring mode (connect Promtail to provider's Loki instead of deploying local stack)
  • Add exportable Grafana dashboard (15 panels: nginx metrics, CrowdSec IPS, Loki logs)
  • Add GitHub Actions CI/CD pipeline (build, test, push to Docker Hub)

Test plan

  • Standalone monitoring mode tested (all services UP)
  • External monitoring mode tested (Loki not started, Promtail sends to external Loki)
  • Grafana dashboard imported and verified (15 panels, data from Prometheus + Loki)
  • Security tests: 32/32 passed
  • False positive tests: 23/23 passed
  • Docker Hub push tested (viktorpalchynskyi/nginx-security:latest)

Note

Medium Risk
Moderate risk due to new CI/CD publishing workflow and changes to monitoring compose profiles/env expansion that could affect deployments, but core proxy/WAF runtime logic is untouched.

Overview
Adds an external monitoring mode so Promtail can ship logs to a user-provided LOKI_URL (optionally LOKI_TENANT_ID) while docker-compose.monitoring.yml no longer requires running local loki/grafana containers (now gated behind a standalone profile). The Makefile, .env.example, and README.md are updated to support start-monitoring-external and separate health checks for standalone vs external setups.

Introduces a pre-built Grafana dashboard export (monitoring/dashboards/nginx-security.json + README) and adds GitHub Actions workflows: verify.yml builds the image and runs the existing security/false-positive test scripts in a throwaway Docker network, and publish.yml builds/pushes multi-arch images to Docker Hub on master/tags with standard metadata tagging.

Written by Cursor Bugbot for commit 07ee6c1. This will update automatically on new commits. Configure here.

Comment on lines 61 to 90
- name: Login to Docker Hub
if: github.event_name == 'push'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Docker metadata
if: github.event_name == 'push'
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha,prefix=sha-
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}

- name: Build and push
if: github.event_name == 'push'
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This job will push new image on every PR. This image is open source, so anyone can create PR and push image. Let's split it on 2 separate jobs:

  • verify.yaml - that will perform testing and verification on PR and push to master
  • publish.yaml - that will publish image on push to master and release

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add proper instructions how to start this using only image from docker hub. Specifically it should have:

  • List of all enviroment variables that should be provided
  • List of all volumes with configs with examples that should be provided
  • Explanation how to ingrate with grafana

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Copy link
Contributor

@LeoVS09 LeoVS09 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, I added secrets to github actions. You can merge after fixing issues

Comment on lines +8 to +9
env:
IMAGE_NAME: viktorpalchynskyi/nginx-security
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I set it through enviroment, so you need to remove

Comment on lines +12 to +13
publish:
runs-on: ubuntu-latest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add there enviroment, in order to get limited secrets

Suggested change
publish:
runs-on: ubuntu-latest
publish:
environment: Production
runs-on: ubuntu-latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments