Documentation
¶
Index ¶
- Constants
- Variables
- func CheckShells(preferredShell string) string
- func ConvertToBytes(input string) (int64, error)
- func CopyFields(src, dst interface{}, fields []string) error
- func DecryptSSHPrivateKey(encryptionKey string, privateKey string) string
- func DownloadUnpackTgz(downloadURL string, destDir string) error
- func FixListenAddress(address string) string
- func GenerateCertificate(dnsNames []string, ipAddresses []net.IP) (string, string, error)
- func GetGitHubKeys(username string) (string, error)
- func GetGitHubKeysArray(username string) ([]string, error)
- func GetLocalIP() (string, error)
- func HideConsoleIfOwned()
- func HostIP() string
- func InArray(slice []string, item string) bool
- func NewCopier(socket net.Conn, wsConnection *websocket.Conn) *copierConnections
- func OpenBrowser(url string) error
- func PrettyPrintJSON(v interface{}) error
- func PrintTable(table [][]string)
- func RedirectToSyslog(cmd *exec.Cmd)
- func RelaunchHidden() bool
- func ResolveHostIP(s string) string
- func SplitSSHPublicKeys(keys string) []string
- func UpdateAuthorizedKeys(keys []string, githubUsernames []string) error
- func UpdateSSHConfig(sshConfig string, alias string) error
- func UpdateSSHPrivateKey(privateKey string) error
- func UpgradeToWS(w http.ResponseWriter, r *http.Request) *websocket.Conn
- type CommandFrontmatter
- type SkillFrontmatter
Constants ¶
const HostIPToken = "${{ host_ip }}"
HostIPToken is a template function usable in any address value (e.g. server.agent_endpoint): `${{ host_ip }}:3010` renders to the host's IP address at startup. Agents run inside containers and cannot reach the host via 127.0.0.1, so endpoints advertised to them need the real interface IP. The ${{ }} delimiters match knot's template variable style (used to avoid clashing with Nomad interpolation); any spacing inside them works.
Variables ¶
var Timezones = []string{}/* 575 elements not displayed */
Functions ¶
func CheckShells ¶
func ConvertToBytes ¶
func CopyFields ¶
CopyFields copies specified fields from src to dst using reflection.
func DecryptSSHPrivateKey ¶ added in v0.25.0
func DownloadUnpackTgz ¶
func FixListenAddress ¶
func GenerateCertificate ¶
GenerateCertificate generates a self-signed certificate and private key in PEM format.
func GetGitHubKeys ¶
Download the public keys from GitHub, https://github.com/<username>.keys
func GetGitHubKeysArray ¶
func GetLocalIP ¶
Get the local IP address of the machine we're running on, interfaces are checked for being up.
func HideConsoleIfOwned ¶ added in v0.33.0
func HideConsoleIfOwned()
HideConsoleIfOwned is a no-op outside Windows.
func HostIP ¶ added in v0.33.0
func HostIP() string
HostIP returns the host's primary outbound IPv4 address. Physical interfaces are preferred — virtual interfaces (VPN/tailscale tunnels, docker/veth bridges) and their address ranges (CGNAT 100.64/10, link-local) are skipped first so advertised endpoints stay on durable addresses. If no physical candidate exists (e.g. a host only reachable via VPN) it falls back to the address the routing table would use for an external destination (UDP dial sends no packets), then to any non-loopback IPv4, then to loopback.
func OpenBrowser ¶ added in v0.33.0
OpenBrowser opens the specified URL in the default browser of the user. On Windows rundll32 is used rather than `cmd /c start` because cmd is a console application and would flash (or leave) a console window every time the tray menu opens the UI.
func PrettyPrintJSON ¶ added in v0.19.0
func PrettyPrintJSON(v interface{}) error
func PrintTable ¶
func PrintTable(table [][]string)
func RedirectToSyslog ¶
func RelaunchHidden ¶ added in v0.33.0
func RelaunchHidden() bool
RelaunchHidden is a no-op outside Windows.
func ResolveHostIP ¶ added in v0.33.0
ResolveHostIP renders any template functions in an address using the address funcs (currently host_ip). knot-style `${{ func }}` delimiters are normalised to Go template actions first so the $ is consumed. Strings that are not templates — or that fail to parse or execute — are returned unchanged, so plain addresses pass through untouched.
func SplitSSHPublicKeys ¶ added in v0.25.0
func UpdateAuthorizedKeys ¶
func UpdateSSHConfig ¶
func UpdateSSHPrivateKey ¶ added in v0.25.0
func UpgradeToWS ¶
Upgrade the connection to a websocket connection
Types ¶
type CommandFrontmatter ¶ added in v0.29.0
type CommandFrontmatter struct {
Name string
Description string
ArgumentHint string
AllowedTools []string
}
func ParseCommandFrontmatter ¶ added in v0.29.0
func ParseCommandFrontmatter(content string) (*CommandFrontmatter, error)
type SkillFrontmatter ¶ added in v0.23.0
func ParseSkillFrontmatter ¶ added in v0.23.0
func ParseSkillFrontmatter(content string) (*SkillFrontmatter, error)