Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add config option for node hostname #43

Merged
merged 1 commit into from
May 9, 2024
Merged

add config option for node hostname #43

merged 1 commit into from
May 9, 2024

Conversation

willnorris
Copy link
Member

this overrides the name used to refer to the node in the caddy config, and is mostly useful because it can include environment variables.

Closes #18

Copy link
Contributor

@irbekrm irbekrm left a comment

Choose a reason for hiding this comment

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

Nice, I tested it with a simple Caddyfile

{
	tailscale {
		foo {
			hostname "{$FOO}"
		}
		bar {
			hostname "{$BAR}"
		}
	}
}

:8081 {
	bind tailscale/foo
	respond "hello foo"
}
:8082 {
	bind tailscale/bar
	respond "hello bar"
}

and got the expected two Tailscale nodes with hostnames set to the respective env var values.

Suggestion: should we add hostname to the nested node config in the top level example Caddyfile for documentation?
Suggestion2: should we have a test case for this?

Base automatically changed from will/controlurl to main May 9, 2024 14:39
@willnorris willnorris force-pushed the will/hostname branch 3 times, most recently from e679b94 to cff4339 Compare May 9, 2024 15:03
@willnorris
Copy link
Member Author

added tests, as well as for the previous control_url change, which I missed. I'll document all of these new field together in an upcoming change.

this overrides the name used to refer to the node in the caddy config,
and is mostly useful because it can include environment variables.

Closes #18

Co-authored-by: kdevan <kaidevan@gmail.com>
Signed-off-by: Will Norris <will@tailscale.com>
@willnorris willnorris merged commit 98eb251 into main May 9, 2024
1 check passed
@willnorris willnorris deleted the will/hostname branch May 9, 2024 15:10
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.

None yet

2 participants