Skip to content

Commit 70ead62

Browse files
committed
refactor: docker and image changes
1 parent 14cb6ad commit 70ead62

File tree

6 files changed

+25
-71
lines changed

6 files changed

+25
-71
lines changed

.github/workflows/build.yml

+1-7
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,4 @@ jobs:
2525
with:
2626
file: ./Dockerfile
2727
push: true
28-
tags: ghcr.io/picosh/ptun/imgs:latest
29-
- name: Build and push
30-
uses: docker/build-push-action@v5
31-
with:
32-
file: ./Dockerfile.autossh
33-
push: true
34-
tags: ghcr.io/picosh/ptun/autossh:latest
28+
tags: ghcr.io/picosh/tunkit/autossh:latest

Dockerfile

+5-13
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
1-
FROM golang:1.21-alpine
2-
3-
WORKDIR /app
4-
5-
COPY go.* .
6-
7-
RUN go mod download
8-
9-
COPY . .
10-
11-
RUN go build -o docker cmd/docker/main.go
12-
13-
CMD [ "/app/docker" ]
1+
FROM alpine:3.19
2+
RUN apk update \
3+
&& apk add --no-cache autossh ca-certificates bash curl
4+
COPY entrypoint.sh /entrypoint.sh
5+
ENTRYPOINT ["/entrypoint.sh"]

Dockerfile.autossh

-5
This file was deleted.

Makefile

+1-21
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,11 @@ lint:
66
golangci-lint run -E goimports -E godot --timeout 10m
77
.PHONY: lint
88

9-
build-example:
10-
go build -o ./build/example ./cmd/example
11-
.PHONY: build
12-
13-
build-docker:
14-
go build -o ./build/docker ./cmd/docker
15-
.PHONY: build-docker
16-
17-
build-pubsub:
18-
go build -o ./build/pub ./cmd/pubsub/pub
19-
go build -o ./build/sub ./cmd/pubsub/sub
20-
.PHONY: build-pubsub
21-
229
tunnel:
23-
ssh -L 0.0.0.0:5000:localhost:80 \
10+
ssh -L 0.0.0.0:1338:localhost:80 \
2411
-p 2222 \
2512
-o UserKnownHostsFile=/dev/null \
2613
-o StrictHostKeyChecking=no \
2714
-N \
2815
localhost
2916
.PHONY: tunnel
30-
31-
tunnel-prod:
32-
ssh -L 0.0.0.0:1338:localhost:1338 -N imgs.sh
33-
# docker pull ubuntu
34-
# docker tag ubuntu localhost:1338/ubuntu
35-
# docker push localhost:1338/ubuntu
36-
.PHONY: tunnel

README.md

+18-12
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
# Passwordless authentication
88

99
The end-user creates a local forward SSH tunnel to a service running `tunkit`.
10-
`tunkit` spins up a dedicated web service for that tunnel -- using a unix socket.
11-
Then the user can access that web service using `localhost`. The web service can
12-
then access the SSH context in order to know who the user is and what they are
13-
authorized to do within the web service.
10+
`tunkit` spins up a dedicated web service for that tunnel -- using a unix
11+
socket. Then the user can access that web service using `localhost`. The web
12+
service can then access the SSH context in order to know who the user is and
13+
what they are authorized to do within the web service.
1414

1515
## Why?
1616

@@ -35,20 +35,26 @@ Use an SSH tunnels for "webhooks":
3535

3636
## Why?
3737

38-
The biggest benefit is the user's http server is not public. There's zero
38+
The biggest benefit is the user's http server is not public. There's zero
3939
concern for malicious actors or bots trying to hit a user's event endpoints.
40-
This dramatically reduces the infrastructure requirements for the end-user.
41-
They just need to start an http server and initial a tunnel to a service.
40+
This dramatically reduces the infrastructure requirements for the end-user. They
41+
just need to start an http server and initial a tunnel to a service.
4242

43-
# Development
43+
# Examples
44+
45+
Checkout our examples folder.
4446

4547
```bash
46-
make example
47-
./build/example
48+
go run ./cmd/example
4849
```
4950

5051
```bash
51-
make tunnel
52+
ssh -L 0.0.0.0:1338:localhost:80 \
53+
-p 2222 \
54+
-o UserKnownHostsFile=/dev/null \
55+
-o StrictHostKeyChecking=no \
56+
-N \
57+
localhost
5258
```
5359

54-
Go to http://localhost:5000
60+
Go to http://localhost:1338

docker-compose.yml

-13
This file was deleted.

0 commit comments

Comments
 (0)