Skip to content

Commit 04806ca

Browse files
committed
Initial commit
0 parents  commit 04806ca

28 files changed

Lines changed: 4934 additions & 0 deletions

.github/workflows/release.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
name: Build binaries
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
include:
18+
- os: windows-latest
19+
goos: windows
20+
goarch: amd64
21+
output: shellshare-windows-amd64.exe
22+
- os: ubuntu-latest
23+
goos: linux
24+
goarch: amd64
25+
output: shellshare-linux-amd64
26+
- os: macos-latest
27+
goos: darwin
28+
goarch: amd64
29+
output: shellshare-darwin-amd64
30+
- os: macos-latest
31+
goos: darwin
32+
goarch: arm64
33+
output: shellshare-darwin-arm64
34+
35+
steps:
36+
- name: Checkout code
37+
uses: actions/checkout@v4
38+
39+
- name: Set up Go
40+
uses: actions/setup-go@v5
41+
with:
42+
go-version: '1.21'
43+
44+
- name: Download dependencies
45+
run: go mod download
46+
47+
- name: Build binary
48+
env:
49+
GOOS: ${{ matrix.goos }}
50+
GOARCH: ${{ matrix.goarch }}
51+
run: go build -o ${{ matrix.output }} ./cmd/shellshare
52+
53+
- name: Upload artifact
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: ${{ matrix.output }}
57+
path: ${{ matrix.output }}
58+
59+
release:
60+
name: Create release
61+
needs: build
62+
runs-on: ubuntu-latest
63+
steps:
64+
- name: Download all artifacts
65+
uses: actions/download-artifact@v4
66+
with:
67+
path: binaries
68+
69+
- name: Create release
70+
uses: softprops/action-gh-release@v1
71+
with:
72+
files: binaries/**/*
73+
draft: false
74+
prerelease: false
75+
env:
76+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Binaries
2+
shellshare
3+
shellshare.exe
4+
bin/
5+
*.exe
6+
*.dll
7+
*.so
8+
*.dylib
9+
10+
# Test binary
11+
*.test
12+
13+
# Output of go coverage tool
14+
*.out
15+
16+
# Go workspace file
17+
go.work
18+
19+
# Build cache
20+
.gocache/
21+
22+
# Session recordings
23+
*.log
24+
session.log
25+
26+
# Config files (user-specific)
27+
config.toml
28+
29+
# IDE
30+
.vscode/
31+
.idea/
32+
*.swp
33+
*.swo
34+
*~
35+
36+
# OS
37+
.DS_Store
38+
Thumbs.db

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Masic
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# ShellShare
2+
3+
Terminal sharing with end-to-end encryption. Host a shell session, guests connect and view in real-time.
4+
5+
## Features
6+
7+
- End-to-end encryption (Curve25519 key exchange, AES-GCM)
8+
- Direct P2P connections with relay fallback
9+
- Read-only guests by default, host can grant write access
10+
- Session recording to file
11+
- Port forwarding through encrypted channel
12+
- Cross-platform: Windows (ConPTY), Linux, macOS (PTY)
13+
- Self-hosted signaling server
14+
- Single static binary
15+
16+
## Installation
17+
18+
```bash
19+
git clone https://github.com/GH05TCREW/shellshare
20+
cd shellshare
21+
go build -o shellshare cmd/shellshare/main.go
22+
```
23+
24+
## Usage
25+
26+
### Start signaling server
27+
28+
```bash
29+
shellshare serve --addr :7777
30+
```
31+
32+
### Host a session
33+
34+
```bash
35+
shellshare host --server ws://localhost:7777/ws
36+
```
37+
38+
Prints session ID and join command. Session is read-only by default.
39+
40+
Options:
41+
- `--allow-write` - Allow guests to type
42+
- `--name <name>` - Set host name
43+
- `--record <file>` - Record session to file
44+
- `--forward-target <host:port>` - Expose local service to guests
45+
- `--session <id>` - Use custom session ID
46+
47+
### Join a session
48+
49+
```bash
50+
shellshare guest <session-id> --server ws://localhost:7777/ws
51+
```
52+
53+
Options:
54+
- `--user <name>` - Set guest name
55+
- `--forward-listen <:port>` - Access host's forwarded service locally
56+
57+
### List sessions
58+
59+
```bash
60+
shellshare list --server ws://localhost:7777/ws
61+
```
62+
63+
### Host commands
64+
65+
Type these in the host terminal:
66+
- `/grant <user|*>` - Grant write access
67+
- `/revoke <user|*>` - Revoke write access
68+
- `/who` - List connected guests
69+
- `/quit` - End session
70+
71+
## Configuration
72+
73+
Optional `~/.shellshare/config.toml`:
74+
75+
```toml
76+
[server]
77+
signaling_url = "ws://localhost:7777/ws"
78+
79+
[security]
80+
auto_approve_guests = false
81+
fingerprint_verification = true
82+
session_timeout = 3600
83+
84+
[display]
85+
show_join_notifications = true
86+
color_scheme = "auto"
87+
```
88+
89+
Environment variables:
90+
- `SHELLSHARE_SIGNALING_URL`
91+
- `SHELLSHARE_NAME`
92+
- `SHELLSHARE_ALLOW_WRITE`
93+
- `SHELLSHARE_READ_ONLY`
94+
95+
## How it works
96+
97+
1. Host and guests connect to signaling server via WebSocket
98+
2. Curve25519 key exchange establishes shared secret per guest
99+
3. Host attempts direct TCP connection to each guest
100+
4. Falls back to relay through signaling server if direct fails
101+
5. Terminal data encrypted with AES-GCM before transmission
102+
6. Server cannot decrypt traffic (end-to-end encryption)
103+
104+
## Port forwarding
105+
106+
Host exposes a local service:
107+
```bash
108+
shellshare host --forward-target localhost:8080
109+
```
110+
111+
Guest accesses it:
112+
```bash
113+
shellshare guest <session-id> --forward-listen :8080
114+
# Now localhost:8080 on guest connects to host's service
115+
```
116+
117+
## Session recording
118+
119+
Host records all output:
120+
```bash
121+
shellshare host --record session.log
122+
```
123+
124+
Replay:
125+
```bash
126+
cat session.log
127+
```
128+
129+
## Security
130+
131+
- Each guest gets unique encryption key
132+
- Signaling server only routes encrypted envelopes
133+
- Fingerprint verification on connection
134+
- Host controls write permissions per guest
135+
- No plaintext transmission
136+
137+
## License
138+
139+
MIT
140+

0 commit comments

Comments
 (0)