Skip to content

Commit

Permalink
Merge pull request #8 from sviete/docs
Browse files Browse the repository at this point in the history
ais logo in console
  • Loading branch information
araczkowski authored Sep 4, 2023
2 parents 3260392 + 0b3dff2 commit 3d6c2e3
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 13 deletions.
23 changes: 11 additions & 12 deletions cloudflared/DOCS.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
# AIS Cloudflared

Cloudflared connects your Home Assistant Instance via a secure tunnel via Cloudflare
to a subdomain at `paczka.pro` host. This allows you to expose your Home Assistant instance
to the Internet without opening ports on your router.
to a subdomain at `paczka.pro` host. This allows you to expose your Home
Assistant instance to the Internet without opening ports on your router.

![ais tunnel](https://raw.githubusercontent.com/sviete/ais-ha-addon-cloudflared/main/docs/images/ais-tunnel.png)

## Local tunnel add-on setup

### 1. Configure the http integration in your Home Assistant config as
### 1. Configure the http integration in your Home Assistant config

Since Home Assistant blocks requests from proxies/reverse proxies, you need to tell your instance to allow requests from the Cloudflared add-on. The add-on runs locally, so HA has to trust the docker network. In order to do so, add the following lines to your /config/configuration.yaml:
Since Home Assistant blocks requests from proxies/reverse proxies, you need to tell
your instance to allow requests from the Cloudflared add-on. The add-on runs
locally, so HA has to trust the docker network. In order to do so, add the
following lines to your /config/configuration.yaml:

Note: There is no need to adapt anything in these lines since the IP range of the docker network is always the same.

`/usr/share/hassio/homeassistant/configuration.yaml`

```yaml
http:
use_x_forwarded_for: true
Expand All @@ -25,18 +26,16 @@ http:
#### 2. Set subdomain and password
In the configuration, enter the name of the subdomain under which you want yours Home Assistant instance
to be available. In addition, enter the password that you will reserve for yourself
In the configuration, enter the name of the subdomain under which you want yours Home Assistant
instance to be available. In addition, enter the password that you will reserve for yourself
own subdomain - only the person who knows this password can run the tunnel with this subdomain.
![ais tunnel](https://raw.githubusercontent.com/sviete/ais-ha-addon-cloudflared/main/docs/images/ais-config.png)
Save your configuration.
#### 3. Start the `AIS Cloudflared` add-on and watch the logs

From the logs you will find out if the subdomain you selected was available and whether the tunnel
has been started correctly.
From the logs you will find out if the subdomain you selected was available and whether
the tunnel has been started correctly.

#### 4. Access your Home Assistant via the remote URL without port

Expand Down
2 changes: 1 addition & 1 deletion cloudflared/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: AIS Cloudflared
version: dev
slug: cloudflared
description: "Użyj tunelu AIS Cloudflare, aby zdalnie połączyć się z Home Assistant bez otwierania jakichkolwiek portów"
description: "Use Cloudflare's AIS Tunnel to remotely connect to Home Assistant without opening any ports"
url: "https://github.com/sviete/ais-ha-addon-cloudflared/"
codenotary: [email protected]
init: false
Expand Down
25 changes: 25 additions & 0 deletions cloudflared/rootfs/etc/s6-overlay/scripts/cloudflared-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,29 @@
# Configures the Cloudflare Tunnel and creates the needed DNS entry under the
# given hostname(s)
# ==============================================================================
# ------------------------------------------------------------------------------
# Print AIS logo
# ------------------------------------------------------------------------------
aisLogo() {
bashio::log.warning ""
bashio::log.warning " ⣴⣿⣿⣆"
bashio::log.warning " ⣿⣿⣿⣿⣿⣿"
bashio::log.warning " ⣿⣿⣿⣿⣿⣿"
bashio::log.warning " ⣿⣿⣿⣿⣿⣿ ⣴⣿⣿⣆"
bashio::log.warning " ⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿"
bashio::log.warning " ⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿ ⣴⣿⣿⣆"
bashio::log.warning " ⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿"
bashio::log.warning " ⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿"
bashio::log.warning " ⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿"
bashio::log.warning " ⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿"
bashio::log.warning " ⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿ ⠻⣿⣿⠏"
bashio::log.warning " ⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿"
bashio::log.warning " ⣿⣿⣿⣿⣿⣿ ⠻⣿⣿⠏"
bashio::log.warning " ⣿⣿⣿⣿⣿⣿"
bashio::log.warning " ⣿⣿⣿⣿⣿⣿"
bashio::log.warning " ⠻⣿⣿⠏"
bashio::log.warning ""
}

# ------------------------------------------------------------------------------
# Checks if the config is valid
Expand Down Expand Up @@ -317,6 +340,8 @@ data_path="/data"
main() {
bashio::log.trace "${FUNCNAME[0]}"

aisLogo

setCloudflaredLogLevel

checkConfig
Expand Down

0 comments on commit 3d6c2e3

Please sign in to comment.