Contributing Guide¶
Thank you for your interest in contributing to SSH Tunnel Manager! This guide will help you get started.
Getting Started¶
Prerequisites¶
- Docker and Docker Compose
- Git
- Basic knowledge of SSH and shell scripting
- Go (for web panel development)
Setting Up Development Environment¶
-
Clone the repository:
-
Build the development containers:
-
Run the development environment:
Project Structure¶
autossh-tunnel-dockerized/
├── compose.yaml # Production Docker Compose
├── compose.dev.yaml # Development Docker Compose
├── Dockerfile # Autossh container
├── Dockerfile.web # Web panel container
├── entrypoint.sh # Main entrypoint script
├── autossh-cli # CLI tool
├── scripts/
│ ├── api_server.sh # HTTP API server
│ ├── config_parser.sh # Configuration parser
│ ├── logger.sh # Logging utilities
│ ├── start_autossh.sh # Tunnel starter
│ └── state_manager.sh # State management
├── web/
│ ├── main.go # Web server (static files + WebSocket proxy)
│ ├── templates/ # HTML templates
│ │ ├── index.html
│ │ ├── help.html
│ │ └── tunnel-detail.html
│ └── static/ # CSS, JS, locales
│ ├── script.js
│ ├── style.css
│ ├── terminal.js # xterm.js terminal modal logic
│ ├── terminal.css # Terminal modal styles
│ ├── tunnel-detail.js
│ ├── tunnel-detail.css
│ ├── locales/ # i18n language files
│ └── vendor/xterm/ # Bundled xterm.js library
└── config/
└── config.yaml.sample
Development Workflow¶
Making Changes¶
-
Create a feature branch:
-
Make your changes
-
Test your changes:
-
Commit your changes:
-
Push and create a pull request
Code Style¶
Shell Scripts¶
-
Use
shfmtfor formatting: -
Follow POSIX shell conventions where possible
-
Use meaningful variable names
-
Add comments for complex logic
Go Code¶
-
Use
gofmtfor formatting: -
Follow Go best practices
-
Add documentation comments for exported functions
Documentation¶
-
Use clear, concise language
-
Include code examples where helpful
-
Keep documentation up to date with code changes
Testing¶
Manual Testing¶
-
Start the development environment:
-
Test CLI commands:
-
Test web panel at http://localhost:5000
-
Test API endpoints:
Testing Checklist¶
- [ ] Tunnel creation works
- [ ] Tunnel deletion works
- [ ] Start/stop individual tunnels
- [ ] Start/stop all tunnels
- [ ] Configuration changes apply correctly
- [ ] Web panel displays correctly
- [ ] Language switching works
- [ ] Dark/light theme switching works
- [ ] API endpoints respond correctly
- [ ] Interactive auth via CLI works
- [ ] Interactive auth via in-browser terminal works (when ws-server configured)
Submitting Changes¶
Pull Request Guidelines¶
-
Title: Use a clear, descriptive title
-
Description: Include:
- What changes were made
- Why the changes were made
-
How to test the changes
-
Size: Keep PRs focused and reasonably sized
-
Tests: Ensure all functionality works
Commit Messages¶
Use clear, descriptive commit messages:
Add individual tunnel control API
- Add start-tunnel and stop-tunnel CLI commands
- Implement HTTP API endpoints /start/<hash> and /stop/<hash>
- Update state management for individual tunnel control
Reporting Issues¶
When reporting issues, please include:
-
Description: Clear description of the problem
-
Steps to Reproduce: How to reproduce the issue
-
Expected Behavior: What should happen
-
Actual Behavior: What actually happens
-
Environment:
- OS and version
- Docker version
-
Browser (for web panel issues)
-
Logs: Relevant log output (with sensitive data removed)
Feature Requests¶
For feature requests:
-
Check existing issues first
-
Describe the feature clearly
-
Explain the use case
-
Consider implementation complexity
Questions¶
If you have questions:
-
Check the documentation first
-
Search existing issues
-
Open a new issue with the "question" label
License¶
By contributing, you agree that your contributions will be licensed under the MIT License.