Thank you for considering contributing to the SSH Test Server project! This document provides guidelines and information for contributors.
- Code of Conduct
- Getting Started
- Development Workflow
- Commit Message Convention
- Release Process
- Testing
- Code Style Guidelines
- Pull Request Guidelines
- Documentation
- Security
- Questions and Support
This project adheres to a professional and welcoming environment. All contributors are expected to be respectful and constructive in their interactions.
- Docker and Docker Compose
- Git
- Basic understanding of SSH, Docker, and shell scripting
- For testing:
sshpass,ssh-keygen,netcat
-
Fork and Clone the Repository
git clone https://github.com/YOUR-USERNAME/ssh-test-server.git cd ssh-test-server -
Build the Development Image
make build # or docker build -f docker/Dockerfile -t ssh-test-server:dev .
-
Run Basic Tests
make test # or ./tests/integration/run-tests.sh --image ssh-test-server:dev
- main: Stable release branch
- develop: Development branch (optional for small projects)
- feature/: New features (
feature/new-auth-method) - fix/: Bug fixes (
fix/env-var-validation) - docs/: Documentation updates (
docs/update-readme)
-
Create a Feature Branch
git checkout -b feature/your-feature-name
-
Make Your Changes
- Follow the Code Style Guidelines
- Add tests for new functionality
- Update documentation as needed
-
Test Your Changes
# Run integration tests make test # Test specific scenarios make test-connection make test-auth # Test with different configurations docker-compose --profile basic up -d ./scripts/test-connection.sh --host localhost --port 2222 --user testuser --password testpass123
-
Commit Your Changes (see Commit Message Convention)
-
Push and Create Pull Request
git push origin feature/your-feature-name
This project uses Conventional Commits to automate changelog generation and semantic versioning. All commit messages MUST follow this format:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
| Type | Description | Version Impact |
|---|---|---|
feat |
New feature | Minor (0.1.0) |
fix |
Bug fix | Patch (0.0.1) |
docs |
Documentation only | None |
style |
Code style changes (formatting, etc.) | None |
refactor |
Code refactoring without feature/bug changes | None |
perf |
Performance improvements | Patch |
test |
Adding or updating tests | None |
build |
Build system changes | None |
ci |
CI/CD changes | None |
chore |
Other changes (maintenance, dependencies) | None |
revert |
Revert previous commit | None |
Add ! after the type to indicate breaking changes (triggers major version bump):
feat!: change default SSH port from 22 to 2222
fix!: remove deprecated SSH_LEGACY_AUTH environment variableGood commit messages:
feat: add support for Ed25519 host keys
fix: resolve container startup race condition with SSH daemon
docs: update README with new authentication examples
test: add integration tests for keyboard-interactive auth
ci: add security scanning with Trivy
refactor: simplify entrypoint script environment validation
perf: optimize Docker image layer cachingBad commit messages:
update readme # Missing type
fixed bug # Too vague, missing scope
feat add new feature # Missing colon
FIX: broken tests # Type should be lowercasefeat(auth): add multi-factor authentication supportfix(docker): resolve Alpine package installation issuedocs(api): update environment variable referencetest(integration): add cross-platform compatibility tests
This project uses Release Please for automated releases:
- Commit with Conventional Messages: When you commit using conventional commit format, Release Please analyzes the commits
- Automatic PR Creation: Release Please creates a "release PR" that:
- Updates the CHANGELOG.md
- Bumps the version in version.txt
- Prepares the release notes
- Manual Release: A maintainer reviews and merges the release PR
- Automated Publishing: The merge triggers:
- Git tag creation
- GitHub release creation
- Docker image building and publishing
Based on conventional commits:
feat:→ Minor version bump (0.1.0 → 0.2.0)fix:,perf:→ Patch version bump (0.1.0 → 0.1.1)feat!:,fix!:, etc. → Major version bump (0.1.0 → 1.0.0)docs:,test:,chore:→ No version bump
For Maintainers: To enable release automation, you need to set up a GitHub Personal Access Token:
- Create PAT: Go to GitHub Settings → Developer settings → Personal access tokens
- Required Scopes:
repo,workflow - Add to Repository: Go to repo Settings → Secrets and variables → Actions
- Add Secret: Name it
RELEASE_PLEASE_TOKENwith your PAT value
- Integration Tests: Full container testing with various configurations
- Connection Tests: Basic SSH connectivity validation
- Authentication Tests: Multi-method authentication verification
- Security Tests: Security hardening validation
- Performance Tests: Container startup and connection performance
# Full test suite
make test
./tests/integration/run-tests.sh --image ssh-test-server:dev
# Parallel testing (faster)
make test-parallel
# Specific test categories
make test-connection # Basic connectivity
make test-auth # Authentication methods
make test-security # Security configurations
# Manual testing with Docker Compose
docker-compose --profile basic up -d
docker-compose --profile hardened up -dWhen adding new features:
- Add Integration Tests: Update
tests/integration/run-tests.sh - Test Edge Cases: Include failure scenarios
- Document Test Scenarios: Update test documentation
- Validate Across Platforms: Ensure AMD64 and ARM64 compatibility
- Use
#!/bin/shfor maximum compatibility - Follow POSIX shell standards
- Use
shellcheckfor linting:find . -name "*.sh" -type f -exec shellcheck {} \;
- Use meaningful variable names with UPPER_CASE for environment variables
- Add error checking:
set -efor scripts that should fail fast
- Use multi-stage builds when appropriate
- Minimize image layers
- Use specific base image versions (not
latest) - Follow Docker best practices for security
- Add labels for metadata
- Use clear, concise language
- Include code examples
- Update README when adding features
- Document environment variables completely
- Branch name follows convention (
feat/,fix/,docs/) - Commits follow conventional commit format
- All tests pass locally
- Documentation updated if needed
- CHANGELOG.md updated for significant changes (optional, as Release Please will handle this)
- Title: Use conventional commit format
- Description: Include:
- What changes were made and why
- How to test the changes
- Any breaking changes or migration notes
- Link to related issues
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that causes existing functionality to change)
- [ ] Documentation update
## Testing
- [ ] Integration tests pass
- [ ] Manual testing completed
- [ ] New tests added for new functionality
## Checklist
- [ ] Code follows project style guidelines
- [ ] Self-review completed
- [ ] Documentation updated
- [ ] Conventional commit format used- Automated Checks: CI tests must pass
- Code Review: At least one maintainer review required
- Testing: Reviewers may request additional testing
- Approval: Maintainer approval required for merge
- New environment variables
- Configuration changes
- API/interface changes
- Deployment procedures
- Troubleshooting guides
- README.md: High-level overview and quick start
- CONTRIBUTING.md: This file - development guidelines
- Docker comments: Document Dockerfile steps
- Script comments: Explain complex shell script logic
- Environment variables: Document in README and code
DO NOT open GitHub issues for security vulnerabilities. Instead:
- Email the maintainer directly (if provided)
- Use GitHub's private vulnerability reporting
- Include:
- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fixes (if any)
- Never commit secrets, tokens, or passwords
- Use minimal privileges in container configurations
- Validate all user inputs (environment variables)
- Follow security best practices for SSH configurations
- Regularly update base images and dependencies
- Run security scans:
make security-scan - Test with hardened configurations
- Validate input sanitization
- Check for privilege escalation issues
- GitHub Issues: Bug reports and feature requests
- GitHub Discussions: General questions and community support
- Documentation: Check README.md and inline code comments
When creating issues, use the provided templates:
- Bug Report: For reporting bugs
- Feature Request: For requesting new features
- Documentation: For documentation improvements
- Question: For general questions
This is a community-maintained project. Response times may vary:
- Critical bugs: Best effort within 48 hours
- Features: Review within 1 week
- Documentation: Review within 1 week
- Questions: Community support as available
Your contributions make this project better for everyone. Whether it's code, documentation, testing, or community support - all contributions are valued and appreciated!