From 6ccab6b94075eae27343e56a86b19794736dcf04 Mon Sep 17 00:00:00 2001 From: Tobias Brenner <19689801+brenner-tobias@users.noreply.github.com> Date: Sun, 16 Jan 2022 21:39:50 +0100 Subject: [PATCH] Release Add-On Cloudflared 0.2.1 --- cloudflared/CHANGELOG.md | 6 ++++ cloudflared/DOCS.md | 73 ++++++++++++++++++++++++++++++++++++---- cloudflared/README.md | 9 +++++ cloudflared/config.yaml | 12 ++++--- 4 files changed, 90 insertions(+), 10 deletions(-) diff --git a/cloudflared/CHANGELOG.md b/cloudflared/CHANGELOG.md index 69a1c74..6ac4b4c 100644 --- a/cloudflared/CHANGELOG.md +++ b/cloudflared/CHANGELOG.md @@ -1,3 +1,9 @@ +## v0.2.1 +- Bump Cloudflared to 2022.1.2 + +## v0.2.0 +- Added possibility to configure additional hosts to forward to + ## v0.1.9 - Bump Cloudflared to 2022.1.0 diff --git a/cloudflared/DOCS.md b/cloudflared/DOCS.md index ac789ca..94576e3 100644 --- a/cloudflared/DOCS.md +++ b/cloudflared/DOCS.md @@ -10,6 +10,13 @@ connection. DNS servers of Cloudflare. If you do not have one, you can get one for free at [Freenom][freenom] following [this article][domainarticle].** +## Disclaimer + +Please make sure to be compliant with the +[Cloudflare Self-Serve Subscription Agreement][cloudflare-sssa] when using this +add-on. Especially [section 2.8][cloudflare-sssa-28] could be breached when +mainly streaming videos or other Non-HTML content. + ## Installation The installation of this add-on is pretty straightforward but requires some prerequisites @@ -22,7 +29,7 @@ restart your HomeAssistant instance.** 1. (Optional if you don't yet have a working Cloudflare set-up): Get a domain name and set-up Cloudflare. See section [Domain Name and Cloudlfare Set-Up](#domain-name-and-cloudlfare-set-up) for details. -1. Set the "external_hostname" add-on option with your domain name or a subdomain +1. Set the "j" add-on option with your domain name or a subdomain that you want to use to access Home Assistant. 1. (Optional) Change the "tunnel_name" add-on option (default: homeassistant). 1. **Make sure that there is no DNS entry with your desired external hostname and @@ -38,11 +45,26 @@ restart your HomeAssistant instance.** **Note**: _Remember to restart the add-on when the configuration is changed._ -Example add-on configuration: +Example basic add-on configuration: ```yaml external_hostname: "ha.example.com" -tunnel_name: homeassistant +tunnel_name: "homeassistant" +additional_hosts: [] +``` + +Example extended add-on configuration: + +```yaml +external_hostname: "ha.example.com" +tunnel_name: "homeassistant" +additional_hosts: + - hostname: "diskstation.example.com" + service: "http://192.168.1.5" + - hostname: "website.example.com" + service: "http://192.168.1.2" +nginxproxymanager: true +log_level: "debug" ``` **Note**: _This is just an example, don't copy and paste it! Create your own!_ @@ -63,13 +85,42 @@ http: - 172.30.33.0/24 ``` +### Option: `additional_hosts` + +You can use the internal reverse proxy of Cloudflare Tunnel to define additional +hosts next to home assistant. That way, you can use the tunnel to also access +other systems like a diskstation, router or anything else. + +Like with the `external_hostname` of HomeAssistant, DNS entries at will be +automatically created at Cloudflare. + +Please find below an examplary entry for two additional hosts: + +```yaml +additional_hosts: + - hostname: "diskstation.example.com" + service: "http://192.168.1.2" + - hostname: "router.example.com" + service: "http://192.168.1.1" +``` + +**Note**: _If you delete a hostname from the list, it will not be served +anymore (the request will run agains the default route). Nevertheless, +you should also manually delete the DNS entry from Cloudflare since it can not +be deleted by the Add-On._ + ### Option: `nginxproxymanager` If you want to use the Cloudflare Tunnel with the Add-On [Nginx Proxy Manager][nginxproxymanager], you can do so by setting this option. -**Note**: _This will still route your defined `external_hostname` to HomeAssistant -and any other incoming domain to Nginx Proxy Manager._ +```yaml +nginxproxymanager: true +``` + +**Note**: _This will still route your defined `external_hostname`to HomeAssistant +as well as any potential `additional_hosts` to where you defined in the config. +Any other incoming traffic will be routed to Nginx Proxy Manager._ In order to route multiple sub-domains through the tunnel, you have to create individual CNAME records in Cloudflare for all of them, pointing to your `external_hostname` @@ -83,7 +134,13 @@ them to wherever you like. The `log_level` option controls the level of log output by the addon and can be changed to be more or less verbose, which might be useful when you are -dealing with an unknown issue. Possible values are: +dealing with an unknown issue. + +```yaml +log_level: debug +``` + +Possible values are: - `trace`: Show every detail, like all called internal functions. - `debug`: Shows detailed debug information. @@ -103,6 +160,10 @@ In case something went wrong or you want to reset your Cloudflare tunnel for some other reason (e.g., switch to another Cloudflare account), you can reset all your local Cloudflare files by setting this option to `true`. +```yaml +reset_cloudflared_files: true +``` + **Note**: _After deleting the files, the option `reset_cloudflared_files` will automaticaly be removed from the add-on configuration._ diff --git a/cloudflared/README.md b/cloudflared/README.md index d82c0df..f56dc57 100644 --- a/cloudflared/README.md +++ b/cloudflared/README.md @@ -22,6 +22,15 @@ DNS servers of Cloudflare. If you do not have one, you can get one for free at **Note**: _This add-on needs the Admin API role in order to get the internal IP of Nginx Proxy Manager, in case it is used with the tunnel._ +## Disclaimer + +Please make sure to be compliant with the +[Cloudflare Self-Serve Subscription Agreement][cloudflare-sssa] when using this +add-on. Especially [section 2.8][cloudflare-sssa-28] could be breached when +mainly streaming videos or other Non-HTML content. + +[cloudflare-sssa]: https://www.cloudflare.com/terms/ +[cloudflare-sssa-28]: https://www.cloudflare.com/terms/#:~:text=2.8%20Limitation%20on%20Serving%20Non%2DHTML%20Content [domainarticle]: https://www.linkedin.com/pulse/what-do-domain-name-how-get-one-free-tobias-brenner?trk=public_post-content_share-article [freenom]: https://freenom.com [maintenance-shield]: https://img.shields.io/maintenance/yes/2022.svg diff --git a/cloudflared/config.yaml b/cloudflared/config.yaml index 0f44020..8e6ee79 100644 --- a/cloudflared/config.yaml +++ b/cloudflared/config.yaml @@ -1,6 +1,6 @@ --- name: Cloudflared -version: 0.1.9 +version: 0.2.1 slug: cloudflared description: > Use a Cloudflared tunnel (formerly Argo Tunnel) @@ -17,11 +17,15 @@ arch: - armv7 - i386 options: - external_hostname: "" - tunnel_name: homeassistant + external_ha_hostname: "" + tunnel_name: "homeassistant" + additional_hosts: [] schema: - external_hostname: str + external_ha_hostname: str tunnel_name: str + additional_hosts: + - hostname: str + service: str nginxproxymanager: bool? log_level: list(trace|debug|info|notice|warning|error|fatal)? reset_cloudflared_files: bool?