This guide covers the management and utility scripts for IRC.atl.chat deployment and operations.
IRC.atl.chat includes several management scripts:
scripts/
├── init.sh # System initialization
├── prepare-config.sh # Configuration processing
├── ssl-manager.sh # SSL certificate management
└── health-check.sh # System health monitoring
Purpose: Initialize the IRC.atl.chat environment and create required directories.
Usage:
# Automatic initialization (called by make up)
./scripts/init.sh
# Manual initialization with debug output
DEBUG=1 ./scripts/init.shWhat it does:
- Creates persistent data directories (
data/,logs/) - Sets proper ownership for host user
- Validates environment variables (PUID/PGID)
- Checks Docker availability
Purpose: Process template files and generate production configurations.
Usage:
# Process all configuration templates
./scripts/prepare-config.sh
# Process with verbose output
VERBOSE=1 ./scripts/prepare-config.shWhat it does:
- Validates
.envfile exists and is readable - Processes all
.templatefiles withenvsubst - Generates
.conffiles from templates - Sets proper file permissions
Purpose: Automated SSL certificate management via Let's Encrypt.
Usage:
# Check certificate status
./scripts/ssl-manager.sh check
# Issue new certificates
./scripts/ssl-manager.sh issue
# Renew certificates
./scripts/ssl-manager.sh renew
# Copy certificates to UnrealIRCd
./scripts/ssl-manager.sh copy
# Restart services after certificate update
./scripts/ssl-manager.sh restartWhat it does:
- Validates Cloudflare credentials
- Issues/renews Let's Encrypt certificates
- Copies certificates to UnrealIRCd
- Restarts services when needed
Purpose: Check if UnrealIRCd is responding on the IRC port.
Usage:
# Check IRC port (default 6697)
./scripts/health-check.sh
# Check specific port
IRC_PORT=6697 ./scripts/health-check.shWhat it does:
- Tests connectivity to IRC port
- Returns exit code 0 (success) or 1 (failure)
- Used by Docker health checks
All scripts use proper error handling:
set -euo pipefailfor strict error handling- Proper exit codes
- Clear error messages
Scripts provide structured logging:
- Timestamps for all operations
- Clear success/failure messages
- Debug output when
DEBUG=1is set
Scripts are environment-driven:
- Read from
.envfile - Use environment variables for configuration
- Support debug and verbose modes
# Initialize environment
./scripts/init.sh
# Prepare configurations
./scripts/prepare-config.sh
# Setup SSL certificates
./scripts/ssl-manager.sh issue
# Start services
docker compose up -d
# Check health
./scripts/health-check.sh# Check SSL certificate status
./scripts/ssl-manager.sh check
# Renew certificates if needed
./scripts/ssl-manager.sh renew
# Verify service health
./scripts/health-check.sh# Debug initialization
DEBUG=1 ./scripts/init.sh
# Verbose configuration processing
VERBOSE=1 ./scripts/prepare-config.sh
# Check SSL with debug output
DEBUG=1 ./scripts/ssl-manager.sh checkThe scripts are integrated with the Makefile:
# These make commands use the scripts internally
make up # Uses init.sh and prepare-config.sh
make ssl-setup # Uses ssl-manager.sh issue
make ssl-status # Uses ssl-manager.sh check
make ssl-renew # Uses ssl-manager.sh renew# Check script permissions
ls -la scripts/
# Make scripts executable
chmod +x scripts/*.sh
# Check environment variables
env | grep -E "(PUID|PGID|IRC_)"# Fix script permissions
chmod +x scripts/*.sh
# Fix data directory permissions
sudo chown -R $(id -u):$(id -g) data/ logs/# Validate .env file
bash -n .env
# Check required variables
grep -E "(PUID|PGID|IRC_DOMAIN)" .env- MAKE.md - Build automation and management commands
- CONFIG.md - Configuration management
- SSL.md - SSL certificate management
- TROUBLESHOOTING.md - Common issues and solutions