Automated browser history and cache cleaner with customizable retention policies.
- Multi-browser support: Chrome, Firefox, Safari
- Configurable retention policies: Set rules by domain and date
- Scheduled cleaning: Cron-like syntax for automated execution
- Web dashboard: Monitor and control cleaning operations
- Statistics and reporting: Track cleaned data and performance
- Backup system: Safely backup data before cleaning
- Notifications: Get alerts about cleaning operations
- Docker support: Easy deployment with containers
pip install auto-browser-cleanergit clone https://github.com/yourusername/auto-browser-cleaner.git
cd auto-browser-cleaner
pip install -e .docker pull auto-browser-cleaner:latest
# Or build from source
docker-compose up -d# Initialize configuration
auto-browser-cleaner init
# Run cleaning with default config
auto-browser-cleaner clean
# Clean specific browser
auto-browser-cleaner clean --browser chrome
# Dry run to see what would be cleaned
auto-browser-cleaner clean --dry-run
# Start scheduler daemon
auto-browser-cleaner schedule --daemon
# Launch web dashboard
auto-browser-cleaner dashboard --host 0.0.0.0 --port 8080Create a config.yaml file:
browsers:
chrome:
enabled: true
data_dir: "~/.config/google-chrome"
firefox:
enabled: true
profile_dir: "~/.mozilla/firefox"
safari:
enabled: false
retention:
default_days: 30
rules:
- domain: "example.com"
days: 7
- domain: "*.social.com"
days: 1
- domain: "important-site.com"
days: 365
schedule:
enabled: true
cron: "0 2 * * *" # Daily at 2 AM
logging:
level: INFO
file: "cleaner.log"
notifications:
email:
enabled: false
smtp_server: "smtp.gmail.com"
smtp_port: 587
username: "your-email@gmail.com"
password: "your-app-password"
to: "admin@example.com"
backup:
enabled: true
directory: "./backups"
max_backups: 5
web:
enabled: true
host: "127.0.0.1"
port: 8080
auth:
enabled: false
username: "admin"
password: "secure-password"from auto_browser_cleaner import BrowserCleaner
from auto_browser_cleaner.config import Config
# Load configuration
config = Config.from_file('config.yaml')
# Initialize cleaner
cleaner = BrowserCleaner(config)
# Clean all browsers
results = cleaner.clean_all()
# Clean specific browser
results = cleaner.clean_browser('chrome')from auto_browser_cleaner.retention import RetentionPolicy, Rule
# Create retention policy
policy = RetentionPolicy(default_days=30)
# Add custom rules
policy.add_rule(Rule(domain='*.work.com', days=90))
policy.add_rule(Rule(domain='temp-*.com', days=1))
policy.add_rule(Rule(domain='important.org', days=365))
# Apply policy
cleaner = BrowserCleaner(config, retention_policy=policy)
results = cleaner.clean_all()from auto_browser_cleaner.scheduler import Scheduler
# Create scheduler
scheduler = Scheduler(config)
# Add cleaning job (daily at 2 AM)
scheduler.add_job('0 2 * * *', cleaner.clean_all)
# Start scheduler
scheduler.start()Access the web dashboard at http://localhost:8080 to:
- Monitor cleaning statistics
- Configure retention policies
- Schedule cleaning jobs
- View cleaning history
- Manage backups
# docker-compose.yml
version: '3.8'
services:
auto-browser-cleaner:
image: auto-browser-cleaner:latest
ports:
- "8080:8080"
volumes:
- ./config.yaml:/app/config.yaml
- ./logs:/app/logs
- ./backups:/app/backups
- ~/.config:/root/.config # For Chrome data
- ~/.mozilla:/root/.mozilla # For Firefox data
environment:
- CONFIG_FILE=/app/config.yaml
restart: unless-stoppedThe web interface provides a REST API:
# Get cleaning statistics
curl http://localhost:8080/api/stats
# Trigger cleaning
curl -X POST http://localhost:8080/api/clean
# Get cleaning history
curl http://localhost:8080/api/history
# Update configuration
curl -X PUT http://localhost:8080/api/config \
-H "Content-Type: application/json" \
-d '{"retention": {"default_days": 60}}'| Browser | Platform | Status | Notes |
|---|---|---|---|
| Chrome | Linux, macOS, Windows | ✅ Full | History, cache, cookies |
| Firefox | Linux, macOS, Windows | ✅ Full | History, cache, cookies |
| Safari | macOS | History only (macOS restrictions) |
See config.example.yaml for all available options.
retention.default_days: Default retention periodschedule.cron: Cron expression for automated cleaningbackup.enabled: Enable/disable backup before cleaningnotifications.email: Email notifications configurationweb.enabled: Enable web dashboard
- Backup: Always enable backups before cleaning
- Authentication: Use web authentication in production
- Permissions: Ensure appropriate file system permissions
- HTTPS: Use HTTPS for web dashboard in production
- Secrets: Store sensitive configuration in environment variables
- Permission denied: Ensure the application has read/write access to browser data directories
- Browser not detected: Check browser installation paths in configuration
- Schedule not running: Verify cron syntax and system permissions
- Web dashboard not accessible: Check firewall settings and port availability
# Enable debug logging
auto-browser-cleaner clean --log-level DEBUG
# Run with verbose output
auto-browser-cleaner clean --verboseSee docs/TROUBLESHOOTING.md for detailed troubleshooting guide.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
MIT License - see LICENSE file for details.
- GitHub Issues: Report bugs and feature requests
- Documentation: Comprehensive guides and examples
- Community: Join discussions and get help