No description
Find a file
m1ngsama 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
bin fix: improve backup script error handling and validation 2025-12-15 10:00:00 +08:00
minecraft refactor: extract shared utilities into common library 2025-12-13 10:00:00 +08:00
nextcloud feat(nextcloud): add local nextcloud docker compose setup 2025-11-18 16:47:11 +08:00
services fix: skip binary download if already installed, symlink from existing path 2026-02-28 01:55:47 +08:00
teamspeak feat: add TeamSpeak environment template 2025-12-05 11:45:00 +08:00
.gitignore chore: add project infrastructure files 2025-12-02 10:00:00 +08:00
config.sh feat: centralize configuration and improve Makefile 2025-12-14 10:00:00 +08:00
LICENSE chore: add project infrastructure files 2025-12-02 10:00:00 +08:00
Makefile feat: add infra service deploy scripts 2026-02-28 01:09:36 +08:00
README.md feat: add infra service deploy scripts 2026-02-28 01:09:36 +08:00
setup.sh feat: add interactive setup.sh wizard 2026-02-28 01:42:50 +08:00

Automa

Deployment scripts for self-hosted infrastructure. Pairs with infra (private) for configuration.

infra/services/<name>/.env  →  automa/services/<name>/deploy.sh

Relationship with infra

infra (private) holds config templates and .env.example files — the "what" and "how to configure". automa (public) holds deployment scripts — the "how to deploy". Zero hardcoded values, zero domain names.

Workflow:

  1. Clone infra (private), fill in .env files for each service you want
  2. Clone automa (public), run the matching deploy script
  3. Each script reads INFRA_DIR to locate the corresponding .env
# Example
cd infra/services/email && cp .env.example .env && $EDITOR .env
cd automa/services/email
INFRA_DIR=../../infra/services/email ./deploy.sh

Philosophy

This project embraces Unix principles:

  • Modularity: Each service is self-contained
  • Simplicity: Minimal dependencies, clear configuration
  • Composability: Tools work together through standard interfaces
  • Transparency: Plain text configuration, readable scripts

Infrastructure Services

System services deployed from infra module configs.

Email

Postfix + Dovecot + OpenDKIM + SpamAssassin.

INFRA_DIR=/path/to/infra/services/email ./services/email/deploy.sh

Nginx

Web server and reverse proxy vhosts.

INFRA_DIR=/path/to/infra/services/nginx ./services/nginx/deploy.sh

Shadowsocks

GFW-resistant proxy.

# Server (VPS)
INFRA_DIR=/path/to/infra/services/shadowsocks/server ./services/shadowsocks/server/deploy.sh

# Client (home machine)
INFRA_DIR=/path/to/infra/services/shadowsocks/client ./services/shadowsocks/client/deploy.sh

FRP

Reverse tunnel — expose home services through VPS.

# Server (VPS)
INFRA_DIR=/path/to/infra/services/frp/server ./services/frp/server/deploy.sh

# Client (home machine)
INFRA_DIR=/path/to/infra/services/frp/client ./services/frp/client/deploy.sh

Home Services

Docker-based services with their own config.

Minecraft Server

Automated Minecraft Fabric server deployment with mod management.

Location: minecraft/ Quick Start:

cd minecraft
cp .env.example .env  # Edit as needed
docker compose up -d

See minecraft/README.md for details.

TeamSpeak Server

Voice communication server with minimal configuration.

Location: teamspeak/ Quick Start:

cd teamspeak
cp .env.example .env  # Edit as needed
docker compose up -d

See teamspeak/README.md for details.

Nextcloud

Self-hosted file sync and collaboration platform.

Location: nextcloud/ Quick Start:

cd nextcloud
cp .env.example .env  # Edit as needed
docker compose up -d

See nextcloud/README.md for details.

Utilities

Organization Repository Cloner

Batch clone all repositories from a GitHub organization.

Location: bin/org-clone.sh Usage:

./bin/org-clone.sh <org-name>

Prerequisites

  • Docker & Docker Compose
  • Bash 4.0+
  • Git

Project Structure

automa/
├── bin/                        # Utility scripts
│   └── lib/common.sh          # Shared logging + env helpers
├── services/                   # Infrastructure deploy scripts (reads infra .env)
│   ├── email/deploy.sh
│   ├── nginx/deploy.sh
│   ├── shadowsocks/
│   │   ├── server/deploy.sh
│   │   └── client/deploy.sh
│   └── frp/
│       ├── server/deploy.sh
│       └── client/deploy.sh
├── minecraft/                  # Minecraft server (Docker)
├── teamspeak/                  # TeamSpeak server (Docker)
├── nextcloud/                  # Nextcloud (Docker)
└── README.md

Common Operations

All services follow consistent patterns:

Start a Service

cd <service-name>
docker compose up -d

View Logs

cd <service-name>
docker compose logs -f

Stop a Service

cd <service-name>
docker compose down

Update a Service

cd <service-name>
docker compose pull
docker compose up -d

Security Notes

  • Always change default passwords in .env files
  • Keep .env files out of version control
  • Use strong passwords for production deployments
  • Review exposed ports before deployment

Contributing

Contributions welcome. Keep changes:

  • Simple and focused
  • Well-documented
  • Following existing patterns
  • Unix philosophy aligned

License

MIT License - See LICENSE file for details.