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

Rebase fork 3 #5

Open
wants to merge 81 commits into
base: main
Choose a base branch
from
Open

Rebase fork 3 #5

wants to merge 81 commits into from

Conversation

afhammad
Copy link

@afhammad afhammad commented Feb 6, 2025

I resolved the conflicts on the branch but somehow github is still showing them in the PR..

sxlijin and others added 30 commits December 20, 2022 09:15
When loading stats from the database, map IDs back to their canonical
short name, which is what we want to show in the frontend.  This is only
called once on cold start, so performance of loading all links isn't a
big concern.

Fixes tailscale#13

Signed-off-by: Will Norris <[email protected]>
Currently, the special "tagged-devices" user (which exists for any
tagged devices in the tailnet) can own go links.  This change permits
tagged devices to continue to create go links, but skips over them for
ownership checks, allowing any human user can take over ownership.

Fixes tailscale#37

Signed-off-by: Will Norris <[email protected]>
Updates the log msg to use owner.

Signed-off-by: Simon Hayward <[email protected]>
Use a build image built for the native architecture so that it doesn't
run in emulation mode.

Switch to Chainguard's wolfi/glibc build image. This limits our build
architectures to just amd64 and arm64, but that is sufficient for our
needs.

Updates tailscale#42
Updates tailscale#43

Signed-off-by: Will Norris <[email protected]>
Signed-off-by: Manuel Coppotelli <[email protected]>
* Add Flake file (Nix package, NixOS module)

This commit adds a Flake.nix file allowing Nix users to consume this
repo with `nix build`, `nix run` and adds a NixOS module to quickly spin
up the service.

* add github action file for nix build

---------
Signed-off-by: Kristoffer Dalby <[email protected]>
Co-authored-by: Xe Iaso <[email protected]>
PR tailscale#12 changes directory used by Docker image. This commit updates the fly.io
instructions to use the same directory.

Signed-off-by: Gabriel Wong <[email protected]>
Add "User" to the expansion environment for links.  The intent here it
support personalized go links such as:

go/mycal => https://calendar.google.com/calendar/embed?src={{.User}}

That's not a terribly interesting example, but there are others I intend
to use internally.

Signed-off-by: Will Norris <[email protected]>
It's not uncommon to have multiple links pointing to the same
destination, for example to handle different spellings of a word or
because different people created them at different times.

A common best practice is to select one as the "primary" link and point
the others to that link as "aliases".  This change updates resolveLink
to follow those aliases so that the final destination is returned when
using `golink -resolve-from-backup`.

Signed-off-by: Will Norris <[email protected]>
Also check error returned from tmpl.Execute. Refactor currentUser to
make the logic a little simpler, and make it a package var for easier
testing.

Signed-off-by: Will Norris <[email protected]>
To delete a link, go to its page in `.detail` and click on the "Delete"
button. Stats for the deleted link are removed as well.

Co-authored-by: Will Norris <[email protected]>
Signed-off-by: Gabriel Wong <[email protected]>
Signed-off-by: Will Norris <[email protected]>
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 tailscale#60

Signed-off-by: Will Norris <[email protected]>
bump version again, back to the latest commit on main, rather than the
latest released version. Otherwise, this causes issues in tailscale's
corp repo (sadly).

Signed-off-by: Will Norris <[email protected]>
patrickod and others added 28 commits February 28, 2024 17:00
Resolve broken nix build due to us using Go 1.21 to build a 1.22 minimum
package.

Signed-off-by: Patrick O'Doherty <[email protected]>
We have fixed the issue in the corp repo that required us to use
pseudo-versions for the tailscale.com module here. So we can now switch
to the latest stable version.

Signed-off-by: Will Norris <[email protected]>
we've had support for enabling the web UI in tsnet apps from the
beginning, but I don't think we've ever actually used it anywhere.
some of the settings exposed through the web ui don't make a ton of
sense for tsnet, and might not even work.  But we're working toward
being able to enable the web ui on clients by default (with all of the
existing restrictions and ACL enforcement in place), and golink seemed
like a good playground to try it in a tsnet app.

Signed-off-by: Will Norris <[email protected]>
If you visit a non-existent go link, we render the home page and pre-
populate the "short" input with the name of the link, and autofocus the
"long" input so that you can simply paste a long URL and submit.

It is common (at least at Tailscale) to create go links that correspond
to the name of a device on the tailnet.  For example, go/who points to
http://who/.  With this change, when you visit a non-existent go link,
we check to see if a peer exists on the tailnet with that name, and if
so we suggest that as the long URL.

Signed-off-by: Will Norris <[email protected]>
Also, fix a lint.

Fixes tailscale#116

Signed-off-by: Chris Palmer <[email protected]>
golink is a tsnet service, and Tailscale's data plane is very good at monitoring for changes to network state and reacting to them. As such, it doesn't need to wait for network-online.target, it can start up concurrently with everything else and shorten the long pole of bootup.

Additionally, network-online.target is an antipattern in systemd that almost never means what people want it to mean. "Online" has no precise definition, and (I posit) almost never matches the ideal version of "online" that people have in their mind. It specifically does _not_ mean that the network functions, or that any particular flavor of connectivity exists. A machine behind a captive portal is "online" for the purposes of bootup, and so is a machine that got a DHCP lease but is having all its packets blackholed. Systemd has a whole page of documentation on "what does online even mean", because this is such a recurring point of confusion: https://systemd.io/NETWORK_ONLINE/

It is almost always wrong to depend on network-online.target, and I wish it was named slow-down-boot-for-no-reason.target, which is how most downstream programs use it.

</rant>, the point is, golink is a well-behaved service that reacts to connectivity changes on the fly (it has to, that's what tailscale does), and so can be started concurrently with networking and other services.
Add a "Match" template func, which uses regexp.MatchString to match a
value against a regular expression pattern.

Fixes tailscale#125

Signed-off-by: Will Norris <[email protected]>
we've never tagged stable releases, but should really do so.  This
change will cause our docker images to be tagged following typical
semver fashion... the initial `v1.0.0` release will be tagged `v1`,
`v1.0`, `v1.0.0`, and `latest`.

Updates tailscale#104

Signed-off-by: Will Norris <[email protected]>
Two fixes, both of which would be sufficient on their own, but are both
still worth doing:
 - redirect /.detail/ URLs to always use canonical link names. For
   example, for a go/foo link, a request to /.detail/F-O-O will redirect
   to /.detail/foo.
 - use the canonical link short name for xsrf token generation and
   validation, rather than the user-provided short name.

Fixes tailscale#128

Signed-off-by: Will Norris <[email protected]>
Signed-off-by: Will Norris <[email protected]>
Co-authored-by: Will Norris <[email protected]>
This allows us to include the custom hostname in the sample form.

Updates tailscale#133

Signed-off-by: Will Norris <[email protected]>
Chainguard removed arm/v7 support from their free images:
https://www.chainguard.dev/unchained/changes-to-static-git-and-busybox-developer-images

Switch to the official `go` image for builds and distroless for
packaging.

Signed-off-by: Andrew Lytvynov <[email protected]>
* Update to Tailscale v1.72.0

Signed-off-by: Andrea Gottardo <[email protected]>

* Bump to v1.72.1

Signed-off-by: Andrea Gottardo <[email protected]>

---------

Signed-off-by: Andrea Gottardo <[email protected]>
When resolving links from an offline backup, this creates extra noise.

Updates tailscale/corp#22700

Signed-off-by: Will Norris <[email protected]>
Without the git CLI, `go build` will not produce the embedded VCS
metadata that's used to report the commit hash in node version string.
This fixes the `1.72.1-ERR-BuildInfo` version string reported to
Tailscale.

Fixes tailscale#140

Signed-off-by: Andrew Lytvynov <[email protected]>
We need TrimPrefix and ToUpper for some links at Tailscale, and might as
well ToLower as well at that point.

Updates tailscale#10

Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d
Signed-off-by: Will Norris <[email protected]>
Updates tailscale#144

Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d
Signed-off-by: Will Norris <[email protected]>
By default, the directory chosen by tsnet is based on the name of the binary.
Allow the operator to set it explicitly, to avoid confusing deployments.

Signed-off-by: M. J. Fromberger <[email protected]>
* go.mod: use latest corp build of tailscale

Signed-off-by: Keli Velazquez <[email protected]>
It's not uncommon for auto-linkers or simple copy/paste errors to
accidentally include trailing punctuation in a golink. When resolving
links, if the initial link was not found, then try again with common
punctuation (that is invalid in link names anyway) removed.

Fixes tailscale#148

Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d
Signed-off-by: Will Norris <[email protected]>
@afhammad afhammad requested a review from evanob February 6, 2025 13:56
Copy link

@evanob evanob left a comment

Choose a reason for hiding this comment

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

🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.