Skip to content

Add support for advertising Tailscale Services#715

Open
apfohl wants to merge 1 commit into
hassio-addons:mainfrom
apfohl:advertise-services
Open

Add support for advertising Tailscale Services#715
apfohl wants to merge 1 commit into
hassio-addons:mainfrom
apfohl:advertise-services

Conversation

@apfohl

@apfohl apfohl commented Jul 17, 2026

Copy link
Copy Markdown

Proposed Changes

This adds a new services configuration option that allows users to advertise local services running on the Home Assistant host as Tailscale Services.

A new S6 oneshot service share-services reads the configured services and calls tailscale serve --service=svc:<name> for each entry. The svc: prefix is added automatically; users configure the plain service name.

Supported protocols are http, https, tcp, and tls-terminated-tcp. Services must be defined and approved in the Tailscale admin console before they can accept traffic.

Also updates the app documentation and translations for the new option.

Related Issues

None. As far as I have looked into the issues.

Summary by CodeRabbit

  • New Features
    • Added support for advertising local services via Tailscale Services (“service hosts”).
    • You can configure service name, target, protocol, port, and an optional path; service hosts are disabled by default and activate when configured.
  • Configuration / Documentation
    • Documented the new service-hosts option, including required fields, supported protocols, and valid target URL formats.
    • Updated the English UI text to expose the “Service hosts” option.
  • Behavior
    • When no services are configured, service advertising is automatically not started.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 327bb78d-d1a9-498a-8d93-d0c838f29203

📥 Commits

Reviewing files that changed from the base of the PR and between 0b889d6 and 3379686.

📒 Files selected for processing (9)
  • tailscale/DOCS.md
  • tailscale/config.yaml
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/dependencies.d/post-tailscaled
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/run
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/type
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/up
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/share-services
  • tailscale/rootfs/etc/s6-overlay/scripts/stage2_hook.sh
  • tailscale/translations/en.yaml
🚧 Files skipped from review as they are similar to previous changes (6)
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/up
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/type
  • tailscale/translations/en.yaml
  • tailscale/DOCS.md
  • tailscale/rootfs/etc/s6-overlay/scripts/stage2_hook.sh
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/run

Walkthrough

Adds a services configuration option for advertising local services through Tailscale Services, validates its fields, documents its usage, and introduces an s6-overlay startup service that synchronizes configured hosts with tailscale serve.

Changes

Tailscale Services

Layer / File(s) Summary
Service configuration and documentation
tailscale/config.yaml, tailscale/DOCS.md, tailscale/translations/en.yaml
Adds the services list, validates service names, targets, protocols, ports, and paths, and documents configuration and Tailscale Services behavior.
Service advertisement runtime
tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/run
Waits for tailscaled, removes stale serve entries, and advertises each configured service with its target, protocol, port, and path.
s6-overlay service wiring
tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/*, tailscale/rootfs/etc/s6-overlay/scripts/stage2_hook.sh
Registers share-services as a oneshot service and disables it when the configured service list is empty.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant stage2_hook_sh
  participant share_services_run
  participant tailscaled
  participant TailscaleServe
  stage2_hook_sh->>share_services_run: retain service when services are configured
  share_services_run->>tailscaled: wait for reachable running backend
  share_services_run->>TailscaleServe: synchronize and advertise configured services
Loading

Possibly related PRs

Suggested labels: new-feature

Suggested reviewers: frenck

Poem

I’m a rabbit with services to share,
Sending local hosts through Tailscale air.
Configs bloom, stale paths hop away,
serve carries each one today.
Sniff sniff—startup now knows where!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding support for advertising Tailscale Services.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tailscale/rootfs/etc/s6-overlay/scripts/stage2_hook.sh (1)

138-140: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use rm -f to prevent potential startup failures.

While the container filesystem is typically recreated on every start, adding the -f flag ensures the script won't fail and crash the startup process if the share-services contents file is already missing or cannot be removed.

🛠️ Proposed fix
 if ! bashio::config 'services' | jq -e '. | length > 0' > /dev/null; then
-    rm /etc/s6-overlay/s6-rc.d/user/contents.d/share-services
+    rm -f /etc/s6-overlay/s6-rc.d/user/contents.d/share-services
 fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tailscale/rootfs/etc/s6-overlay/scripts/stage2_hook.sh` around lines 138 -
140, Update the cleanup command in the services configuration check of
stage2_hook.sh to use rm -f when removing the share-services contents file, so
an already-missing file does not fail startup.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tailscale/rootfs/etc/s6-overlay/scripts/stage2_hook.sh`:
- Around line 138-140: Update the cleanup command in the services configuration
check of stage2_hook.sh to use rm -f when removing the share-services contents
file, so an already-missing file does not fail startup.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6fec5516-8be6-4b0a-b556-1608b8e2d9ce

📥 Commits

Reviewing files that changed from the base of the PR and between 2b00f29 and 2ca7ee2.

📒 Files selected for processing (9)
  • tailscale/DOCS.md
  • tailscale/config.yaml
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/dependencies.d/post-tailscaled
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/run
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/type
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/up
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/share-services
  • tailscale/rootfs/etc/s6-overlay/scripts/stage2_hook.sh
  • tailscale/translations/en.yaml

@apfohl
apfohl force-pushed the advertise-services branch from 2ca7ee2 to 1575c1d Compare July 17, 2026 11:08

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tailscale/DOCS.md`:
- Around line 342-344: Update the https service description in the Tailscale
documentation to state that tailnet HTTPS certificates and MagicDNS must be
enabled beforehand, while retaining the note that Tailscale provisions the TLS
certificate automatically once those prerequisites are met.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9e896e75-70d3-41e7-acf1-5ba217281b30

📥 Commits

Reviewing files that changed from the base of the PR and between 2ca7ee2 and 1575c1d.

📒 Files selected for processing (9)
  • tailscale/DOCS.md
  • tailscale/config.yaml
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/dependencies.d/post-tailscaled
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/run
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/type
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/up
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/share-services
  • tailscale/rootfs/etc/s6-overlay/scripts/stage2_hook.sh
  • tailscale/translations/en.yaml
🚧 Files skipped from review as they are similar to previous changes (6)
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/type
  • tailscale/translations/en.yaml
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/up
  • tailscale/rootfs/etc/s6-overlay/scripts/stage2_hook.sh
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/run
  • tailscale/config.yaml

Comment thread tailscale/DOCS.md Outdated
@apfohl
apfohl force-pushed the advertise-services branch from 1575c1d to 0b889d6 Compare July 17, 2026 11:22

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tailscale/config.yaml`:
- Line 84: Update the target regex in the configuration’s target validation to
enforce the same valid port range, 1–65535, instead of accepting any digits
after 127.0.0.1. Preserve support for both http(s) and tcp schemes and local
ports within the valid range.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b5944bed-00f9-4282-9fd0-f289f39099c0

📥 Commits

Reviewing files that changed from the base of the PR and between 1575c1d and 0b889d6.

📒 Files selected for processing (9)
  • tailscale/DOCS.md
  • tailscale/config.yaml
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/dependencies.d/post-tailscaled
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/run
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/type
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/up
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/share-services
  • tailscale/rootfs/etc/s6-overlay/scripts/stage2_hook.sh
  • tailscale/translations/en.yaml
🚧 Files skipped from review as they are similar to previous changes (5)
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/up
  • tailscale/rootfs/etc/s6-overlay/scripts/stage2_hook.sh
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/type
  • tailscale/DOCS.md
  • tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-services/run

Comment thread tailscale/config.yaml Outdated
This adds a new `services` configuration option that allows users to advertise local services running on the Home Assistant host as Tailscale Services.

A new S6 oneshot service `share-services` reads the configured services and calls `tailscale serve --service=svc:<name>` for each entry. The `svc:` prefix is added automatically; users configure the plain service name.

Supported protocols are `http`, `https`, `tcp`, and `tls-terminated-tcp`. Services must be defined and approved in the Tailscale admin console before they can accept traffic.

Also updates the app documentation and translations for the new option.
@apfohl
apfohl force-pushed the advertise-services branch from 0b889d6 to 3379686 Compare July 17, 2026 11:27
@@ -0,0 +1,117 @@
#!/command/with-contenv bashio
# shellcheck shell=bash
export LOG_FD

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is not needed with the new base image with the new bashio. Will be removed in all other places later, with all the temporary workarounds.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't know that.

Comment thread tailscale/DOCS.md
### Option: `services`

This option allows you to advertise other local services running on this device
as [Tailscale Services][tailscale_info_services]. Each service needs a name, a

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At all other places in DOCS the reference to the TS docs is in a separate line as "More information: ..." This is "important", because the device must to use tags!

Comment thread tailscale/DOCS.md

This option allows you to advertise other local services running on this device
as [Tailscale Services][tailscale_info_services]. Each service needs a name, a
local target address, a protocol, and a port to expose it on. The `svc:` prefix

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The advertise_tags option requires the tag: prefix. Maybe we should require svc: here also. What do you think?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the svc: prefix there in the first place, but after configuring it multiple times during testing I felt it annoying. But for parity to the advertise_tags I can revert this change. But honestly I would like the tags also more without the prefix. But that's just a personal preference. If it makes it more clean I'll revert. Just say. ;)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, we should remove tag: also, in a separate PR. If this PR is accepted, I will make a tag: removing PR. :)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep it in both places here and do another PR removing them together. So there is no mixed state in between.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is your decision. :)

Comment thread tailscale/DOCS.md
is added automatically by the app; do not include it in the configuration.

You can use this to expose apps running on your Home Assistant instance, such as
an audiobookshelf add-on, to your tailnet using a stable MagicDNS name.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no add-ons anymore, use apps please

Comment thread tailscale/config.yaml
- name: "match(^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$)"
target: "match(^(?:https?|tcp)://127\\.0\\.0\\.1:([1-9]\\d{0,3}|[1-5]\\d{4}|6[0-4]\\d{3}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5])$)"
protocol: "list(http|https|tcp|tls-terminated-tcp)"
port: "match(^([1-9]\\d{0,3}|[1-5]\\d{4}|6[0-4]\\d{3}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5])$)"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm /etc/s6-overlay/s6-rc.d/user/contents.d/share-homeassistant
fi

# Disable share-services service when no services are configured

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, it always has to start, to be able to remove unused services!!!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True!


# Disable share-services service when no services are configured
if ! bashio::config 'services' | jq -e '. | length > 0' > /dev/null; then
rm -f /etc/s6-overlay/s6-rc.d/user/contents.d/share-services

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't follow every advice from an AI, you don't need -f, if it is not there, fail during development :)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

declare -a configured_names=()
declare -a current_names=()

# Nothing to do when no services are configured

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, we still have to remove removed services!!!

# Build a list of configured service names (without the svc: prefix)
for service in "${configured_services[@]}"; do
name=$(jq -re '.name' <<< "${service}")
name="${name#svc:}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have svc: prefix there?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That will be not necessary anymore, when we make svc: mandatory.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean name="${name#svc:}" currently it is not needed, there is no svc: in services.name.


bashio::log.info "Configured service hosts: ${configured_names[*]}"

# Wait for tailscaled to be available

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

post-tailscaled already waited for this

sleep 1
done

while ! /opt/tailscale status --json --peers=false --self=false \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

post-tailscaled already waited for this

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, okay that's useful. I haven't caught this.

fi

# Build a list of currently configured service names
readarray -t current_names < <(jq -re '.services | keys[]' <<< "${current_config}" 2>/dev/null || true)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use bashio::jq() ?
-e and dev/null and ||true, we don't need this, use bashio::jq IMHO


# Remove services that are no longer configured in this app
for service_name in "${current_names[@]}"; do
if [[ "${service_name}" != svc:* ]]; then

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do wee need this? just asking! what else can be there?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was ment as a safe guard agains when Tailscale should decide to put other things in the .service section then actual services. But you are questioning this correctly. Why should they do it. I'll remove that guard.

# Compare without the svc: prefix
if ! printf '%s\n' "${configured_names[@]}" | grep -qx "${service_name#svc:}"; then
bashio::log.info "Removing stale service host configuration for ${service_name}"
/opt/tailscale serve drain "${service_name}" >/dev/null 2>&1 || true

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should log at least a warning on error (an exit.nok would stop the app, so let it start up, but don't hide the error)


# Build a list of configured service names (without the svc: prefix)
for service in "${configured_services[@]}"; do
name=$(jq -re '.name' <<< "${service}")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bashio:jq ?


# Configure and advertise each service
for service in "${configured_services[@]}"; do
name=$(jq -re '.name' <<< "${service}")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bashio:jq ?

path=$(jq -re '.path // empty' <<< "${service}")

options=()
case "${protocol}" in

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

protocol's value is restricted by the config schema, validate only that it is in the accepted list, exit.nok if not (fail during development), then use it directly in a single line

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if ! "${protocol}" = @(http|https|tcp|tls-terminated-tcp); then
exit.nok "Invalid value '${protocol}' for services.protocol"
fi

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not very good in bash. Thanks for the advice.

;;
esac

if [[ -n "${path}" ]]; then

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bashio::var.has_value

fi

# Clean any existing configuration for this service before reconfiguring
/opt/tailscale serve drain "${service_name}" >/dev/null 2>&1 || true

@lmagyar lmagyar Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at least a warning should be logged when removing, otherwise when the serve below fails during recreation, nobody will know the root cause

/opt/tailscale serve clear "${service_name}" >/dev/null 2>&1 || true

bashio::log.info "Advertising service host for ${service_name}"
if ! /opt/tailscale serve --service="${service_name}" --yes "${options[@]}" "${target}"; then

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add "serve" and "target" to the options array above, this is how it is implemented everywhere else
do we need --yes?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it's not anymore. Earlier tailscale serve used to ask interactively when invoking with a service. I tried manually. It's no longer the case. I'll remove it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't they use it to check if https is enabled and ask whether they should enable it if not? AFAIK they don't do it in a non-interactive cli and just emit an error, but I'm not 100% sure about this. :(

path=$(jq -re '.path // empty' <<< "${service}")

options=()
case "${protocol}" in

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another idea. If https or tls-terminated-tcp is used, shouldn't we check once (!!!) that https support is enabled? Like in
https://github.com/hassio-addons/app-tailscale/blob/main/tailscale/rootfs/etc/s6-overlay/s6-rc.d/share-homeassistant/run#L24

Though we can say, that share_homeassistant is for the less experienced users, with more checks. :D

@lmagyar

lmagyar commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

And now a general comment.

The share_homeassistant option worked similarly a few years ago ("recreating" TS serve/funnel config), and as far as I remember there were complaints, that it comflicted manually configured serve configs, that's why that was changed to a front running serve/funnel with --bg=false.

So, when this change is merged, it will delete previously manually configured serve configs for the services. Hmmm, I think we should mark it (potentially) breaking change. The removal is logged, so I think it's fine.

name="${name#svc:}"
service_name="svc:${name}"
protocol=$(jq -re '.protocol' <<< "${service}")
port=$(jq -re '.port' <<< "${service}")

@lmagyar lmagyar Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My last question: can we use the same eg. 443 port here, as the share_homeassistant service uses? Services are running on a virtual tailnet name/IP, so it shouldn't be a problem. I'm asking, because I'm lazy to test it myself. :D

for service in "${configured_services[@]}"; do
name=$(jq -re '.name' <<< "${service}")
name="${name#svc:}"
configured_names+=("${name}")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more thing, to get configured_names, you can use bashio::config 'services.names' (if I remember correctly), and add some jq or grep to delete the svc: prefixes if needed, so this whole loop can be a one-liner I think.

@apfohl

apfohl commented Jul 19, 2026

Copy link
Copy Markdown
Author

@lmagyar Thanks for all the good feedback. I will work it in over the next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants