Commit graph

30 commits

Author SHA1 Message Date
b29abcec8a
Merge pull request #12 from m1ngsama/feat/audit-missing-services
feat: add missing service deploy scripts (sing-box, tnt, minio, galene)
2026-03-06 01:31:40 +08:00
b91512e97f feat: add missing service deploy scripts (sing-box, tnt, minio, galene)
Infrastructure audit revealed services running in production with no
corresponding deploy scripts. Closes #11.

- sing-box: server + client deploy scripts. Config generated by sing-box-yg
  (https://github.com/yonggekkk/sing-box-yg), stored in infra for recovery.
- tnt: terminal chat server via official install.sh; proper systemd unit
  with unprivileged user and security hardening.
- minio: single-binary install from dl.min.io; minio-user, /etc/default/minio.
- galene: binary install from GitHub releases; configurable UDP range for WebRTC.
- frp/server: add FRP_WEB_USER to .env.example and frps.toml.example;
  fix hardcoded "root" username in web dashboard config.
2026-03-06 01:26:12 +08:00
9d8a08900d feat: add forgejo deploy script, fix nginx envsubst variable leak
- services/forgejo/deploy.sh: deploys Forgejo via Docker to /opt/frp,
  sets up nginx vhost, optionally installs GitHub mirror sync cron
- services/forgejo/{.env.example,docker-compose.yml,nginx.conf.example}:
  bundled templates following find_template pattern (INFRA_DIR override)
- services/nginx/deploy.sh: fix bare envsubst clobbering nginx $vars
  (e.g. $host, $uri) by scoping substitution to known domain vars only
2026-02-28 13:22:41 +08:00
23b8d1abd8
Merge pull request #10 from m1ngsama/fix/deploy-idempotent-binary-check
fix: idempotent binary install, bundled templates, envsubst export
2026-02-28 02:13:47 +08:00
2ae28fb0a7 fix: export .env vars with set -a so envsubst can see them
source without set -a sets vars in current shell but does not export them.
Child processes like envsubst cannot see unexported vars, causing all
template substitutions to produce empty strings.

Fix: set -a before source, set +a after — auto-exports every assigned var.
2026-02-28 02:04:26 +08:00
929c527ad0 fix: bundle config templates, add find_template fallback
Deploy scripts now look for templates in INFRA_DIR first, then fall back
to the bundled copies in automa. This makes automa fully self-contained:
a .env with filled values is all that is needed — no infra checkout required.

Bundle: config.json.example, privoxy.conf.example, shadowsocks-client.service,
shadowsocks-rust.service, frps.toml.example, frps.service,
frpc.toml.example, frpc.service
2026-02-28 02:00:52 +08:00
19b3e5035c fix: skip binary download if already installed, symlink from existing path
Resolves bootstrapping deadlock where downloading sslocal requires internet
access via the very proxy being deployed. Also handles distros (Arch) where
shadowsocks-rust is installed via package manager to /usr/bin instead of
/usr/local/bin.

Priority:
  1. /usr/local/bin/sslocal exists → skip download
  2. sslocal found in PATH elsewhere → symlink to /usr/local/bin/sslocal
  3. not found → download from GitHub releases

Same logic applied to ssserver-rust in server/deploy.sh.
Also: stop conflicting shadowsocks.service before starting shadowsocks-client,
and detect pacman vs apt for privoxy install.
2026-02-28 01:55:47 +08:00
990e0f93be
Merge pull request #9 from m1ngsama/feature/interactive-setup
Add interactive setup.sh wizard
2026-02-28 01:47:13 +08:00
1356348d79 feat: add interactive setup.sh wizard
Discovers all deployable modules from services/ automatically.
Grouped menu by role (vps / homeserver / any) with descriptions.

Env resolution priority:
  1. pre-filled .env in local infra checkout (--infra-dir)
  2. .env.example from infra (interactive fill)
  3. .env.example bundled in automa (interactive fill, no infra needed)

Usage:
  ./setup.sh                           # fully interactive
  ./setup.sh --infra-dir /path/to/infra # use pre-filled .env files
  ./setup.sh --dry-run                 # preview without deploying

Also add .env.example with role/description metadata to each service
module so setup.sh can build the menu and prompt for values without
requiring an infra checkout.
2026-02-28 01:42:50 +08:00
50ecd7c814
Merge pull request #7 from m1ngsama/feature/infra-service-deploy-scripts
Add infra service deploy scripts
2026-02-28 01:17:32 +08:00
f82cd2d956 feat: add infra service deploy scripts
Add services/ directory with deploy scripts for system-level infrastructure
services. Each script reads INFRA_DIR pointing to the corresponding infra
module, sources its .env, substitutes config templates via envsubst, and
installs/enables systemd services. Zero hardcoded values — public-safe.

New scripts:
- services/email/deploy.sh      (Postfix + Dovecot + OpenDKIM + SpamAssassin)
- services/nginx/deploy.sh      (Nginx vhosts via envsubst)
- services/shadowsocks/server/deploy.sh  (shadowsocks-rust server)
- services/shadowsocks/client/deploy.sh  (sslocal + privoxy chain)
- services/frp/server/deploy.sh (frps)
- services/frp/client/deploy.sh (frpc)

README: add "Relationship with infra" section explaining the two-repo workflow
Makefile: add deploy-email, deploy-nginx, deploy-ss-{server,client},
          deploy-frp-{server,client} targets

Closes #6
2026-02-28 01:09:36 +08:00
9b709b25b4
Merge pull request #2 from m1ngsama/optimize/engineering-improvements
refactor: engineering optimizations for shared utilities and improved error handling
2025-12-15 10:25:24 +08:00
3f30b35c8c fix: improve backup script error handling and validation
- Add prerequisite checks before backup operations
- Validate container status before attempting backups
- Load .env file for database credentials (security improvement)
- Remove hardcoded default password from Nextcloud backup
- Use centralized config for container names
- Add --single-transaction flag for database dumps
- Improve cleanup with better reporting of removed files
- Add help command and environment variable documentation
2025-12-15 10:00:00 +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
3e1d752bfd refactor: extract shared utilities into common library
- Create bin/lib/common.sh with shared logging and utility functions
- Add minecraft/.env.example for environment configuration template
- Update bin scripts to source shared library (DRY principle)
- Consolidate duplicated logging functions across scripts
2025-12-13 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
4ff60014df refactor: improve Minecraft automation scripts
Standardize shebang to #!/usr/bin/env bash
Add descriptive headers to all scripts
Make all scripts executable

Consistent with Unix best practices:
- Portable shebang usage
- Self-documenting code
- Proper file permissions
2025-12-08 10:30:00 +08:00
2e55194f5c feat: add operational utilities for monitoring and backup
Add healthcheck.sh for service status monitoring
- Check container health and port accessibility
- Support individual service or all-services check

Add backup.sh for data protection
- Backup service data and configurations
- List existing backups
- Cleanup old backups with retention policy

Unix philosophy: small sharp tools that do one thing well
2025-12-07 13: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
594cdf586d feat: add TeamSpeak environment template
Provide .env.example for TeamSpeak configuration
Ensures consistency across service deployments

All services now have .env.example files
2025-12-05 11:45:00 +08:00
5be2155b3c refactor: improve org-clone script with proper error handling
- Add comprehensive error checking and validation
- Implement proper argument parsing with usage help
- Add colored output for better readability
- Include prerequisite checks for gh CLI
- Track success/failure statistics

Unix philosophy: do one thing well, fail gracefully
2025-12-04 09:15:00 +08:00
0f71ff88ea docs: add comprehensive project README
Document project philosophy and structure
Provide clear usage instructions for all services
Follow documentation-as-code principle

Unix philosophy: be clear about what tools do
2025-12-03 14:30:00 +08:00
546a923e76 chore: add project infrastructure files
Add .gitignore to exclude sensitive and generated files
Add MIT License for open source compliance

Following Unix philosophy: clear project boundaries
2025-12-02 10:00:00 +08:00
97e44ab818
Merge pull request #1 from m1ngsama/feature/nextcloud
feat(nextcloud): add local nextcloud docker compose setup
2025-11-18 16:47:55 +08:00
35dcacdc7c feat(nextcloud): add local nextcloud docker compose setup 2025-11-18 16:47:11 +08:00
33ade46a99 upload org multi repository clone scripts 2025-11-14 11:08:39 +08:00
2207914289 update minecraft compose file and some specific config 2025-11-12 15:33:22 +08:00
dcb32e6b91 init the compose file for the establishment of teamspeak server 2025-11-06 18:44:46 +08:00
a177ec70d7 add compose.yaml 2025-11-02 18:13:50 +08:00
3bafd84230 init index and upload the scripts of minecraft 2025-10-28 11:13:41 +08:00