Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions setup-environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -421,13 +421,21 @@ tailnet_node_name() {
}

# Peers on this tailnet whose name looks like a hummingbot-api node, newline
# separated. Matches the requested name and the -1/-2 suffixes Tailscale adds,
# so the machine we are looking for is found under whichever one it got.
# separated.
#
# The suffix is deliberately `-.+` and not `-[0-9]+`. Tailscale's own
# de-duplication only ever appends numbers, but TAILSCALE_HOSTNAME is a
# setting, and a deployment that names its API per desk -- hummingbot-api-cornell,
# hummingbot-api-eu -- is the normal way to run more than one. Matching only
# numbers found nothing for those, and "nothing" is the branch that warns
# "deploy it on that machine first" about a node sitting right there in
# `tailscale status`, then asks the operator to type the name it just declined
# to recognise.
tailnet_api_peers() {
local want="${1:-hummingbot-api}"
tailscale status --peers 2>/dev/null \
| awk '{print $2}' \
| grep -E "^${want}(-[0-9]+)?$" || true
| grep -E "^${want}(-.+)?$" || true
}
Comment thread
greptile-apps[bot] marked this conversation as resolved.

# Make sure a tailscaled is running, then `tailscale up`.
Expand Down
Loading