Code Monkey home page Code Monkey logo

tailscale-derper's Introduction

Tailscale DERP Server

Inspired by:

Environment

Env Default Description
DERP_DOMAIN derp01.tailscale.com
DERP_CERT_MODE letsencrypt
DERP_CERT_DIR /app/certs
DERP_ADDR :443 If you need to use a reverse proxy (Nginx, Traefik, Caddy) to manage TLS certificates, you can set ":80" to listen for http.
DERP_STUN true Enable STUN server
DERP_STUN_PORT 3478
DERP_HTTP_PORT 80
DERP_VERIFY_CLIENTS true
TS_SERVER https://controlplane.tailscale.com If you are using self-hosted headscale, set the server address. Only available DERP_VERIFY_CLIENTS=true.
TS_AUTHKEY tskey-abcdef1234567890 If you only allow verify-client, you MUST set the auth key. (https://tailscale.com/kb/1085/auth-keys)
TS_EXTRA_ARGS Tailscale CLI arguments, for example you can set the node name via --hostname=derp-01. (https://tailscale.com/kb/1080/cli#up)

Example

Docker Standalone

docker run -it \
  -e TS_SERVER=https://hs-control.example.com \
  -e TS_AUTHKEY=tskey-abcdef1432341818 \
  -e DERP_DOMAIN=derp-01.example.com \
  -p 443:443/udp
  -p 3478:3478/udp
  ghcr.io/wind4/tailscale-derper:main

Docker Compose + Traefik

version: "3"

services:
  traefik:
    image: traefik:v2.10
    command:
      - --providers.docker=true
      - --providers.docker.exposedbydefault=false
      - --entrypoints.web.address=:80
      - --entrypoints.websecure.address=:443
    ports:
      - 80:80
      - 443:443
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - traefik_data:/etc/traefik
    restart: always

  derper:
    image: ghcr.io/wind4/tailscale-derper:main
    environment:
      - TS_SERVER=https://hs-control.example.com
      - TS_AUTHKEY=tskey-abcdef1432341818
      - TS_EXTRA_ARGS=--hostname depr-01
      - DERP_DOMAIN=derp-01.example.com
      - DERP_ADDR=:80
    labels:
      - traefik.enable=true
      - traefik.http.routers.derper.entrypoints=websecure
      - traefik.http.routers.derper.rule=Host(`derp-01.example.com`)
      - traefik.http.services.derper.loadbalancer.server.port=80
    ports:
      - 3478:3478/udp
    volumes:
      - tailscale_data:/var/lib/tailscale
    restart: always

volumes:
  traefik_data:
  tailscale_data:

tailscale-derper's People

Contributors

wind4 avatar sunnoy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.