Skip to content

Commit 823d985

Browse files
committed
Initial
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
0 parents  commit 823d985

File tree

9 files changed

+429
-0
lines changed

9 files changed

+429
-0
lines changed

Diff for: .github/workflows/build.yaml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
jobs:
12+
build:
13+
concurrency:
14+
group: ${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
runs-on: ubuntu-latest
18+
steps:
19+
# vmmeter start
20+
- uses: alexellis/arkade-get@master
21+
with:
22+
crane: latest
23+
print-summary: false
24+
25+
- uses: docker/setup-buildx-action@v3
26+
27+
- uses: actions/checkout@master
28+
29+
- name: Set up QEMU
30+
uses: docker/setup-qemu-action@v3
31+
32+
- name: Get git commit
33+
id: get_git_commit
34+
run: echo "GIT_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
35+
- name: Get version
36+
id: get_version
37+
run: echo "VERSION=$(git describe --tags --dirty)" >> $GITHUB_ENV
38+
- name: Get Repo Owner
39+
id: get_repo_owner
40+
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" > $GITHUB_ENV
41+
42+
- name: Build containers
43+
uses: docker/build-push-action@v5
44+
with:
45+
context: .
46+
file: ./Dockerfile
47+
outputs: "type=image,push=false"
48+
platforms: linux/amd64,linux/arm64
49+
build-args: |
50+
GIT_COMMIT=${{env.GIT_COMMIT}}
51+
VERSION=${{env.VERSION}}
52+
tags: |
53+
ghcr.io/${{ env.REPO_OWNER }}/slicer-ssh-agent:${{ github.sha }}

Diff for: .github/workflows/publish.yaml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: docker/setup-buildx-action@v3
13+
- uses: actions/checkout@master
14+
15+
- name: Set up QEMU
16+
uses: docker/setup-qemu-action@v3
17+
18+
- name: Get TAG
19+
id: get_tag
20+
run: echo TAG=${GITHUB_REF#refs/tags/} >> $GITHUB_ENV
21+
22+
- name: Get git commit
23+
id: get_git_commit
24+
run: echo "GIT_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
25+
- name: Get version
26+
id: get_version
27+
run: echo "VERSION=$(git describe --tags --dirty)" >> $GITHUB_ENV
28+
- name: Get Repo Owner
29+
id: get_repo_owner
30+
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" > $GITHUB_ENV
31+
32+
- name: Login to Docker Registry
33+
uses: docker/login-action@v3
34+
with:
35+
username: ${{ github.repository_owner }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
registry: ghcr.io
38+
39+
- name: Push containers
40+
uses: docker/build-push-action@v5
41+
with:
42+
context: .
43+
file: ./Dockerfile
44+
outputs: "type=registry,push=true"
45+
platforms: linux/amd64,linux/arm64
46+
build-args: |
47+
GIT_COMMIT=${{env.GIT_COMMIT}}
48+
VERSION=${{env.VERSION}}
49+
tags: |
50+
ghcr.io/${{ env.REPO_OWNER }}/slicer-ssh-agent:${{ github.sha }}
51+
ghcr.io/${{ env.REPO_OWNER }}/slicer-ssh-agent:${{ env.TAG }}
52+
ghcr.io/${{ env.REPO_OWNER }}/slicer-ssh-agent:latest

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/slicer-ssh-agent
2+
/bin/**

Diff for: LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Alex Ellis, OpenFaaS Ltd
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.

Diff for: Makefile

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
IMAGE=slicer-ssh-agent
2+
OWNER=alexellis2
3+
SERVER=ttl.sh
4+
TAG=latest
5+
LDFLAGS := "-s -w"
6+
7+
dist:
8+
GOOS=linux GOARCH=amd64 go build -ldflags $(LDFLAGS) -o bin/slicer-ssh-agent .
9+
10+
dist-all:
11+
GOOS=linux GOARCH=amd64 go build -ldflags $(LDFLAGS) -o bin/slicer-ssh-agent .
12+
GOOS=linux GOARCH=arm64 go build -ldflags $(LDFLAGS) -o bin/slicer-ssh-agent-arm64 .
13+
14+
publish:
15+
docker buildx build -t $(SERVER)/$(OWNER)/$(IMAGE):$(TAG) . \
16+
--platform linux/amd64,linux/arm64 \
17+
--push
18+

Diff for: README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
slicer-ssh-agent
2+
===================
3+
4+
This agent listens for traffic over VSock and forwards it to a local bash session.
5+
6+
The traffic originates from an SSH session from the host machine.
7+
8+
Status: experimental

Diff for: go.mod

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module slicer-ssh-agent
2+
3+
go 1.23.4
4+
5+
require (
6+
github.com/creack/pty v1.1.24
7+
github.com/mdlayher/vsock v1.2.1
8+
)
9+
10+
require (
11+
github.com/mdlayher/socket v0.4.1 // indirect
12+
golang.org/x/net v0.9.0 // indirect
13+
golang.org/x/sync v0.1.0 // indirect
14+
golang.org/x/sys v0.7.0 // indirect
15+
)

Diff for: go.sum

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s=
2+
github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE=
3+
github.com/mdlayher/socket v0.4.1 h1:eM9y2/jlbs1M615oshPQOHZzj6R6wMT7bX5NPiQvn2U=
4+
github.com/mdlayher/socket v0.4.1/go.mod h1:cAqeGjoufqdxWkD7DkpyS+wcefOtmu5OQ8KuoJGIReA=
5+
github.com/mdlayher/vsock v1.2.1 h1:pC1mTJTvjo1r9n9fbm7S1j04rCgCzhCOS5DY0zqHlnQ=
6+
github.com/mdlayher/vsock v1.2.1/go.mod h1:NRfCibel++DgeMD8z/hP+PPTjlNJsdPOmxcnENvE+SE=
7+
golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM=
8+
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
9+
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
10+
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
11+
golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
12+
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

0 commit comments

Comments
 (0)