๐ค Contributing to Tobogganing¶
Thank you for your interest in contributing to Tobogganing! We welcome contributions from the community and appreciate your help in making this project better.
๐ Table of Contents¶
- ๐ Getting Started
- ๐ป Development Setup
- ๐ Contribution Process
- ๐ Code Standards
- ๐งช Testing
- ๐ Documentation
- ๐ Bug Reports
- ๐ก Feature Requests
- ๐ Security Issues
- ๐ฅ Community
๐ Getting Started¶
Prerequisites¶
- ๐ Python 3.12+ for Manager service
- ๐น Go 1.23+ for Headend server and native clients
- ๐ข Node.js 18+ for website development
- ๐ณ Docker for containerized development
- ๐ฆ Git for version control
๐ด Fork and Clone¶
- Fork the repository on GitHub
- Clone your fork locally:
๐ป Development Setup¶
๐ง Environment Setup¶
Python Environment (Manager)¶
cd manager
python -m venv venv
source venv/bin/activate # Linux/Mac
# or
venv\Scripts\activate # Windows
pip install -r requirements.txt
pip install -r requirements-dev.txt
Go Environment (Headend & Clients)¶
Node.js Environment (Website)¶
๐ณ Docker Development¶
๐ Contribution Process¶
1. ๐ Create an Issue¶
- ๐ For bug reports, use the bug report template
- ๐ก For feature requests, use the feature request template
- ๐ For documentation, create a documentation issue
2. ๐ฟ Create a Branch¶
3. ๐ป Make Changes¶
- โ Follow coding standards
- ๐งช Add tests for new functionality
- ๐ Update documentation as needed
- ๐ Run linters and tests locally
4. ๐ค Submit Pull Request¶
- ๐ Use clear, descriptive commit messages
- ๐ Fill out the pull request template
- ๐ Link to related issues
- โ Ensure all CI checks pass
5. ๐ Code Review¶
- ๐ Be patient during review process
- ๐ฌ Address reviewer feedback
- โจ Update code as requested
- ๐ Celebrate when merged!
๐ Code Standards¶
๐ Python (Manager Service)¶
- ๐ Follow PEP 8 style guide
- ๐ท๏ธ Use type hints for all functions
- ๐ Write docstrings for classes and methods
- โก Use async/await for I/O operations
- ๐งช Include unit tests for new code
async def generate_certificate(
node_id: str,
node_type: str,
validity_days: int = 365
) -> Dict[str, Any]:
"""Generate X.509 certificate for node authentication.
Args:
node_id: Unique node identifier
node_type: Type of node (client/headend)
validity_days: Certificate validity period
Returns:
Certificate data with private key
Raises:
CertificateError: If generation fails
"""
pass
๐น Go (Headend & Clients)¶
- ๐จ Follow Go conventions and use
gofmt - ๐ Use context for cancellation
- โ Handle errors explicitly
- ๐ Use structured logging
- ๐งช Write comprehensive tests
// AuthenticateClient verifies client credentials
func (a *Authenticator) AuthenticateClient(
ctx context.Context,
cert *x509.Certificate,
token string,
) (*AuthResult, error) {
if cert == nil {
return nil, errors.New("certificate required")
}
// Implementation
}
๐ข TypeScript (Website)¶
- ๐ Follow TypeScript best practices
- โ๏ธ Use React Hooks patterns
- โฟ Write accessible components
- ๐จ Use Tailwind CSS for styling
- ๐ Document component props
๐งช Testing¶
Test Types¶
- ๐ฌ Unit Tests: Individual functions/methods
- ๐ Integration Tests: Component interactions
- ๐ญ End-to-End Tests: Complete user workflows
- ๐ Security Tests: Authentication/authorization
- โก Performance Tests: Load and stress testing
Running Tests¶
# ๐ Python tests
cd manager && source venv/bin/activate
pytest tests/ -v --cov=.
# ๐น Go tests (Headend)
cd headend
go test -v -race ./...
# ๐น Go tests (Clients)
cd clients/native
go test -v -race ./...
# ๐ข Website tests
cd website
npm test
Coverage Goals¶
- ๐ฏ 80%+ code coverage for new code
- ๐ก๏ธ 100% coverage for security components
- ๐ Integration tests for all API endpoints
- ๐ญ E2E tests for critical user journeys
๐ Documentation¶
Documentation Types¶
- ๐ป Code Comments: Inline documentation
- ๐ API Docs: REST API reference
- ๐ User Guides: Installation and usage
- ๐๏ธ Developer Guides: Architecture docs
- ๐ Deployment Guides: Production setup
Standards¶
- โ๏ธ Write docs during development
- ๐ค Use clear, concise language
- ๐ก Include examples where helpful
- ๐ Keep docs synchronized with code
- ๐จ Use emojis and icons for visual appeal
๐ Bug Reports¶
When reporting bugs, include:
- ๐ Summary: Clear issue description
- ๐ฅ๏ธ Environment: OS, versions, deployment
- ๐ Steps: Detailed reproduction steps
- โ Expected: What should happen
- โ Actual: What actually happens
- ๐ Logs: Error messages and output
- โ๏ธ Config: Relevant configuration (sanitized)
๐ก Feature Requests¶
For new features, include:
- ๐ฏ Problem: What issue does this solve?
- ๐ญ Solution: Proposed implementation
- ๐ Alternatives: Other options considered
- ๐ฅ Users: Who benefits from this?
- ๐ง Technical: Implementation approach
๐ Security Issues¶
โ ๏ธ DO NOT create public issues for security vulnerabilities!
Instead: 1. ๐ง Email security@tobogganing.com 2. ๐ Include detailed vulnerability info 3. โฐ Allow reasonable response time 4. ๐ค Follow responsible disclosure
๐ฅ Community¶
๐ฌ Communication¶
- ๐ GitHub Issues: Bug reports and features
- ๐ญ GitHub Discussions: Questions and ideas
- ๐ฌ Discord: Real-time community chat
- ๐ง Email: Security and urgent matters
๐ค Code of Conduct¶
We are committed to a welcoming, inclusive environment for all contributors. Please be: - ๐ค Respectful and considerate - ๐ฏ Constructive in feedback - ๐ Collaborative and helpful - ๐ Patient with newcomers
๐ Recognition¶
Contributors are recognized through: - ๐ Repository contributor list - ๐ฐ Release notes mentions - ๐๏ธ Annual appreciation posts - ๐ Special contributor badges
๐ License¶
By contributing to Tobogganing, you agree that your contributions will be licensed under the MIT License.
๐ Thank you for contributing to Tobogganing! Together, we're making secure networking accessible to everyone! ๐