mirror of
https://github.com/m1ngsama/automa.git
synced 2026-02-08 06:24:05 +00:00
- Add QUICKSTART.md for 5-minute setup guide - Add CHEATSHEET.md for quick command reference - Add OPTIMIZATION_SUMMARY.md with complete architecture overview - Add detailed architecture documentation in docs/ - ARCHITECTURE.md: System design and component details - IMPLEMENTATION.md: Step-by-step implementation guide - architecture-recommendations.md: Component selection rationale - Add .env.example template for configuration Following KISS principles and Unix philosophy for self-hosted IaC platform.
5.3 KiB
5.3 KiB
Automa Cheat Sheet
Quick reference for common operations.
Setup
# Initial setup
cp .env.example .env && vim .env
make network-create
make up
# Verify
make status && docker ps
Daily Operations
# Status
make status # All services
make infra-status # Infrastructure only
docker ps # All containers
# Logs
docker logs -f automa-caddy
make minecraft-logs
make nextcloud-logs
# Restart service
cd infrastructure/monitoring
docker compose restart grafana
Service Management
# Start/Stop
make up # Everything
make down # Everything
make infra-up # Infrastructure only
make all-up # Services only
# Individual services
make minecraft-up
make teamspeak-up
make nextcloud-up
Backup & Restore
# Backup
make backup # All services
make backup-list # List backups
make backup-cleanup # Remove old (>7d)
# Restore (example)
cd backups/nextcloud/20250119-150000
tar -xzf nextcloud_data.tar.gz -C /target/path
Monitoring
# Dashboards
https://grafana.example.com
# Import dashboards
# 11074 - Node Exporter
# 193 - Docker
# 12486 - Loki
# Prometheus
http://localhost:9090
# Check targets
http://localhost:9090/targets
Updates
# Auto (Watchtower runs daily)
docker logs automa-watchtower
# Manual
cd infrastructure/monitoring
docker compose pull
docker compose up -d
Troubleshooting
# Check logs
docker logs <container>
# Test config
docker compose config
# Restart
docker compose restart <service>
# Reset (⚠️ deletes data)
docker compose down -v
docker compose up -d
# Check health
make health
# Check networks
docker network ls | grep automa
docker network inspect automa-proxy
# Disk space
df -h
docker system df
docker system prune -a
Firewall
# Status
sudo ufw status
# Allow port
sudo ufw allow 8080/tcp
# Deny port
sudo ufw deny 8080/tcp
# Reload
sudo ufw reload
Fail2ban
# Status
docker exec automa-fail2ban fail2ban-client status
# Unban IP
docker exec automa-fail2ban fail2ban-client set <jail> unbanip <ip>
# Check jail
docker exec automa-fail2ban fail2ban-client status sshd
URLs
External:
- Nextcloud: https://cloud.example.com
- Grafana: https://grafana.example.com
- Minecraft: example.com:25565
- TeamSpeak: example.com:9987
Internal (localhost):
- Prometheus: http://localhost:9090
- Duplicati: http://localhost:8200
- cAdvisor: http://localhost:8080
Common Issues
Container won't start:
docker logs <container>
docker compose config
Service unreachable:
curl -I http://localhost:PORT
sudo ufw status
dig example.com
Disk full:
df -h
docker system prune -a
make backup-cleanup
Grafana no data:
# Check Prometheus targets
http://localhost:9090/targets
# Check Grafana datasources
https://grafana.example.com/datasources
Quick Fixes
# Restart everything
make down && make up
# Recreate networks
make network-remove
make network-create
# Clean Docker
docker system prune -a -f
docker volume prune -f
# Reset Grafana password
docker exec -it automa-grafana grafana-cli admin reset-admin-password newpassword
Performance Tuning
# Limit container memory
# Add to compose.yml:
deploy:
resources:
limits:
memory: 512M
# Adjust Prometheus retention
# In prometheus.yml command:
--storage.tsdb.retention.time=15d
# Adjust Loki retention
# In loki-config.yml:
retention_period: 15d
Security
# Change passwords
vim .env
# Review exposed ports
docker ps
# Check Fail2ban
docker logs automa-fail2ban
# Review firewall
sudo ufw status numbered
Backups
Local (automatic):
- Path:
./backups/ - Retention: 7 days
- Cleanup:
make backup-cleanup
Remote (Duplicati):
- UI: http://localhost:8200
- Schedule: Daily 3 AM
- Retention: 30 days
Test restore monthly!
Maintenance Schedule
Daily:
- Check
make status
Weekly:
- Review logs
- Check backups exist
- Review Grafana dashboards
Monthly:
- Test backup restore
- Update services
- Clean old data
- Review alerts
Quarterly:
- Security audit
- Performance tuning
- Documentation update
Emergency Procedures
Service down:
- Check logs:
docker logs <container> - Restart:
docker compose restart - Check health:
make health
Data loss:
- Stop service
- Restore from backup
- Verify data
- Start service
Server failure:
- New server setup
- Install Docker
- Clone repo
- Restore backups
- Update DNS
- Deploy:
make up
Important Files
.env # Secrets (git-ignored)
Makefile # All commands
config.sh # Shared config
infrastructure/ # Infrastructure services
services/ # Application services
backups/ # Local backups
docs/ # Documentation
Getting Help
- Check logs:
docker logs <container> - Read docs:
docs/folder - Check README.md
- Search issues on GitHub
- Ask community: r/selfhosted
Pro Tips
- Use
docker compose up(no-d) to see logs - Always backup before updates
- Pin image versions
- Set resource limits
- Monitor disk space
- Review logs weekly
- Test restore monthly
- Keep docs updated
Remember: KISS - Keep It Simple, Stupid