Lager Guru - Maintenance Checklist β
Regular tasks for maintenance and optimization of the Lager Guru application.
Choose Language: π©πͺ Deutsch | π¬π§ English | π§π¬ ΠΡΠ»Π³Π°ΡΡΠΊΠΈ
Table of Contents β
- Daily Tasks
- Weekly Tasks
- Monthly Tasks
- Quarterly Tasks
- Annual Tasks
- Security Updates
- Dependency Upgrades
- Database Maintenance
- Log Rotation
- Backup Verification
Daily Tasks β
β Health Check β
- [ ] Check health endpoint:
http://lager-guru.internal/health.html - [ ] Check Docker containers:
docker compose ps - [ ] Check critical logs:
docker compose logs --tail=50
β Monitoring β
- [ ] Check Supabase dashboard for errors
- [ ] Check application metrics (if monitoring tool exists)
- [ ] Check disk space:
df -h
Automation:
bash
# Cron job for daily health check
0 9 * * * curl -f http://lager-guru.internal/health.html || echo "Health check failed" | mail -s "Lager Guru Alert" admin@company.comWeekly Tasks β
β Security Audit Review β
bash
# Check GitHub Dependabot PRs
gh pr list --label "dependencies"
# Check npm audit
npm audit --audit-level=moderate
# Check security advisories
npm audit --json | jq '.vulnerabilities'- [ ] Review Dependabot pull requests
- [ ] Apply critical security patches
- [ ] Document security updates
β Backup Integrity β
bash
# Check last backup
ls -lh backups/lager-guru/ | tail -1
# Test restore (optional, in test environment)
# pg_restore --list backups/lager-guru/lager-guru-YYYYMMDD_HHMMSS.dump- [ ] Check if last backup was successful
- [ ] Check backup file size (should not be 0 bytes)
- [ ] Check backup retention policy
β Application Logs Review β
bash
# Check logs for errors
docker compose logs --since 7d | grep -i error | wc -l
# Check logs for warnings
docker compose logs --since 7d | grep -i warning | wc -l- [ ] Review error logs from last week
- [ ] Check for unusual patterns
- [ ] Document problems and solutions
β Performance Monitoring β
- [ ] Check response times
- [ ] Check database query performance
- [ ] Check memory usage:
docker stats --no-stream
Monthly Tasks β
β Dependency Updates β
Automatic (Dependabot):
- [ ] Review and merge Dependabot PRs
- [ ] Test in development environment before production
- [ ] Document breaking changes
Manual Checks:
bash
# Check for outdated packages
npm outdated
# Check for major version updates
npm outdated | grep -E "MAJOR|WANTED"
# Update package.json (if needed)
npm update- [ ] Check for major version updates
- [ ] Review changelogs for breaking changes
- [ ] Plan upgrade path for major versions
β Database Maintenance β
Vacuum and Analyze:
sql
-- Check database size
SELECT pg_size_pretty(pg_database_size('postgres'));
-- Check tables with bloat
SELECT
schemaname, tablename,
pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename)) AS size
FROM pg_tables
WHERE schemaname = 'public'
ORDER BY pg_total_relation_size(schemaname||'.'||tablename) DESC;
-- Vacuum (automatic in Supabase, but can be checked)
VACUUM ANALYZE;
-- Check statistics
ANALYZE;- [ ] Check database size growth
- [ ] Check for table bloat
- [ ] Execute VACUUM ANALYZE (if not automatic)
- [ ] Check index usage
Index Optimization:
sql
-- Check for unused indexes
SELECT
schemaname, tablename, indexname, idx_scan, idx_tup_read, idx_tup_fetch
FROM pg_stat_user_indexes
WHERE idx_scan = 0
ORDER BY pg_relation_size(indexrelid) DESC;
-- Check slow queries (if pg_stat_statements exists)
SELECT query, calls, total_time, mean_time
FROM pg_stat_statements
ORDER BY mean_time DESC
LIMIT 10;β Audit Log Review β
sql
-- Check audit logs for last month
SELECT
changed_by,
table_name,
action,
COUNT(*) as changes,
MAX(changed_at) as last_change
FROM public.audit_log
WHERE changed_at >= NOW() - INTERVAL '1 month'
GROUP BY changed_by, table_name, action
ORDER BY changes DESC;- [ ] Review audit logs for anomalies
- [ ] Check for unauthorized changes
- [ ] Document important changes
- [ ] Archive old audit logs (if necessary)
β Backup Retention β
bash
# Check backup retention
find backups/lager-guru/ -name "*.dump*" -mtime +30 -ls
# Check backup count
ls -1 backups/lager-guru/ | wc -l- [ ] Check backup retention policy
- [ ] Delete old backups (according to retention policy)
- [ ] Archive critical backups (off-site)
Quarterly Tasks β
β Security Updates β
Node.js and Base Images:
bash
# Check Node.js version
node --version
# Check Docker base image versions
docker images | grep node
docker images | grep nginx
# Check for security advisories
npm audit
docker scout cves hashmatrix/lager-guru:latest- [ ] Check for Node.js security updates
- [ ] Update Docker base images (node:18-alpine, nginx:stable-alpine)
- [ ] Check for OS-level vulnerabilities
- [ ] Apply security patches
β Performance Optimization β
Database Performance:
sql
-- Check for missing indexes
EXPLAIN ANALYZE SELECT * FROM public.shipments WHERE driver_id = '...';
-- Check query performance
SELECT
query,
calls,
total_time,
mean_time,
max_time
FROM pg_stat_statements
WHERE mean_time > 100
ORDER BY mean_time DESC
LIMIT 20;- [ ] Review database query performance
- [ ] Optimize slow queries
- [ ] Add indexes where necessary
- [ ] Check for query plan changes
Application Performance:
bash
# Check bundle size
npm run build
du -sh dist/
# Check for large dependencies
npx bundle-phobia [package-name]- [ ] Check bundle size growth
- [ ] Optimize code splitting
- [ ] Remove unused dependencies
- [ ] Check for performance regressions
Annual Tasks β
β Major Version Upgrades β
Node.js:
bash
# Check current version
node --version
# Check LTS schedule
# https://nodejs.org/en/about/releases/- [ ] Plan upgrade to latest LTS
- [ ] Test in development environment
- [ ] Document breaking changes
- [ ] Plan migration window
β Architecture Review β
- [ ] Review application architecture
- [ ] Identify technical debt
- [ ] Plan refactoring initiatives
- [ ] Check alignment with best practices
Security Updates β
Automated Security Scanning β
GitHub Dependabot:
- Automatically checks for vulnerabilities
- Creates PRs for security updates
- Configuration:
.github/dependabot.yml
npm audit:
bash
# Check for vulnerabilities
npm audit
# Fix automatically (if safe)
npm audit fix
# Fix with breaking changes
npm audit fix --force # be careful!Security Patch Priority β
- Critical - Apply immediately
- High - Apply within 1 week
- Moderate - Apply within 1 month
- Low - Apply at next planned update
Dependency Upgrades β
Upgrade Strategy β
Minor/Patch Updates:
- Automatic via Dependabot
- Test in development
- Merge to production
Major Updates:
- Manual review of changelog
- Test in separate branch
- Plan migration window
- Document breaking changes
Upgrade Checklist β
- [ ] Review changelog
- [ ] Check for breaking changes
- [ ] Test in development environment
- [ ] Review code for deprecated APIs
- [ ] Update documentation
- [ ] Deploy to production
- [ ] Monitor for errors
Database Maintenance β
Regular Tasks β
Vacuum:
sql
-- Automatic in Supabase, but settings can be checked
SHOW autovacuum;Analyze:
sql
-- Updates statistics for query planner
ANALYZE public.shipments;
ANALYZE public.zones;
ANALYZE public.profiles;Index Maintenance:
sql
-- Check for unused indexes
SELECT * FROM pg_stat_user_indexes WHERE idx_scan = 0;
-- Rebuild indexes (if necessary)
REINDEX TABLE public.shipments;Log Rotation β
Docker Logs β
bash
# Set up Docker log rotation
# In docker-compose.yml:
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"Application Logs β
Nginx Logs:
bash
# Set up log rotation for Nginx
# /etc/logrotate.d/nginx
/var/log/nginx/*.log {
daily
rotate 7
compress
delaycompress
missingok
notifempty
create 0640 www-data adm
sharedscripts
postrotate
[ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`
endscript
}Backup Verification β
Backup Testing β
bash
# Test backup restore (in test environment)
pg_restore --list backups/lager-guru/lager-guru-YYYYMMDD_HHMMSS.dump
# Check backup integrity
pg_restore --schema-only backups/lager-guru/lager-guru-YYYYMMDD_HHMMSS.dump | head -20Backup Retention β
- Daily backups: Keep last 7 days
- Weekly backups: Keep last 4 weeks
- Monthly backups: Keep last 12 months
- Yearly backups: Keep for 7 years
Last Updated: 2025-11-05