GitHub Actions Workflows: - docker-compose-validation.yml: Validates all compose files - Syntax validation - Network configuration checks - Traefik label validation - Port exposure warnings - Domain consistency checks - File naming convention enforcement - security-checks.yml: Security scanning and validation - Gitleaks secret detection - Environment file validation - Placeholder password checks - Container image vulnerability scanning with Trivy - Dependency review for pull requests - Security report generation - yaml-lint.yml: YAML formatting and validation - yamllint with custom configuration - File extension consistency checks - YAML structure validation - Service naming convention checks - Docker Compose version validation - documentation.yml: Documentation quality checks - Markdown linting - Link validation - README completeness verification - Service documentation checks - Domain URL validation - auto-label.yml: Automated PR labeling - Category-based labeling (core/media/services) - File type detection - Size-based labeling - Security-related changes detection Configuration Files: - .yamllint.yml: YAML linting rules for Docker Compose - .markdownlint.json: Markdown formatting rules - .markdown-link-check.json: Link checking configuration - .pre-commit-config.yaml: Pre-commit hooks setup - .github/labeler.yml: Auto-labeler configuration - .github/CODEOWNERS: Code ownership definitions Templates: - pull_request_template.md: Comprehensive PR checklist - ISSUE_TEMPLATE/bug-report.md: Bug report template - ISSUE_TEMPLATE/service-request.md: New service request template Documentation: - SECURITY.md: Security policy and best practices - CONTRIBUTING.md: Contribution guidelines Benefits: - Automated validation of all compose files - Security scanning on every PR - Consistent code formatting - Documentation quality assurance - Automated issue/PR management - Pre-commit hooks for local validation - Comprehensive security policy - Clear contribution guidelines
6.3 KiB
Contributing Guide
Thank you for your interest in contributing to this homelab configuration! While this is primarily a personal repository, contributions are welcome.
How to Contribute
Reporting Issues
- Use the bug report template for bugs
- Use the service request template for new services
- Search existing issues before creating a new one
- Provide as much detail as possible
Submitting Changes
- Fork the repository
- Create a feature branch
git checkout -b feature/your-feature-name - Make your changes following the guidelines below
- Test your changes locally
- Commit with clear messages
git commit -m "feat: add new service" - Push to your fork
git push origin feature/your-feature-name - Open a Pull Request using the PR template
Guidelines
File Naming
- All Docker Compose files must be named
compose.yaml(not.yml) - Use lowercase with hyphens for service directories (e.g.,
calibre-web) - Environment files must be named
.env
Docker Compose Best Practices
- Use version-pinned images when possible
- Include health checks for databases and critical services
- Use bind mounts for configuration, named volumes for data
- Set proper restart policies (
unless-stoppedoralways) - Include resource limits for production services
Network Configuration
- All services must use the
homelabnetwork (marked asexternal: true) - Services with multiple containers should use an internal network
- Example:
networks: homelab: external: true service_internal: name: service_internal driver: bridge
Traefik Labels
All web services must include:
labels:
traefik.enable: true
traefik.http.routers.service.rule: Host(`service.fig.systems`) || Host(`service.edfig.dev`)
traefik.http.routers.service.entrypoints: websecure
traefik.http.routers.service.tls.certresolver: letsencrypt
traefik.http.services.service.loadbalancer.server.port: 8080
# Optional SSO:
traefik.http.routers.service.middlewares: tinyauth
Environment Variables
- Use
.envfiles for configuration - Never commit real passwords
- Use
changeme_*prefix for placeholder passwords - Document all required environment variables
- Include comments explaining non-obvious settings
Documentation
- Add service to README.md service table
- Include deployment instructions
- Document any special configuration
- Add comments to compose files explaining purpose
- Include links to official documentation
Security
- Never commit secrets
- Scan compose files for vulnerabilities
- Use official or well-maintained images
- Enable SSO when appropriate
- Document security considerations
Code Style
YAML Style
- 2-space indentation
- No trailing whitespace
- Use
true/falseinstead ofyes/no - Quote strings with special characters
- Follow yamllint rules in
.yamllint.yml
Commit Messages
Follow Conventional Commits:
feat:New featurefix:Bug fixdocs:Documentation changesrefactor:Code refactoringsecurity:Security improvementschore:Maintenance tasks
Examples:
feat: add jellyfin media server
fix: correct traefik routing for sonarr
docs: update README with new services
security: update postgres to latest version
Testing
Before submitting a PR:
-
Validate compose files
docker compose -f compose/path/to/compose.yaml config -
Check YAML syntax
yamllint compose/ -
Test locally
docker compose up -d docker compose logs -
Check for secrets
git diff --cached | grep -i "password\|secret\|token" -
Run pre-commit hooks (optional)
pre-commit install pre-commit run --all-files
Pull Request Process
- Fill out the PR template completely
- Ensure all CI checks pass
- Request review if needed
- Address review feedback
- Squash commits if requested
- Wait for approval and merge
CI/CD Checks
Your PR will be automatically checked for:
- Docker Compose validation
- YAML linting
- Security scanning
- Secret detection
- Documentation completeness
- Traefik configuration
- Network setup
- File naming conventions
Fix any failures before requesting review.
Adding a New Service
-
Choose the correct category:
compose/core/- Infrastructure (Traefik, auth, etc.)compose/media/- Media-related servicescompose/services/- Utility services
-
Create service directory:
mkdir -p compose/category/service-name -
Create
compose.yaml:- Include documentation header
- Add Traefik labels
- Configure networks
- Set up volumes
- Add health checks if applicable
-
Create
.envif needed:- Use placeholder passwords
- Document all variables
- Include comments
-
Update README.md:
- Add to service table
- Include URL
- Document deployment
-
Test deployment:
cd compose/category/service-name docker compose up -d docker compose logs -f -
Create PR with detailed description
Project Structure
homelab/
├── .github/
│ ├── workflows/ # CI/CD workflows
│ ├── ISSUE_TEMPLATE/ # Issue templates
│ └── pull_request_template.md
├── compose/
│ ├── core/ # Infrastructure services
│ ├── media/ # Media services
│ └── services/ # Utility services
├── README.md # Main documentation
├── CONTRIBUTING.md # This file
├── SECURITY.md # Security policy
└── .yamllint.yml # YAML linting config
Getting Help
- Check existing issues and PRs
- Review the README.md
- Examine similar services for examples
- Ask in PR comments
License
By contributing, you agree that your contributions will be licensed under the same terms as the repository.
Code of Conduct
- Be respectful and professional
- Focus on constructive feedback
- Help others learn and improve
- Keep discussions relevant
Questions?
Open an issue with the question label or comment on an existing PR/issue.
Thank you for contributing! 🎉