Migrate WireGuard from Docker to system-level service #270
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Docker Validation | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| push: | |
| branches: [ main ] | |
| jobs: | |
| validate-docker-compose: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Create .env file for testing | |
| run: | | |
| cp .env.example .env | |
| # Set test values | |
| sed -i 's/192.168.1.100/127.0.0.1/g' .env | |
| sed -i 's/your_secure_password_here/test-password/g' .env | |
| sed -i 's/your_secure_grafana_password/test-grafana-password/g' .env | |
| sed -i 's/your_secure_bookwyrm_db_password/test-bookwyrm-password/g' .env | |
| sed -i 's/your_secure_redis_activity_password/test-redis-activity/g' .env | |
| sed -i 's/your_secure_redis_broker_password/test-redis-broker/g' .env | |
| sed -i 's/your_very_long_secret_key_here_at_least_50_characters/test-secret-key-for-bookwyrm-at-least-50-chars-long/g' .env | |
| sed -i 's/your-public-ip-or-domain.com/localhost/g' .env | |
| - name: Validate Docker Compose syntax | |
| run: | | |
| docker compose config --quiet | |
| - name: Check if all services can be built | |
| run: | | |
| # Pull images to validate they exist and are accessible | |
| docker compose pull --ignore-pull-failures | |
| - name: Validate environment file | |
| run: | | |
| # Check that all required environment variables are present | |
| echo "Checking .env.example contains all required variables..." | |
| required_vars=("SERVER_IP" "TIMEZONE" "N8N_PASSWORD" "GRAFANA_PASSWORD") | |
| for var in "${required_vars[@]}"; do | |
| if ! grep -q "^${var}=" .env.example; then | |
| echo "ERROR: Required variable $var not found in .env.example" | |
| exit 1 | |
| fi | |
| done | |
| echo "All required environment variables found in .env.example" | |
| - name: Check for secrets in code | |
| run: | | |
| # Basic check for potential secrets (this is a simple check) | |
| echo "Checking for potential secrets..." | |
| # Exclude environment variable references (${...PASSWORD...}) which are safe | |
| # Exclude known placeholder values in .env.example | |
| if grep -r -i "password\s*=" --include="*.yml" --include="*.yaml" . | \ | |
| grep -v '\${.*PASSWORD.*}' | \ | |
| grep -v "your-secure-password" | \ | |
| grep -v "your_secure.*password" | \ | |
| grep -v "test-password"; then | |
| echo "WARNING: Found hardcoded passwords in YAML files" | |
| exit 1 | |
| fi | |
| echo "No obvious secrets found in configuration files" | |
| lint-yaml: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Lint YAML files | |
| uses: ibiqlik/action-yamllint@v3 | |
| with: | |
| file_or_dir: docker-compose.yml | |
| config_data: | | |
| extends: default | |
| rules: | |
| line-length: | |
| max: 120 | |
| truthy: | |
| allowed-values: ['true', 'false', 'on', 'off'] |