Sign inSign up

fhriley/cloudflare-manager

By fhriley

Updated over 4 years ago

Automatically add CloudFlare Zero Trust public hostnames using docker labels

Image
0

1.7K

fhriley/cloudflare-manager repository overview

Automatically add CloudFlare Zero Trust public hostnames using docker labels

Usage

docker run -d \
    --name=cloudflare-manager \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -e CLOUDFLARE_TUNNEL_ID=<TUNNEL_ID> \
    -e CLOUDFLARE_API_KEY=<API_KEY> \
    -e CLOUDFLARE_ACCOUNT_ID=<ACCOUNT_ID> \
    fhriley/cloudflare-manager
Environment Variables

To customize some properties of the container, the following environment variables can be passed via the -e parameter (one for each variable). Value of this parameter has the format <VARIABLE_NAME>=<VALUE>.

VariableDescription
CLOUDFLARE_TUNNEL_IDTunnel ID used when a tunnel is not specified by label.
CLOUDFLARE_API_KEYAPI token for connecting to the Cloudflare API. This token should have Account:Cloudflare Tunnel:Edit and Zone:DNS:Edit permissions.
CLOUDFLARE_ACCOUNT_IDCloudflare account ID that owns the tunnel.
CLOUDFLARE_AUTO_HTTP_HOST_HEADERSet to true to automatically set the HTTP Host header to the hostname and the origin server name to the zone name. For example, for the hostname foo.example.com, the Host header will be foo.example.com, and the origin server name will be *.example.com.
CLOUDFLARE_DEFAULT_SERVICEService used if it is not specified by label.
Docker Labels
LabelDescriptionExample
cloudflare.zero_trust.access.tunnel.public_hostnamePublic hostname to add to the tunnel.service.example.com
cloudflare.zero_trust.access.tunnel.serviceService the hostname will proxy to.http://192.168.1.100:8000
cloudflare.zero_trust.access.tunnel.idTunnel ID to add the hostname to.423971df-7091-4ed9-85e8-25bb598776ab
cloudflare.zero_trust.access.tunnel.tls.notlsverifyTurn off TLS verification for the origin service.true
Example

A fully working docker compose example can be found here.

Tag summary

Content type

Image

Digest

Size

22.1 MB

Last updated

over 4 years ago

docker pull fhriley/cloudflare-manager