init
This commit is contained in:
commit
c41ef4ba88
4 changed files with 49 additions and 0 deletions
18
Dockerfile
Normal file
18
Dockerfile
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
FROM alpine:latest AS builder
|
||||||
|
|
||||||
|
RUN apk update && apk upgrade && \
|
||||||
|
apk add --no-cache go git
|
||||||
|
|
||||||
|
WORKDIR /
|
||||||
|
RUN git clone "https://github.com/jpillora/chisel"
|
||||||
|
WORKDIR /chisel
|
||||||
|
RUN go build -o chisel main.go
|
||||||
|
|
||||||
|
FROM alpine:latest
|
||||||
|
|
||||||
|
RUN apk update && apk upgrade && \
|
||||||
|
apk add --no-cache socat bash
|
||||||
|
|
||||||
|
COPY --from=builder /chisel/chisel /usr/bin/chisel
|
||||||
|
COPY ./entrypoint.sh /entrypoint.sh
|
||||||
|
CMD ["/bin/bash", "/entrypoint.sh"]
|
16
README.md
Normal file
16
README.md
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# Chisel Forward
|
||||||
|
This container allows to forward a local port to a remote system running chisel server.
|
||||||
|
|
||||||
|
# TODO
|
||||||
|
- Load Balancing
|
||||||
|
- Error Handling
|
||||||
|
- UDP
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
The container is configured through environment variables:
|
||||||
|
- `$HOST`: The host running chisel server
|
||||||
|
- `$LOCAL_PORT`: The local port to forward
|
||||||
|
- `$LOCAL_HOST`: The local host address
|
||||||
|
- `$REMOTE_PORT`: The remote port to expose the forward on
|
||||||
|
- `$USER`: Authentication User
|
||||||
|
- `$TOKEN`: Authentication Token
|
10
docker-compose.yml
Normal file
10
docker-compose.yml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
services:
|
||||||
|
forward:
|
||||||
|
build: .
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
HOST: "https://chisel.example.com"
|
||||||
|
LOCAL_PORT: "8080"
|
||||||
|
REMOTE_PORT: "8080"
|
||||||
|
USER: "user"
|
||||||
|
TOKEN: "token"
|
5
entrypoint.sh
Normal file
5
entrypoint.sh
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
socat TCP4-LISTEN:$LOCAL_PORT,fork,reuseaddr TCP4:TCP4:$LOCAL_HOST:$LOCAL_PORT &
|
||||||
|
chisel client --auth "$USER:$TOKEN" "$HOST" "R:$LOCAL_HOST:$LOCAL_PORT:127.0.0.1:$REMOTE_PORT" &
|
||||||
|
wait
|
Loading…
Reference in a new issue