Contributing Guidelines - thakares/nx9-dns-server GitHub Wiki
Thank you for considering contributing to nx9-dns-server! This document outlines the process for contributing to the project and provides guidelines to ensure your contributions can be efficiently reviewed and integrated.
- Code of Conduct
- Getting Started
- Development Environment
- Contribution Workflow
- Code Style
- Testing Guidelines
- Documentation
- Priority Areas
- Issue and Pull Request Process
- Commit Message Guidelines
- Review Process
- Release Process
- Getting Help
All contributors are expected to adhere to our Code of Conduct. Please read CODE_OF_CONDUCT.md before contributing to ensure a respectful and inclusive environment for everyone.
- Fork the repository on GitHub
-
Clone your fork to your local machine:
git clone https://github.com/YOUR_USERNAME/nx9-dns-server.git cd nx9-dns-server
-
Add the upstream repository as a remote to keep your fork in sync:
git remote add upstream https://github.com/thakares/nx9-dns-server.git
-
Create a new branch for your contribution:
git checkout -b feature/your-feature-name
- Rust (latest stable version) - Installation instructions
- SQLite development libraries
- OpenSSL development libraries
-
Install Rust dependencies:
cargo install cargo-audit cargo-watch cargo-insta
-
Set up pre-commit hooks:
cp hooks/pre-commit .git/hooks/ chmod +x .git/hooks/pre-commit
-
Build the project:
cargo build
-
Create a development database:
cp conf/dns.db.sample dev-dns.db sqlite3 dev-dns.db < conf/dns_records.sql
-
Run the tests:
cargo test
-
Start the server in development mode:
DNS_DB_PATH=dev-dns.db DNS_BIND=127.0.0.1:5353 cargo run
-
Sync your fork with the upstream repository:
git fetch upstream git checkout main git merge upstream/main git push origin main
-
Create a new branch for your work:
git checkout -b feature/your-feature-name
-
Implement your changes
-
Add tests for your changes
-
Update documentation if necessary
-
Run tests to ensure they pass:
cargo test
-
Format your code:
cargo fmt
-
Run lints:
cargo clippy
-
Commit your changes with meaningful commit messages
-
Push your branch to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request from your fork to the upstream repository
We follow the standard Rust style guidelines. All code should be formatted using rustfmt
and should pass clippy
checks:
# Format code
cargo fmt
# Run clippy
cargo clippy -- -D warnings
Additional style guidelines:
- Use meaningful variable names
- Add comments for complex logic
- Keep functions small and focused
- Use Rust idioms and patterns
- Avoid using
unsafe
code without strong justification - Use type-safe approaches rather than string manipulation when possible
All new features and bug fixes should include appropriate tests:
- Unit tests: Test individual components in isolation
- Integration tests: Test components working together
- End-to-end tests: Test complete workflows
To run tests:
# Run all tests
cargo test
# Run specific test
cargo test test_name
# Run tests with extended output
cargo test -- --nocapture
For DNS-specific testing, use the included test scripts in the tools/
directory:
./tools/dnscheck.sh 127.0.0.1:5353
Documentation is crucial for the project's usability:
- Code Documentation: All public API interfaces should have rustdoc comments
- Wiki: Update wiki pages when adding or changing features
- README: Keep the README up-to-date with current features and instructions
- Examples: Provide example configurations and usage scenarios
Generate documentation locally:
cargo doc --open
We're currently focusing on these key areas for contributions:
-
Web UI Development:
- Implementation of administrative interface
- Record management components
- Dashboard visualizations
- User experience improvements
-
API Service:
- RESTful API implementation
- Authentication and authorization
- Rate limiting and security
- API documentation
-
User Management:
- Authentication mechanisms
- Role-based access control
- User profile management
- Multi-factor authentication
-
Testing Improvements:
- Automated integration tests
- Performance benchmarks
- Security testing
- Test coverage improvements
-
Documentation:
- User guides
- API documentation
- Deployment scenarios
- Troubleshooting guides
- Use issue templates when available
- Provide clear reproduction steps for bugs
- Include environment details (OS, Rust version, etc.)
- For feature requests, explain the use case and benefits
- Reference any related issues using GitHub keywords (e.g., "Fixes #123")
- Provide a clear description of the changes
- Include screenshots for UI changes
- Add notes about testing done
- Update documentation as needed
- Ensure CI checks pass
We follow a simplified version of the Conventional Commits format:
<type>(<scope>): <description>
[optional body]
[optional footer]
Types include:
- feat: A new feature
- fix: A bug fix
- docs: Documentation changes
- style: Code style changes (formatting, etc.)
- refactor: Code refactoring
- test: Adding or updating tests
- chore: Updates to build process, dependencies, etc.
Example:
feat(dns): add support for CAA record type
Implement support for Certificate Authority Authorization records
according to RFC 6844.
Resolves: #45
All contributions undergo review before being merged:
- Automated checks: CI pipeline for tests, linting, and security scans
- Code review: At least one maintainer must approve the changes
- Discussion: Address any feedback or questions
- Final approval: Maintainer approves and merges
Expect feedback within 1-2 weeks. Please be responsive to review comments.
nx9-dns-server follows semantic versioning (MAJOR.MINOR.PATCH):
- MAJOR: Incompatible API changes
- MINOR: New functionality in a backward-compatible manner
- PATCH: Backward-compatible bug fixes
Release steps:
- Update version in
Cargo.toml
and other relevant files - Update
CHANGELOG.md
with notable changes - Create a release tag
- Build and publish release artifacts
If you need assistance with contributing:
- Open a discussion on GitHub
- Check existing issues and PRs for similar topics
- Join our community chat (link in project README)
- Email the maintainers directly for sensitive matters
Thank you for contributing to nx9-dns-server! Your efforts help improve DNS infrastructure for everyone.