Add GoReleaser configuration and version command
Some checks failed
goreleaser / goreleaser (push) Failing after 5m46s

This commit is contained in:
2025-05-23 15:41:54 +02:00
parent e1f7604439
commit a806b97b9b
5 changed files with 437 additions and 3 deletions

View File

@ -13,6 +13,12 @@ A Go-based command-line tool to manage SSH tunnels. This tool allows you to:
go install git.mvl.sh/vleeuwenmenno/sshtunnel@latest
```
You can also install a specific version:
```
go install git.mvl.sh/vleeuwenmenno/sshtunnel@v1.0.0
```
Or clone this repository and build it yourself:
```
@ -22,6 +28,8 @@ make
sudo make install
```
The build process will automatically include version information from git tags.
## Uninstallation
For installation using `go install`, run:
@ -38,6 +46,17 @@ sudo make uninstall
## Usage
### Showing version information
```
sshtunnel version
```
This will display the current version of sshtunnel along with build information.
Options:
- `-c, --check-updates`: Check for updates against the latest release
### Listing active tunnels
```
@ -111,6 +130,58 @@ This command will:
3. Validate all recorded tunnels and their current state
4. Show active SSH tunnel processes and their status
### Version information
```
sshtunnel version --check-updates
```
This displays version information and checks for updates to the tool.
When a new version is available, you'll get instructions on how to update.
### Shell completion
Generate shell completion scripts:
```
# Bash
sshtunnel completion bash > ~/.bash_completion.d/sshtunnel
source ~/.bash_completion.d/sshtunnel
# Zsh
sshtunnel completion zsh > "${fpath[1]}/_sshtunnel"
# Fish
sshtunnel completion fish > ~/.config/fish/completions/sshtunnel.fish
```
For system-wide installation:
```
# Bash (Linux)
sudo sshtunnel completion bash > /etc/bash_completion.d/sshtunnel
# Bash (macOS with Homebrew)
sshtunnel completion bash > $(brew --prefix)/etc/bash_completion.d/sshtunnel
```
## Development
### Release Process
The project includes a release script to help manage version tags:
```
./bin/scripts/release.sh
```
This script will:
1. Find the latest version tag
2. Suggest the next patch version (e.g., v1.0.0 → v1.0.1)
3. Allow you to accept this suggestion or enter a custom version
4. Create and push the new tag
5. Update the "latest" tag to point to the new version
## How it works
The tool creates SSH tunnels using the system's SSH client and manages them by tracking their process IDs in a hidden directory (`~/.sshtunnels/`). Each tunnel is assigned a unique ID for easy management. Traffic statistics are collected and stored to help you monitor data transfer through your tunnels.