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

allow links to be saved without known owner #72

Merged
merged 2 commits into from
May 2, 2023
Merged

Conversation

willnorris
Copy link
Member

If the current user can't be determined (either because of a legitimate error within the localapi client, or the user is coming through a subnet router and doesn't have a Tailscale IP address), go ahead and save the link without an owner. We are assuming that the requester should have permission to create links simply by virtue of being able to connect to the golink instance.

By saving links without an owner, these unknown users can continue to modify the link, and actual Tailscale users can take ownership. Once the link is owned, it can no longer be modified by anyone other than the owner.

The one potentially undesirable behavior this could introduce is if someone is serving their golink server over Funnel or any other public-facing proxy. Previously, that would have made golink read-only for non-Tailscale users. This change would make it read-write (for new links). Users desiring the old behavior would need to make their public-facing proxy only allow GET requests.

Fixes #60

@willnorris willnorris requested a review from shayne April 21, 2023 23:01
@willnorris willnorris force-pushed the will/ownerless-links branch from 3cbcbe8 to 8ef119a Compare April 21, 2023 23:01
@willnorris willnorris force-pushed the will/ownerless-links branch 3 times, most recently from ad14992 to 724238f Compare May 1, 2023 19:25
Copy link

@shayne shayne left a comment

Choose a reason for hiding this comment

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

One comment. Otherwise LGTM.

If the current user can't be determined (either because of a legitimate
error within the localapi client, or the user is coming through a subnet
router and doesn't have a Tailscale IP address), and the
-allow-unknown-users flag is set, then go ahead and save new links
without an owner.

By saving links without an owner, these unknown users can continue to
modify the link, and actual Tailscale users can take ownership. Once the
link is owned, it can no longer be modified by anyone other than the
owner.

Links that use the current user by having `{{ .User }}` in their long
URL cannot be resolved by unknown users and will return an error.

Fixes #60

Signed-off-by: Will Norris <[email protected]>
@willnorris willnorris force-pushed the will/ownerless-links branch from 724238f to 1838c9e Compare May 2, 2023 03:44
@willnorris willnorris force-pushed the will/ownerless-links branch from 22b6b3a to fe06ab3 Compare May 2, 2023 03:50
@willnorris
Copy link
Member Author

@kradalby I'm not sure what this nix build error means. I tried running the update-flake.sh script, which yeilded a new signature, but apparently it still doesn't match what nix is looking for? I'm going to submit this anyway, and we can try to address the nix issue later.

@willnorris willnorris merged commit ec2a3e9 into main May 2, 2023
@willnorris willnorris deleted the will/ownerless-links branch May 2, 2023 03:55
@kradalby
Copy link
Member

kradalby commented May 2, 2023

Strange, I opened #76 to address this, the weird part is that I just ran update-flake.sh and it worked.

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.

Cannot create a link from a subnet-routed host
3 participants