mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-07 13:19:07 -05:00
[PR #2873] (fix): Added a logrotate function to the crowdsec.go installer file #5142
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fosrl/pangolin/pull/2873
Author: @sidd190
Created: 4/19/2026
Status: 🔄 Open
Base:
dev← Head:fix/crowdsec-traefik-logrotate📝 Commits (2)
2c8b7b5(fix): Added a logrotate function to the crowdsec.go installer file473bce8Pass installdir as a parameter📊 Changes
2 files changed (+71 additions, -2 deletions)
View changed files
📝
install/crowdsec.go(+70 -1)📝
install/main.go(+1 -1)📄 Description
Add logrotate config for Traefik access logs when CrowdSec is installed
Fixes #2644
Documentation Update : https://github.com/fosrl/docs-v2/pull/98
What and why
The default Pangolin install does not enable Traefik access logging.
When CrowdSec is selected during installation, the installer enables Traefik access logs (required for CrowdSec to detect threats).
These logs are written to:
config/traefik/logs/access.log(on the host)Without log rotation, this file grows indefinitely, which is the issue reported in #2644.
This change fixes the problem only in the CrowdSec installation path, keeping the default install unaffected.
What changed
File modified:
install/crowdsec.gosetupTraefikLogRotate()installCrowdsec()immediately after the directoryconfig/traefik/logs/is created./etc/logrotate.d/pangolin-traefikusing the absolute path to the access log (resolved from the install directory).Logrotate configuration written:
If the installer is not running as root, it skips writing the file and instead prints the full configuration to stdout (with the actual resolved path), allowing the user to set it up manually.
Testing
The generated config was validated directly with
logrotate:Observed behavior:
No changes were made to the default (non-CrowdSec) installation path as suggested by @oschwartz10612.
PS : Can someone please go through this comment and verify if a follow up PR like this is required where we are dropping the unused fields from crowdsec installation?
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.