Contributing Guidelines¶
Thank you for considering contributing to this homelab infrastructure repository!
๐ Security First¶
NEVER commit secrets, passwords, tokens, or any sensitive information.
Before contributing, ensure:
- Pre-commit hooks are installed: pre-commit install
- All sensitive data uses .env files or Ansible Vault
- Example files use CHANGE_ME placeholders
- docs/SECURITY_RULEBOOK.md is followed for incident handling and pre-push security workflow
๐ Contribution Checklist¶
- [ ] Pre-commit hooks installed and passing
- [ ] No hardcoded secrets in code
- [ ]
.env.examplefile provided for new services - [ ] README.md created/updated for the service
- [ ] Docker Compose file uses environment variables
- [ ] Security best practices followed
- [ ] Tested in development environment
- [ ] Documentation updated
- [ ]
docs/SECURITY_RULEBOOK.mdreviewed if security-sensitive files changed
๐ฏ What to Contribute¶
New Services¶
- Add new self-hosted applications
- Include complete configuration
- Provide
.env.exampletemplate - Add service-specific README
- Include Traefik labels for reverse proxy
Improvements¶
- Security enhancements
- Documentation improvements
- Bug fixes
- Performance optimizations
- Better secret management
Scripts¶
- Automation scripts
- Helper utilities
- Validation tools
- Backup solutions
๐ Pull Request Process¶
- Fork the repository
-
Create a feature branch
-
Make your changes
- Follow existing patterns
- Use environment variables
-
Include
.examplefiles -
Test your changes
-
Run pre-commit checks
-
Commit your changes
-
Push to your fork
-
Create Pull Request
- Describe what you added/changed
- Include testing steps
- Reference any related issues
๐จ Code Style¶
Docker Compose Files¶
version: '3.8'
services:
service-name:
image: service:latest
container_name: service-name
env_file:
- .env
environment:
- TZ=${TZ:-UTC}
- SERVICE_SECRET=${SERVICE_SECRET}
volumes:
- service_data:/data
networks:
- proxy
security_opt:
- no-new-privileges:true
restart: unless-stopped
volumes:
service_data:
networks:
proxy:
external: true
Environment Files¶
# Service Name Environment Variables
# Copy this file to .env and fill in your actual values
# Generate secrets with: ../../scripts/generate-secrets.sh
# Primary secret
SERVICE_SECRET=CHANGE_ME_GENERATE_WITH_openssl_rand
# Configuration
DOMAIN=smartmur.lab
TZ=UTC
README Files¶
Each service should have:
# Service Name
Brief description
## Quick Start
### 1. Setup
```bash
cp .env.example .env
vim .env # Update secrets
2. Deploy¶
Configuration¶
Environment variables explained...
Security¶
Security considerations...
Troubleshooting¶
Common issues and solutions...
## ๐งช Testing
Before submitting:
```bash
# Validate secrets
./scripts/validate-secrets.sh
# Security checks
pre-commit run --all-files
# Test compose file
cd YourService
docker-compose config
# Start service
docker-compose up -d
# Check logs
docker-compose logs -f
# Test functionality
# (Access web UI, test features, etc.)
# Clean up
docker-compose down -v
๐ Documentation¶
Good documentation includes: - Clear setup instructions - Environment variable descriptions - Security considerations - Troubleshooting section - Links to official documentation
โ What NOT to Do¶
- โ Commit
.envfiles - โ Commit passwords or tokens
- โ Commit API keys
- โ Use hardcoded secrets
- โ Commit without testing
- โ Skip pre-commit hooks
- โ Skip
docs/SECURITY_RULEBOOK.mdincident workflow after a leak - โ Use absolute paths (use relative or env vars)
- โ Commit large binary files
โ Best Practices¶
- โ Use environment variables for configuration
- โ
Provide
.examplefiles for sensitive configs - โ Include health checks in compose files
- โ Use named volumes
- โ Set proper file permissions
- โ Include security_opt: no-new-privileges
- โ
Use specific image tags (not
latestin production) - โ Document all requirements
๐ Bug Reports¶
When reporting bugs:
- Check existing issues first
- Provide details:
- Service name and version
- Docker version:
docker --version - Compose version:
docker-compose --version - OS/Distribution
- Error messages (sanitize any secrets!)
-
Steps to reproduce
-
Never include:
- Actual passwords
- Real API tokens
- Private keys
- Personal information
๐ก Feature Requests¶
For new features: - Describe the feature - Explain the use case - Suggest implementation (if possible) - Consider security implications
๐ License¶
By contributing, you agree that your contributions will be licensed under the same license as the project.
๐ค Code of Conduct¶
- Be respectful and inclusive
- Help others learn
- Accept constructive criticism
- Focus on what's best for the community
โ Questions?¶
- Open a discussion
- Check existing documentation
- Review other examples in the repo
Thank you for contributing! ๐