-
Notifications
You must be signed in to change notification settings - Fork 0
Stack Validation
Validate and check the integrity of strut stacks — whether creating a new one or verifying an existing one is healthy.
strut my-stack validate --env prodChecks all config files against expected schemas:
-
strut.conf— registry type, reverse proxy, branch name -
services.conf— port ranges (1-65535), boolean DB flags, health paths -
volume.conf— absolute paths, VOLUME_OWNERS format -
backup.conf— boolean flags, numeric retention, cron expressions -
required_vars— all listed vars present in env file - Secret scanning (since v0.9.0) — flags known credential patterns in env files and errors if an env file is tracked by git
Returns exit code 0 for valid, 1 for errors. validate is also run automatically before each deploy unless --skip-validation is passed.
Env values are matched against these patterns:
| Pattern | Detects |
|---|---|
ghp_[A-Za-z0-9]{36} |
GitHub Personal Access Token |
github_pat_* |
GitHub fine-grained PAT |
AKIA[0-9A-Z]{16} |
AWS access key |
sk-[A-Za-z0-9]{20,} |
OpenAI / Stripe-style API key |
https://hooks.slack.com/ |
Slack webhook URL |
Keys named *PASSWORD* / *SECRET* / *TOKEN* / *KEY* are additionally checked for weak values (password, changeme, secret, admin, 12345*, qwerty, etc.). Findings are warnings — they don't block deploy by themselves, but serve as a signal that the env file must be gitignored.
For a cross-stack audit with strict CI gating, see Security Posture.
strut my-stack health --env prod # Runtime health
strut my-stack drift detect --env prod # Config drift vs git
strut my-stack schema verify --env prod # Postgres schema matches SQL init
strut my-stack keys env:validate --env prod # Env vars against template
strut my-stack backup health --env prod # Backup health scoresEvery stack lives under stacks/<stack-name>/:
stacks/<stack-name>/
├── docker-compose.yml # required
├── docker-compose.local.yml # required
├── .env.template # required
├── .drift-ignore # recommended
├── backup.conf # recommended
├── repos.conf # recommended
├── nginx/ # if using reverse proxy
├── sql/init/ # Postgres DDL
└── config/ # runtime config files
# Syntax check
docker compose -f stacks/<stack>/docker-compose.yml config --quiet
# Full resolved config
docker compose -f stacks/<stack>/docker-compose.yml --env-file .prod.env configVerify:
- All services have
restart: unless-stoppedandhealthcheck - Database-dependent services use
condition: service_healthy - Optional services use
profiles: - No hardcoded secrets — use
${VAR}substitution
# Compare template vs actual
diff \
<(grep -E '^[A-Z_]+=?' stacks/<stack>/.env.template | cut -d= -f1 | sort) \
<(grep -E '^[A-Z_]+=?' .prod.env | cut -d= -f1 | sort)
# Check for unfilled placeholders
grep -E '(your-|change-me|xxxx|placeholder|TODO)' .prod.env| Variable | Purpose |
|---|---|
VPS_HOST |
SSH target |
VPS_USER |
SSH user |
VPS_DEPLOY_DIR |
strut path on VPS |
GH_PAT |
GitHub PAT for private images |
COMPOSE_PROJECT_NAME |
Docker project name |
strut my-stack health --env prod --json
strut my-stack status --env prod
strut my-stack drift detect --env prod
strut my-stack schema verify --env prod
strut my-stack backup health --env prod
strut my-stack keys inventory| Tier | Files |
|---|---|
| Minimal |
docker-compose.yml + docker-compose.local.yml + .env.template + .drift-ignore
|
| Standard | + backup.conf + repos.conf + nginx/ + sql/init/
|
| Full | + volume.conf + config/ + keys/ + drift-history/
|
| Failure | Cause |
|---|---|
| docker-compose.yml syntax error | Tabs vs spaces, missing quotes, undefined ${VAR}
|
| Missing required env vars | Template has vars not in .prod.env
|
| Service fails healthcheck | Missing env vars, DB connection issues, port conflicts |
| Drift detected after first deploy | Add runtime files to .drift-ignore
|
strut · v0.1.0 · Report an Issue
Getting Started
Core Concepts
Operations
- Deployment
- Remote Host Setup
- Blue-Green Deploy
- Deploy Rollback
- Database Backups
- Stack Groups
- Lifecycle Hooks
- Notifications
- Key Rotation
- Drift Detection
- Domain and SSL
- Monitoring
- Volume Management
Advanced
- Security Posture
- VPS Audit and Migration
- Stack Validation
- Data Anonymization
- Debugging
- Local Development
Extending
Contributing