All Projects → aeleos → cloudflared

aeleos / cloudflared

Licence: other
Cloudflare Tunnel Instructions and Template for Unraid

Projects that are alternatives of or similar to cloudflared

docker-traefik
Dockerized Traefik Reverse Proxy with customizable options
Stars: ✭ 17 (-86.82%)
Mutual labels:  reverse-proxy, traefik
High-Traffic-wordpress-server-configuration
High Traffic WordPress server configuration Nginx (updated) PHP 7.4 PHP-fpm Mariadb (updated) Wordpress (updated) Cloudflare Full SSL
Stars: ✭ 31 (-75.97%)
Mutual labels:  ssl, cloudflare
docker-reverse-proxies
Sample usage for various reverse proxies in Docker setups
Stars: ✭ 43 (-66.67%)
Mutual labels:  reverse-proxy, traefik
httpsify
a transparent HTTPS termination proxy using letsencrypt with auto certification renewal
Stars: ✭ 107 (-17.05%)
Mutual labels:  ssl, reverse-proxy
Sites Using Cloudflare
💔 Archived list of domains using Cloudflare DNS at the time of the CloudBleed announcement.
Stars: ✭ 1,914 (+1383.72%)
Mutual labels:  ssl, cloudflare
traefik-docker-ansible
🐳 🐹  This is an Ansible playbook to install multiple Web applications on a single Ubuntu server with Docker and Traefik.
Stars: ✭ 75 (-41.86%)
Mutual labels:  reverse-proxy, traefik
Cloudmare
Cloudflare, Sucuri, Incapsula real IP tracker.
Stars: ✭ 213 (+65.12%)
Mutual labels:  reverse-proxy, cloudflare
detect-cloudflare-plus
True Sight Firefox extension.
Stars: ✭ 34 (-73.64%)
Mutual labels:  reverse-proxy, cloudflare
Nico
A HTTP2 web server for reverse proxy and single page application, automatically apply for ssl certificate, Zero-Configuration.
Stars: ✭ 43 (-66.67%)
Mutual labels:  ssl, reverse-proxy
Ssl Proxy
🔒 Simple zero-config SSL reverse proxy with real autogenerated certificates (LetsEncrypt, self-signed, provided)
Stars: ✭ 427 (+231.01%)
Mutual labels:  ssl, reverse-proxy
nebula
Source Code for the Home Server setup.
Stars: ✭ 48 (-62.79%)
Mutual labels:  cloudflare, traefik
docker-ssl-reverse-proxy
Easy-to-use auto-SSL reverse proxy as a Docker container based on Caddy and Let’s Encrypt
Stars: ✭ 22 (-82.95%)
Mutual labels:  ssl, reverse-proxy
Cloudflared
Argo Tunnel client
Stars: ✭ 1,150 (+791.47%)
Mutual labels:  reverse-proxy, cloudflare
Service Proxy
API gateway for REST and SOAP written in Java.
Stars: ✭ 355 (+175.19%)
Mutual labels:  ssl, reverse-proxy
Sslify
Rapidly SSLify Your Server!
Stars: ✭ 168 (+30.23%)
Mutual labels:  ssl, cloudflare
ceil
Helmut Hoffer von Ankershoffen experimenting with auto-provisioned RPi cluster running K8S on bare-metal
Stars: ✭ 42 (-67.44%)
Mutual labels:  cloudflare, traefik
LiveProxies
Asynchronous proxy checker
Stars: ✭ 17 (-86.82%)
Mutual labels:  ssl
domin
Domain Name Search untuk mencari ketersedian nama domain.
Stars: ✭ 17 (-86.82%)
Mutual labels:  cloudflare
docker-media-server
Jellyfin media server with sonarr, radarr, ombi, jackett, deluge and traefik
Stars: ✭ 37 (-71.32%)
Mutual labels:  reverse-proxy
Swiddler
TCP/UDP debugging tool.
Stars: ✭ 56 (-56.59%)
Mutual labels:  ssl

Instructions for Cloudflare Tunnels (formerly known as Argo Tunnels) on Unraid

Argo Tunnel creates a secure, outbound-only connection between your services and Cloudflare by deploying a lightweight connector in your environment. With this model, your team does not need to go through the hassle of poking holes in your firewall or validating that traffic originated from Cloudflare IPs.

Support Me

If you liked this guide and want to say thanks feel free to buy me a coffee https://www.buymeacoffee.com/aeleos

Video Guide

If you would like to watch a video detailing all this information and more, check out IBRACORP's guide https://www.youtube.com/watch?v=RQ-6dActAr8

Prerequisite

For this setup, you need to have a domain which is managed by CloudFlare, and can be done on the free plan.

Set-Up Steps

  1. In Unraid terminal, run the following command to authorise cloudflared with the cloudflare site you want to setup with a tunnel.
docker run -it --rm -v /mnt/user/appdata/cloudflared:/home/nonroot/.cloudflared/ cloudflare/cloudflared:2021.6.0 tunnel login 

It will print out a link to cloudflare. Put this link in your web browser, and select which domain you want to use. Then, the daemon will automatically pull the certificate.

  1. Now we need to create a tunnel. To do this we will run another command from the unraid terminal
docker run -it --rm -v /mnt/user/appdata/cloudflared:/home/nonroot/.cloudflared/ cloudflare/cloudflared:2021.6.0 tunnel create TUNNELNAME

This will create your tunnels UUID.json file, which contains a secret used to authenticate your tunneled connection with cloudflare. The JSON file is only needed for running the tunnel, but any tunnel modifications require the cert.pem. More information about what requires what can be found here.

Make sure you copy your UUID, as this will be used in later steps. It can always be found later by the name of the JSON file.

  1. Now we need to create a config.yaml to configure the tunnel
nano /mnt/user/appdata/cloudflared/config.yaml
  1. Now paste in the following and amend your reverse proxy IP:PORT, tunnel UUID and domain name if applicable

    • if you have an ssl certificate on your reverse proxy, you need to pass in your domain name that the SSL cert is under
    • if you want to proxy to an http server, use the commended ingress rule
    • if you want to disable ssl verification, add noTLSVerify under originRequest
tunnel: UUID
credentials-file: /home/nonroot/.cloudflared/UUID.json

# NOTE: You should only have one ingress tag, so if you uncomment one block comment the others

# forward all traffic to Reverse Proxy w/ SSL
ingress:
  - service: https://REVERSEPROXYIP:PORT
    originRequest:
      originServerName: yourdomain.com
      
#forward all traffic to Reverse Proxy w/ SSL and no TLS Verify
#ingress:
#  - service: https://REVERSEPROXYIP:PORT
#    originRequest:
#      noTLSVerify: true

# forward all traffic to reverse proxy over http
#ingress:
#  - service: http://REVERSEPROXYIP:PORT

See here for more information about ingress rules and how they can be configured

  1. Now, we need to install the app inside the Unraid UI.

    • Go to the CA Apps Tab

    • Search for cloudflared

    • Install from aeleos' Repository

    • Make the following changes:

  2. Now we need to change the "Post Arguments". To do this we need to enable the "Advanced View" in the top right corner.

    • You should see the below command inside of "Post Arguments". Replace UUID the the UUID for your tunnel generated in step 2.
Post arguments: 
tunnel run UUID
  1. Now you can start your container and if all done correctly with no errors, you should have a running tunnel!

  2. The next step will be to edit your domain DNS records.

    • If you have an A record already, you can remove this as it is now not needed.

    • Replace your A record with a CNAME record, that points to the domain root (@) and for the content, you need to add UUID.cfargotunnel.com (inserting your UUID that was copied earlier).

Example

Type Name Value TTL Status
CNAME @ UUID.cfargotunnel.com Automatic Orange ☁️
CNAME plex @ Automatic Orange ☁️
CNAME portainer @ Automatic Orange ☁️
CNAME radarr @ Automatic Orange ☁️
CNAME sonarr @ Automatic Orange ☁️

You should now be able to access all of your apps without needed a port forward!

Troubleshooting

Certificate not valid for any names

If you see an error like

in the logs of cloudflared i have this error "ERR  error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: x509: certificate is not valid for any names, but wanted to match youdomain.com

Try changing yourdomain.com to host.yourdomain.com, where host is a valid subdomain that you have a DNS record for. Despite this being a specific hostname, cloudflared should be able this name to verify certificates for your other subdomains as they pass through the tunnel.

Another user has reported that they fixed this issue when using NPM by enalbing HTTP/2 and installing a CF origin certificate into their NPM instance. You may also get this error for other misconfigurations in the certificate returned by NPM.

Tunnel Create does not return an ID

If when running the commands in your terminal, you aren't returned an ID, try running the command with the container version specified, like this

docker run -it --rm -v /mnt/user/appdata/cloudflared:/home/nonroot/.cloudflared/ cloudflare/cloudflared:2021.6.0 tunnel

Enabling SSH Access via Web Rendered Terminal

  1. Create a DNS record for the subdomain you want to go to for SSH access. Below is an example
Type Name Value TTL Status
CNAME ssh domain.com Automatic Orange ☁️
  1. Add Ingress Rule

Ingress rules resolve top down, so this rule should be above the - service: https://REVERSEPROXYIP:PORT/ rule.

  - hostname: ssh.domain.com
    service: ssh://SSHIP:PORT

  1. Sign up for Cloudflare Teams

    • Can be done here, free plan works up to 50 users but needs billing details, you may be able to get it to work with no plan
  2. Add an Teams application for your SSH service and enable browser based rendering

    • Guide by cloudflare can be found here

List and delete tunnels

To list all configured tunnels and see active connections:

docker run -it --rm -v /mnt/user/appdata/cloudflared:/home/nonroot/.cloudflared/ cloudflare/cloudflared tunnel list
ID NAME CREATED CONNECTIONS
NAMEID in hex NAME of the tunnel TIMESTAMP Date and time created NUMBERxCFPOINT

To revoke and delete a tunnel:

docker run -it --rm -v /mnt/user/appdata/cloudflared:/home/nonroot/.cloudflared/ cloudflare/cloudflared tunnel delete TUNNELID

If there are still active connections on the tunnel you need to force the deletion. Connections will be dropped:

docker run -it --rm -v /mnt/user/appdata/cloudflared:/home/nonroot/.cloudflared/ cloudflare/cloudflared tunnel delete -f TUNNELID

Deleting the Tunnel also invalidates the credentials file associated with that Tunnel, meaning those connections can not be re-established.

Credit

  • Hawks for helping beta test the setup and documentation contributions
  • DiscDuck for documentation contributions
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].