fix
This commit is contained in:
parent
c41ef4ba88
commit
6d4f96cabb
5 changed files with 11 additions and 13 deletions
6
.env
Normal file
6
.env
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
HOST="https://chisel.example.com"
|
||||||
|
LOCAL_PORT="8080"
|
||||||
|
REMOTE_PORT="8080"
|
||||||
|
USER="user"
|
||||||
|
TOKEN="token"
|
||||||
|
PROTOCOL="tcp"
|
|
@ -11,7 +11,7 @@ RUN go build -o chisel main.go
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
|
||||||
RUN apk update && apk upgrade && \
|
RUN apk update && apk upgrade && \
|
||||||
apk add --no-cache socat bash
|
apk add --no-cache bash
|
||||||
|
|
||||||
COPY --from=builder /chisel/chisel /usr/bin/chisel
|
COPY --from=builder /chisel/chisel /usr/bin/chisel
|
||||||
COPY ./entrypoint.sh /entrypoint.sh
|
COPY ./entrypoint.sh /entrypoint.sh
|
||||||
|
|
|
@ -3,14 +3,13 @@ This container allows to forward a local port to a remote system running chisel
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
- Load Balancing
|
- Load Balancing
|
||||||
- Error Handling
|
|
||||||
- UDP
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
The container is configured through environment variables:
|
The container is configured through environment variables:
|
||||||
- `$HOST`: The host running chisel server
|
- `$HOST`: The host running chisel server
|
||||||
- `$LOCAL_PORT`: The local port to forward
|
|
||||||
- `$LOCAL_HOST`: The local host address
|
- `$LOCAL_HOST`: The local host address
|
||||||
|
- `$LOCAL_PORT`: The local port to forward
|
||||||
- `$REMOTE_PORT`: The remote port to expose the forward on
|
- `$REMOTE_PORT`: The remote port to expose the forward on
|
||||||
- `$USER`: Authentication User
|
- `$USER`: Authentication User
|
||||||
- `$TOKEN`: Authentication Token
|
- `$TOKEN`: Authentication Token
|
||||||
|
- `$PROTOCOL`: The protocol to use (`tcp` / `udp`)
|
||||||
|
|
|
@ -2,9 +2,4 @@ services:
|
||||||
forward:
|
forward:
|
||||||
build: .
|
build: .
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
env_file: .env
|
||||||
HOST: "https://chisel.example.com"
|
|
||||||
LOCAL_PORT: "8080"
|
|
||||||
REMOTE_PORT: "8080"
|
|
||||||
USER: "user"
|
|
||||||
TOKEN: "token"
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
socat TCP4-LISTEN:$LOCAL_PORT,fork,reuseaddr TCP4:TCP4:$LOCAL_HOST:$LOCAL_PORT &
|
chisel client --auth "$USER:$TOKEN" "$HOST" "R:0.0.0.0:$REMOTE_PORT:$LOCAL_HOST:$LOCAL_PORT/${PROTOCOL:-tcp}"
|
||||||
chisel client --auth "$USER:$TOKEN" "$HOST" "R:$LOCAL_HOST:$LOCAL_PORT:127.0.0.1:$REMOTE_PORT" &
|
|
||||||
wait
|
|
||||||
|
|
Loading…
Reference in a new issue