Files
algo/roles/privacy/templates/kern-logrotate.j2
T
cddb5df395 Add comprehensive pre-commit hooks for code quality (#14831)
* Add comprehensive pre-commit hooks for code quality

- Set up pre-commit framework with hooks for Python, YAML, Ansible, and shell
- Configure ruff for Python linting and formatting
- Add yamllint for YAML validation
- Include ansible-lint and syntax checks
- Add shellcheck for shell scripts
- Create development documentation
- Auto-fix trailing whitespace and file endings

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Remove redundant DEVELOPMENT.md and update CONTRIBUTING.md

- Removed docs/DEVELOPMENT.md as it was redundant with existing documentation
- Added pre-commit hooks setup instruction to CONTRIBUTING.md for contributors
- Consolidated development guidance into a single location

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-15 10:03:46 -04:00

38 lines
1.0 KiB
Django/Jinja

# Privacy-enhanced kernel log rotation
# Reduces retention time for kernel logs that may contain VPN traces
# Generated by Algo VPN privacy role
/var/log/kern.log
{
# Aggressive rotation for kernel logs
rotate {{ privacy_log_rotation.rotate_count }}
maxage {{ privacy_log_rotation.max_age }}
size {{ privacy_log_rotation.max_size }}M
daily
missingok
notifempty
compress
delaycompress
create 0640 syslog adm
copytruncate
# Pre-rotation script to filter VPN-related entries
prerotate
# Create filtered version excluding VPN traces
if [ -f /var/log/kern.log ]; then
grep -v -E "(wireguard|ipsec|strongswan|xl2tpd)" /var/log/kern.log > /tmp/kern.log.filtered || true
if [ -s /tmp/kern.log.filtered ]; then
mv /tmp/kern.log.filtered /var/log/kern.log
fi
fi
endscript
postrotate
if [ -f /var/run/rsyslogd.pid ]; then
kill -HUP `cat /var/run/rsyslogd.pid`
fi
endscript
}