Help us shape the future of Go! Take the 2026 Go Developer Survey

kombifynotify

package
v0.55.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package kombifynotify is the node-side custody of the opt-in "kombify notify" integration of Smart Home.

StackKits is the node's custody holder. When the owner turns on the kombify-notify workload setting, Apply creates two files next to the access manifest, in <workspace>/.stackkit/kombify-notify/:

  • token holds the bearer secret that Home Assistant presents to the local Techstack agent. It is created once and never rotated by a re-apply.
  • listen holds the single host:port the agent must bind. It is the gateway address of the Docker network Home Assistant is attached to, so the container can reach it and nothing else can.

Both files are written by StackKits and only read by the agent. The token reaches Home Assistant only through the owner-only secrets file that Apply bind-mounts; it never appears in a plan, receipt, state file, log, command line or generated configuration.

Index

Constants

View Source
const (
	// Port is the node-local port the Techstack agent binds.
	Port = 18741
	// DirectoryRelPath is the custody directory beside .stackkit/access.json.
	DirectoryRelPath = ".stackkit/kombify-notify"
	// TokenFile and ListenFile are the two files the agent reads.
	TokenFile  = "token"
	ListenFile = "listen"
)
View Source
const (
	// RequestPath is the agent route Home Assistant posts to.
	RequestPath = "/v1/user-notifications"
	// SecretKey is the secrets.yaml key that holds the Authorization header.
	SecretKey = "kombify_notify_authorization"
)

Variables

View Source
var ErrCustodyMissing = errors.New("kombify notify token custody is missing")

ErrCustodyMissing means the owner enabled the integration but Apply has not created its token yet. Inspection never creates it.

Functions

func Ensure

func Ensure(workspace string, gateway netip.Addr) (string, error)

Ensure creates the token when absent, never replaces an existing one, and publishes the listen address. It returns the token for the caller's owner-only secrets file.

func HomeAssistantPlatformYAML

func HomeAssistantPlatformYAML(gateway netip.Addr) (string, error)

HomeAssistantPlatformYAML is the notify platform file for the gateway address. It names no secret: the Authorization header is a !secret reference that Home Assistant resolves from the secrets.yaml beside this file.

Home Assistant's REST notify sends {"text": <message>} and merges only the platform's own data_template, never a service call's data, so the template forwards exactly two author-set fields. The audience is "member" whenever a target is given (the target becomes member_username), the author's audience otherwise, and "me" when neither is set.

func HomeAssistantSecretsYAML

func HomeAssistantSecretsYAML(token string) string

HomeAssistantSecretsYAML is the secrets file beside the platform file. It is the one generated artifact besides the token file that holds the secret and is persisted owner-only; Home Assistant resolves the nearest secrets.yaml from the including file's directory upward, so the owner's own /config/secrets.yaml stays untouched.

func ListenAddress

func ListenAddress(gateway netip.Addr) (string, error)

ListenAddress renders the exact host:port line the agent binds.

func Load

func Load(workspace string) (string, error)

Load reads the existing token without creating anything.

func ValidateGateway

func ValidateGateway(gateway netip.Addr) error

ValidateGateway admits only a private IPv4 address of a container bridge. A public, loopback, link-local or unspecified address would either expose the agent or be unreachable from a bridged container.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL