Skip to content

Conversation

@DaMandal0rian
Copy link
Contributor

@DaMandal0rian DaMandal0rian commented Mar 5, 2025

PR Type

  • Enhancement

Description

  • Add authentication middleware configuration for Loki.

  • Configure basic auth using a usersfile.

  • Mount auth file for Traefik service.


Changes walkthrough 📝

Relevant files
Enhancement
docker-compose.yml
Configure Loki service authentication middleware.               

logging/grafana-loki/docker-compose.yml

  • Added middleware line:
    traefik.http.routers.loki.middlewares=loki-auth.
  • Configured basic auth with usersfile at /etc/traefik/loki-auth.txt.
  • +2/-0     
    docker-compose.yml
    Mount authentication file in Traefik container.                   

    logging/traefik/docker-compose.yml

  • Added volume mount for the loki-auth file at
    /etc/traefik/loki-auth.txt.
  • +1/-0     

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @github-actions
    Copy link

    github-actions bot commented Mar 5, 2025

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Middleware Config

    Ensure that the new basic auth middleware settings integrate seamlessly with existing routing configurations.

    - traefik.http.routers.loki.middlewares=loki-auth
    - traefik.http.middlewares.loki-auth.basicauth.usersfile=/etc/traefik/loki-auth.txt
    Volume Mount Consistency

    Verify that the auth file mount path is correct and consistently used across services.

    - /root/loki/conf/loki-auth.txt:/etc/traefik/loki-auth.txt:ro

    @github-actions
    Copy link

    github-actions bot commented Mar 5, 2025

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    @DaMandal0rian DaMandal0rian requested a review from clostao March 14, 2025 14:45
    @DaMandal0rian DaMandal0rian merged commit 49a58d5 into main Mar 15, 2025
    1 check passed
    @DaMandal0rian DaMandal0rian deleted the feat/loki-auth branch March 15, 2025 10:25
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    3 participants