Sign inSign up

shilazi/tunelo

By shilazi

Updated about 3 years ago

https://github.com/mehdieidi/tunelo

Image
0

124

shilazi/tunelo repository overview

A simple image for tunelo

Dockerfile

FROM golang:1.20-alpine3.18

ENV GO111MODULE=on
ENV PROJECT_NAME=tunelo
ENV GIT_REPO=https://github.com/mehdieidi/${PROJECT_NAME}.git

WORKDIR /go/src/

RUN set -x \
    && apk add git ca-certificates

RUN set -x \
    && git clone --depth=1 ${GIT_REPO} \
    && cd ${PROJECT_NAME}/ \
    && go mod tidy

RUN set -x \
    && cd ${PROJECT_NAME}/ \
    && CGO_ENABLED=0 GOOS=linux \
        go build -o /tmp/${PROJECT_NAME} cmd/main.go

# ---------- 8< ----------

FROM alpine:3.18.3

# length must equal 32
# https://github.com/golang/crypto/blob/master/chacha20poly1305/chacha20poly1305.go#L17
ENV SECRET_KEY=cef55728079e8c46b73a4e2fcae31dba

RUN set -x \
    # https://github.com/mehdieidi/tunelo/blob/main/cmd/main.go#L70-L73 \
    && touch .env \
    && apk add --no-cache bash ca-certificates

COPY --from=0 /tmp/tunelo /usr/bin/tunelo

ENTRYPOINT ["tunelo"]

Usage

Server
version: '3.9'

services:
  tunelo:
    image: shilazi/tunelo:v0.2.0
    container_name: tunelo
    command: -s -vpn_port 4000 -server_ip 0.0.0.0 -server_port 4001
    environment:
      SECRET_KEY: cef55728079e8c46b73a4e2fcae31dba
    network_mode: host
    restart: unless-stopped
Client
touch .env
export SECRET_KEY=cef55728079e8c46b73a4e2fcae31dba
tunelo -server_ip ${VPS_IP} -server_port 4001 -client_port 4000 -vpn_port 4000

Doubt

In my case, it does not work well. If you need help, please goto issues.

Tips: this program will be crazy to brush the log

Tag summary

Content type

Image

Digest

sha256:18e81aaa5

Size

8.7 MB

Last updated

about 3 years ago

docker pull shilazi/tunelo:v0.2.0