Commit graph

4 commits

Author SHA1 Message Date
e1e5019097 feat: add infrastructure management commands to Makefile
Enhance Makefile with infrastructure service management:

**New Commands:**
- `network-create`: Create Docker networks (automa-proxy, automa-monitoring)
- `network-remove`: Remove Docker networks
- `infra-up`: Start all infrastructure services (Caddy, monitoring, etc.)
- `infra-down`: Stop all infrastructure services
- `infra-status`: Check status of infrastructure services
- `up`: Start infrastructure + all application services
- `down`: Stop all services + infrastructure

**Command Structure:**
```
make network-create  # Setup networks first
make infra-up        # Start infrastructure
make all-up          # Start applications
# Or simply: make up  (does all above)
```

**Infrastructure Services Managed:**
1. Caddy (reverse proxy)
2. Monitoring stack (Prometheus, Grafana, Loki, Promtail, cAdvisor)
3. Watchtower (auto-updates)
4. Duplicati (backups)
5. Fail2ban (security)

**Improvements:**
- Hierarchical service management (infra → apps)
- Graceful shutdown order (apps → infra)
- Network prerequisites automatically checked
- Enhanced help text with categorized commands
- Consistent error handling

Follows Unix philosophy: compose simple commands for complex workflows.

Refs: #4
2026-01-19 16:32:29 +08:00
89374de57f feat: centralize configuration and improve Makefile
- Add config.sh with centralized container names and ports
- Update healthcheck.sh to use config variables (avoid hardcoding)
- Add health check targets to Makefile (health, health-*)
- Add backup utility targets to Makefile (backup, backup-*)
- Reorganize Makefile help output by service category
2025-12-14 10:00:00 +08:00
0fe7ed79ad refactor: 重构Minecraft服务器自动化管理方案
## 重构内容

### 新增自动化脚本系统 (scripts/)
- utils.sh: 通用工具库(日志、Docker操作、备份、网络检查)
- setup.sh: 环境初始化脚本(目录结构、权限、配置验证)
- mod-manager.sh: Mods管理(Modrinth下载、更新、清理)
- backup.sh: 备份管理(世界/配置/mods备份、恢复、清理)
- monitor.sh: 服务器监控(状态、资源、玩家、日志分析)

### 增强Makefile集成
新增命令:
- minecraft-status: 服务器状态检查
- minecraft-setup: 环境初始化
- minecraft-mods-*: Mods管理命令
- minecraft-backup-*: 备份管理命令

### 完善文档
- 重写README: 详细的使用指南、故障排查、迁移指南
- 新增CHANGELOG: 完整的重构说明和技术细节

## 架构改进

### 整合原有设计
- 继承src/automatic/的日志系统设计
- 改进Modrinth API集成逻辑
- 优化部署流程和备份机制

### 新增优势
- Docker优先的容器化方案
- 模块化脚本设计,职责单一
- Makefile统一管理入口
- 完整的生命周期自动化

## 技术特性

- 完善的错误处理和日志记录
- macOS/Linux跨平台兼容
- 敏感信息安全管理
- 持续监控模式

## 向后兼容

- 保留src/automatic/旧脚本(供参考)
- 配置文件格式完全兼容
- Docker Compose配置无变化
2025-12-09 10:00:00 +08:00
01054f7b22 feat: add unified Makefile for service management
Provide consistent interface for all operations
Simplify common tasks across services
Support both individual and batch operations

Unix philosophy: composable tools with standard interface
Make targets: help, status, up, down, logs, restart per service
2025-12-06 16:20:00 +08:00