You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add SSH remote terminal support to web interface (#352)
Adds SSH-based remote terminal access to the web chat interface. Users
can now connect to remote servers via SSH, with auto-installation of the
infer binary. Includes a Docker Compose example demonstrating both local
and remote modes.
## Summary of Changes
This PR enables users to:
1. Connect to remote servers via SSH from the web terminal
2. Auto-install infer binary on remote servers when missing
3. Switch between local and remote servers via a dropdown
4. Use portable Linux binaries (CGO-free) for better compatibility
5. Test with a complete Docker Compose example
## Key Features
### SSH Remote Mode
- Added ability to connect to remote servers via SSH from the web
terminal
- Secure authentication with SSH keys or passwords
- Persistent connections with session management
### Auto-installation
- Automatically installs `infer` binary on remote servers if missing
- Supports multiple architectures and operating systems
- Fallback mechanisms for installation failures
### Web Terminal Enhancements
- Added server selection dropdown in the web interface
- Support for multiple concurrent server connections
- Improved error handling and user feedback
### Portable Linux Builds
- Changed Linux builds to use CGO_ENABLED=0 for maximum compatibility
- Statically linked binaries that work on any Linux distribution
- Reduced dependency requirements on target systems
### Docker Compose Example
- Complete example with local + remote Ubuntu server setup
- Environment configuration templates
- Step-by-step documentation in README.md
## Technical Details
### New Files:
- `internal/web/ssh_client.go` - SSH client implementation
- `internal/web/ssh_session.go` - SSH session management
- `internal/web/remote_installer.go` - Remote binary installation
- `examples/web-terminal/` - Complete example setup
### Modified Files:
- `cmd/chat.go` - Added SSH mode flag and configuration
- `internal/web/server.go` - Enhanced web server with SSH support
- `internal/web/session_manager.go` - Multi-server session management
- `internal/web/static/app.js` - Frontend server selection UI
- `internal/web/templates/index.html` - Updated HTML template
- Build configuration updates for portable binaries
## Testing
The included Docker Compose example provides a complete test
environment:
- Local infer instance for direct testing
- Remote Ubuntu server for SSH testing
- Pre-configured environment variables
- Step-by-step setup instructions
## Compatibility
- Backward compatible with existing local mode
- Works with any SSH-compatible server (Linux, macOS, BSD)
- Supports both password and key-based authentication
- Portable binaries work on glibc and musl-based systems
---------
Signed-off-by: Eden Reich <[email protected]>
Co-authored-by: semantic-release-bot <[email protected]>
0 commit comments