Contributing to PrivacyGuard DNS
Thank you for your interest in contributing to PrivacyGuard DNS! This document provides guidelines and instructions for contributing to our project.
Table of Contents
- Code of Conduct
- Getting Started
- Development Process
- Coding Standards
- Submitting Changes
- Reporting Issues
- Security
Code of Conduct
This project follows our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to security@privacyguard.dns.
Getting Started
Prerequisites
Before you begin, ensure you have the following installed:
- Node.js: Version 18.0.0 or higher
- npm: Version 9.0.0 or higher (comes with Node.js)
- Git: Latest version
Setting Up Development Environment
Fork the Repository
Visit our GitHub repository and click the "Fork" button to create your own fork.
Clone Your Fork
git clone https://github.com/YOUR_USERNAME/PrivacyGuard-DNS.git cd PrivacyGuard-DNSAdd Upstream Remote
git remote add upstream https://github.com/privacyguard/dns.gitInstall Dependencies
npm installCreate a Feature Branch
git checkout -b feature/your-feature-name
Development Process
Available Scripts
| Command | Description |
|---|---|
npm run dev |
Start development server with hot reload |
npm run build |
Build production-ready files |
npm run build:dev |
Build development files (unminified) |
npm test |
Run test suite with coverage |
npm run test:watch |
Run tests in watch mode |
npm run lint |
Check code for linting errors |
npm run lint:fix |
Auto-fix linting errors |
npm run format |
Format code with Prettier |
npm run clean |
Remove build artifacts |
Development Workflow
Stay Updated
git fetch upstream git merge upstream/mainMake Changes
Implement your feature or fix following our coding standards.
Test Your Changes
npm testLint and Format
npm run lint npm run formatCommit Changes
Write clear, descriptive commit messages:
feat: add new DNS server configuration panel - Added IPv6 support configuration - Implemented server status indicator - Updated documentation for new features Fixes #123Push Changes
git push origin feature/your-feature-nameSubmit Pull Request
Visit your fork on GitHub and click "New Pull Request".
Coding Standards
HTML
- Use semantic HTML5 elements
- Follow BEM naming convention for CSS classes
- Include proper ARIA attributes for accessibility
- Keep attributes in alphabetical order
CSS
- Use CSS custom properties (variables) for theming
- Follow BEM methodology for class naming
- Use modern CSS features (Grid, Flexbox, Custom Properties)
- Mobile-first responsive design
- Use meaningful class names in English
Example:
:root {
--primary-color: #0f766e;
--spacing-md: 1rem;
}
.component-name {
display: flex;
gap: var(--spacing-md);
}
.component-name__element {
color: var(--primary-color);
}
.component-name--modifier {
border: 2px solid var(--primary-color);
}
JavaScript
- Use ES2022+ features
- Prefer
constoverlet, avoidvar - Use arrow functions for callbacks
- Use async/await instead of raw Promises
- Use template literals for string interpolation
- Use destructuring for objects and arrays
- Add JSDoc comments for functions
- Handle errors with try/catch
Example:
/**
* Processes user data and returns formatted result
* @param {Object} userData - User data object
* @param {string} userData.name - User's name
* @param {string} userData.email - User's email
* @returns {Promise<Object>} Formatted user object
*/
async function processUserData({ name, email }) {
try {
const formatted = {
displayName: name.trim(),
contact: email.toLowerCase()
};
return formatted;
} catch (error) {
console.error('Failed to process user data:', error);
throw error;
}
}
Git Commits
We follow the Conventional Commits specification:
| Type | Description |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation changes |
style |
Code style changes (formatting, etc.) |
refactor |
Code refactoring |
perf |
Performance improvements |
test |
Adding or modifying tests |
chore |
Maintenance tasks |
Example Commit Messages:
feat(auth): add user authentication system
fix(dns): resolve DNS timeout issue on Windows
docs(readme): update installation instructions
style(css): format CSS according to style guide
refactor(i18n): extract translation strings to JSON
perf(loading): improve initial page load time
test(config): add unit tests for config parser
chore(deps): update webpack to version 5
Submitting Changes
Pull Request Guidelines
- Title: Use a clear, descriptive title
- Description: Explain what you changed and why
- Screenshots: Include screenshots for UI changes
- Testing: Describe how you tested your changes
- Checklist:
- Code follows our style guidelines
- Tests pass locally
- No linting errors
- Documentation updated (if applicable)
- Commits follow conventional format
Review Process
- A maintainer will review your PR within 48 hours
- You may be asked to make changes
- Once approved, your PR will be merged
Reporting Issues
Before Submitting
- Search existing issues to avoid duplicates
- Check if the issue is reproducible
- Test with the latest version
Submitting Issues
Include the following information:
- Description: Clear description of the issue
- Steps to Reproduce: Detailed steps
- Expected Behavior: What should happen
- Actual Behavior: What actually happens
- Environment: OS, browser, version
- Screenshots: If applicable
- Logs: Any relevant error messages
Security
Reporting Security Vulnerabilities
If you discover a security vulnerability, please email security@privacyguard.dns instead of opening a public issue.
Security Practices
- All dependencies are regularly audited
- Sensitive data is never committed
- Secrets are managed via environment variables
- HTTPS is required for all external connections
Questions?
If you have questions, feel free to:
- Open a GitHub Discussion
- Email us at support@privacyguard.dns
- Join our community chat
Thank you for contributing to PrivacyGuard DNS! 🛡️