derper-docker/README.md

34 lines
2.5 KiB
Markdown
Raw Permalink Normal View History

2021-09-25 18:29:17 +08:00
# Derper
[![docker workflow](https://github.com/fredliang44/derper-docker/actions/workflows/docker-image.yml/badge.svg)](https://hub.docker.com/r/fredliang/derper)
[![docker pulls](https://img.shields.io/docker/pulls/fredliang/derper.svg?color=brightgreen)](https://hub.docker.com/r/fredliang/derper)
2022-01-09 23:31:37 +08:00
[![platfrom](https://img.shields.io/badge/platform-amd64%20%7C%20arm64-brightgreen)](https://hub.docker.com/r/fredliang/derper/tags)
2021-09-25 18:29:17 +08:00
# Setup
2021-12-24 18:56:39 +08:00
> required: set env `DERP_DOMAIN` to your domain
2021-09-25 18:29:17 +08:00
```bash
docker run -e DERP_DOMAIN=derper.your-domain.com -p 80:80 -p 443:443 -p 3478:3478/udp fredliang/derper
2021-09-25 18:29:17 +08:00
```
2021-09-25 19:14:49 +08:00
| env | required | description | default value |
| ------------------- | -------- | ---------------------------------------------------------------------- | ----------------- |
| DERP_DOMAIN | true | derper server hostname | your-hostname.com |
| DERP_CERT_DIR | false | directory to store LetsEncrypt certs(if addr's port is :443) | /app/certs |
| DERP_CERT_MODE | false | mode for getting a cert. possible options: manual, letsencrypt | letsencrypt |
| DERP_ADDR | false | listening server address | :443 |
| DERP_STUN | false | also run a STUN server | true |
| DERP_STUN_PORT | false | The UDP port on which to serve STUN. | 3478 |
| DERP_HTTP_PORT | false | The port on which to serve HTTP. Set to -1 to disable | 80 |
| DERP_VERIFY_CLIENTS | false | verify clients to this DERP server through a local tailscaled instance | false |
| DERP_VERIFY_CLIENT_URL | false | if non-empty, an admission controller URL for permitting client connections | "" |
2021-09-25 21:24:51 +08:00
2021-09-25 19:14:49 +08:00
# Usage
2021-09-25 21:24:51 +08:00
2021-09-25 19:14:49 +08:00
Fully DERP setup offical documentation: https://tailscale.com/kb/1118/custom-derp-servers/
2023-12-10 20:52:20 +08:00
## Client verification
In order to use `DERP_VERIFY_CLIENTS`, the container needs access to Tailscale's Local API, which can usually be accessed through `/var/run/tailscale/tailscaled.sock`. If you're running Tailscale bare-metal on Linux, adding this to the `docker run` command should be enough: `-v /var/run/tailscale/tailscaled.sock:/var/run/tailscale/tailscaled.sock`