-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable Tailscale's Funnel feature (#197)
Co-authored-by: Franck Nijhof <[email protected]>
- Loading branch information
Showing
9 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/command/with-contenv bashio | ||
# shellcheck shell=bash | ||
# ============================================================================== | ||
# Home Assistant Community Add-on: Tailscale | ||
# Enables Tailscale Funnel feature | ||
# ============================================================================== | ||
|
||
declare domain | ||
|
||
# Check if Tailscale HTTPS is enabled | ||
if ! /opt/tailscale status --self=true --peers=false --json \ | ||
| jq -rce '.Self.CapMap | has("https")' > /dev/null; | ||
then | ||
bashio::log.notice "Tailscale's HTTPS support is disabled. Therefore, the add-on's Tailscale Funnel functionality is disabled." | ||
bashio::exit.ok | ||
fi | ||
|
||
domain=$(/opt/tailscale status --self=true --peers=false --json | jq -rc ".CertDomains[0]") | ||
|
||
# Check if Funnel is available | ||
if ! /opt/tailscale status --self=true --peers=false --json \ | ||
| jq -rce '.Self.CapMap | has("funnel")' > /dev/null; | ||
then | ||
bashio::log.notice "Tailscale's Funnel support is disabled. Therefore, the add-on's Tailscale Funnel functionality is disabled." | ||
bashio::exit.ok | ||
fi | ||
|
||
# Set up funnel | ||
if ! /opt/tailscale funnel 443 on; then | ||
bashio::log.error "Unable to configure Tailscale Funnel" | ||
bashio::exit.nok | ||
fi | ||
bashio::log.info "Tailscale Funnel is enabled:" | ||
bashio::log.info " Your Home Assistant instance is publicly available on the internet at" | ||
bashio::log.info " https://${domain}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
oneshot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/etc/s6-overlay/s6-rc.d/funnel/run |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters