repo
stringlengths
6
47
file_url
stringlengths
77
269
file_path
stringlengths
5
186
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-07 08:35:43
2026-01-07 08:55:24
truncated
bool
2 classes
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/templates/oidc_callback.go
hscontrol/templates/oidc_callback.go
package templates import ( "github.com/chasefleming/elem-go" "github.com/chasefleming/elem-go/attrs" "github.com/chasefleming/elem-go/styles" ) // checkboxIcon returns the success checkbox SVG icon as raw HTML. func checkboxIcon() elem.Node { return elem.Raw(`<svg id="checkbox" aria-hidden="true" xmlns="http://ww...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/templates/general.go
hscontrol/templates/general.go
package templates import ( "github.com/chasefleming/elem-go" "github.com/chasefleming/elem-go/attrs" "github.com/chasefleming/elem-go/styles" "github.com/juanfont/headscale/hscontrol/assets" ) // mdTypesetBody creates a body element with md-typeset styling // that matches the official Headscale documentation desi...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/templates/register_web.go
hscontrol/templates/register_web.go
package templates import ( "fmt" "github.com/chasefleming/elem-go" "github.com/juanfont/headscale/hscontrol/types" ) func RegisterWeb(registrationID types.RegistrationID) *elem.Element { return HtmlStructure( elem.Title(nil, elem.Text("Registration - Headscale")), mdTypesetBody( headscaleLogo(), H1(ele...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/templates/design.go
hscontrol/templates/design.go
package templates import ( elem "github.com/chasefleming/elem-go" "github.com/chasefleming/elem-go/attrs" "github.com/chasefleming/elem-go/styles" ) // Design System Constants // These constants define the visual language for all Headscale HTML templates. // They ensure consistency across all pages and make it eas...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/templates/apple.go
hscontrol/templates/apple.go
package templates import ( "fmt" "github.com/chasefleming/elem-go" "github.com/chasefleming/elem-go/attrs" "github.com/chasefleming/elem-go/styles" ) func Apple(url string) *elem.Element { return HtmlStructure( elem.Title(nil, elem.Text("headscale - Apple")), mdTypesetBody( headscaleLogo(), H1(elem...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/mapper/batcher_lockfree.go
hscontrol/mapper/batcher_lockfree.go
package mapper import ( "crypto/rand" "errors" "fmt" "sync" "sync/atomic" "time" "github.com/juanfont/headscale/hscontrol/types" "github.com/juanfont/headscale/hscontrol/types/change" "github.com/puzpuzpuz/xsync/v4" "github.com/rs/zerolog/log" "tailscale.com/tailcfg" "tailscale.com/types/ptr" ) var errCo...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/mapper/tail_test.go
hscontrol/mapper/tail_test.go
package mapper import ( "encoding/json" "net/netip" "testing" "time" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/juanfont/headscale/hscontrol/routes" "github.com/juanfont/headscale/hscontrol/types" "tailscale.com/net/tsaddr" "tailscale.com/tailcfg" "tailscale.com/types...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/mapper/mapper_test.go
hscontrol/mapper/mapper_test.go
package mapper import ( "fmt" "net/netip" "slices" "testing" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/juanfont/headscale/hscontrol/policy" "github.com/juanfont/headscale/hscontrol/policy/matcher" "github.com/juanfont/headscale/hscontrol/routes" "github.com/juanfont/h...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/mapper/builder.go
hscontrol/mapper/builder.go
package mapper import ( "errors" "net/netip" "sort" "time" "github.com/juanfont/headscale/hscontrol/policy" "github.com/juanfont/headscale/hscontrol/types" "tailscale.com/tailcfg" "tailscale.com/types/views" "tailscale.com/util/multierr" ) // MapResponseBuilder provides a fluent interface for building tailc...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/mapper/suite_test.go
hscontrol/mapper/suite_test.go
package mapper import ( "testing" "gopkg.in/check.v1" ) func Test(t *testing.T) { check.TestingT(t) } var _ = check.Suite(&Suite{}) type Suite struct{}
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/mapper/batcher_test.go
hscontrol/mapper/batcher_test.go
package mapper import ( "errors" "fmt" "net/netip" "runtime" "strings" "sync" "sync/atomic" "testing" "time" "github.com/juanfont/headscale/hscontrol/db" "github.com/juanfont/headscale/hscontrol/derp" "github.com/juanfont/headscale/hscontrol/state" "github.com/juanfont/headscale/hscontrol/types" "github...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
true
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/mapper/mapper.go
hscontrol/mapper/mapper.go
package mapper import ( "encoding/json" "fmt" "io/fs" "net/url" "os" "path" "slices" "strconv" "strings" "time" "github.com/juanfont/headscale/hscontrol/state" "github.com/juanfont/headscale/hscontrol/types" "github.com/juanfont/headscale/hscontrol/types/change" "github.com/rs/zerolog/log" "tailscale.c...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/mapper/batcher.go
hscontrol/mapper/batcher.go
package mapper import ( "errors" "fmt" "time" "github.com/juanfont/headscale/hscontrol/state" "github.com/juanfont/headscale/hscontrol/types" "github.com/juanfont/headscale/hscontrol/types/change" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" "gith...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/mapper/builder_test.go
hscontrol/mapper/builder_test.go
package mapper import ( "testing" "time" "github.com/juanfont/headscale/hscontrol/state" "github.com/juanfont/headscale/hscontrol/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "tailscale.com/tailcfg" ) func TestMapResponseBuilder_Basic(t *testing.T) { cfg := &types.Config{...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/policy/policy.go
hscontrol/policy/policy.go
package policy import ( "net/netip" "slices" "github.com/juanfont/headscale/hscontrol/policy/matcher" "github.com/juanfont/headscale/hscontrol/types" "github.com/juanfont/headscale/hscontrol/util" "github.com/rs/zerolog/log" "github.com/samber/lo" "tailscale.com/net/tsaddr" "tailscale.com/types/views" ) // ...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/policy/policy_test.go
hscontrol/policy/policy_test.go
package policy import ( "fmt" "net/netip" "testing" "time" "github.com/google/go-cmp/cmp" "github.com/juanfont/headscale/hscontrol/policy/matcher" "github.com/juanfont/headscale/hscontrol/types" "github.com/juanfont/headscale/hscontrol/util" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
true
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/policy/policy_route_approval_test.go
hscontrol/policy/policy_route_approval_test.go
package policy import ( "fmt" "net/netip" "testing" "github.com/google/go-cmp/cmp" "github.com/juanfont/headscale/hscontrol/types" "github.com/juanfont/headscale/hscontrol/util" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "gorm.io/gorm" "tailscale.com/tailcfg" "tailscale.com/...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/policy/route_approval_test.go
hscontrol/policy/route_approval_test.go
package policy import ( "fmt" "net/netip" "testing" "github.com/google/go-cmp/cmp" "github.com/juanfont/headscale/hscontrol/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "gorm.io/gorm" "tailscale.com/types/ptr" ) func TestNodeCanApproveRoute(t *testing.T) { users := []ty...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/policy/policy_autoapprove_test.go
hscontrol/policy/policy_autoapprove_test.go
package policy import ( "fmt" "net/netip" "testing" policyv2 "github.com/juanfont/headscale/hscontrol/policy/v2" "github.com/juanfont/headscale/hscontrol/types" "github.com/juanfont/headscale/hscontrol/util" "github.com/stretchr/testify/assert" "gorm.io/gorm" "tailscale.com/net/tsaddr" "tailscale.com/types/...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/policy/pm.go
hscontrol/policy/pm.go
package policy import ( "net/netip" "github.com/juanfont/headscale/hscontrol/policy/matcher" policyv2 "github.com/juanfont/headscale/hscontrol/policy/v2" "github.com/juanfont/headscale/hscontrol/types" "tailscale.com/tailcfg" "tailscale.com/types/views" ) type PolicyManager interface { // Filter returns the c...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/policy/matcher/matcher_test.go
hscontrol/policy/matcher/matcher_test.go
package matcher
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/policy/matcher/matcher.go
hscontrol/policy/matcher/matcher.go
package matcher import ( "net/netip" "slices" "strings" "github.com/juanfont/headscale/hscontrol/util" "go4.org/netipx" "tailscale.com/net/tsaddr" "tailscale.com/tailcfg" ) type Match struct { srcs *netipx.IPSet dests *netipx.IPSet } func (m Match) DebugString() string { var sb strings.Builder sb.Write...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/policy/policyutil/reduce_test.go
hscontrol/policy/policyutil/reduce_test.go
package policyutil_test import ( "encoding/json" "fmt" "net/netip" "testing" "github.com/google/go-cmp/cmp" "github.com/juanfont/headscale/hscontrol/policy" "github.com/juanfont/headscale/hscontrol/policy/policyutil" "github.com/juanfont/headscale/hscontrol/types" "github.com/juanfont/headscale/hscontrol/uti...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/policy/policyutil/reduce.go
hscontrol/policy/policyutil/reduce.go
package policyutil import ( "github.com/juanfont/headscale/hscontrol/types" "github.com/juanfont/headscale/hscontrol/util" "tailscale.com/tailcfg" ) // ReduceFilterRules takes a node and a set of global filter rules and removes all rules // and destinations that are not relevant to that particular node. // // IMPO...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/policy/v2/policy.go
hscontrol/policy/v2/policy.go
package v2 import ( "cmp" "encoding/json" "errors" "fmt" "net/netip" "slices" "strings" "sync" "github.com/juanfont/headscale/hscontrol/policy/matcher" "github.com/juanfont/headscale/hscontrol/policy/policyutil" "github.com/juanfont/headscale/hscontrol/types" "github.com/rs/zerolog/log" "go4.org/netipx" ...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/policy/v2/types_test.go
hscontrol/policy/v2/types_test.go
package v2 import ( "encoding/json" "net/netip" "strings" "testing" "time" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/juanfont/headscale/hscontrol/types" "github.com/juanfont/headscale/hscontrol/util" "github.com/prometheus/common/model" "github.com/stretchr/testify/a...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
true
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/policy/v2/policy_test.go
hscontrol/policy/v2/policy_test.go
package v2 import ( "net/netip" "slices" "testing" "github.com/google/go-cmp/cmp" "github.com/juanfont/headscale/hscontrol/policy/matcher" "github.com/juanfont/headscale/hscontrol/types" "github.com/stretchr/testify/require" "gorm.io/gorm" "tailscale.com/tailcfg" "tailscale.com/types/ptr" ) func node(name,...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/policy/v2/types.go
hscontrol/policy/v2/types.go
package v2 import ( "errors" "fmt" "net/netip" "slices" "strconv" "strings" "github.com/go-json-experiment/json" "github.com/juanfont/headscale/hscontrol/types" "github.com/juanfont/headscale/hscontrol/util" "github.com/prometheus/common/model" "github.com/tailscale/hujson" "go4.org/netipx" "tailscale.co...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
true
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/policy/v2/filter.go
hscontrol/policy/v2/filter.go
package v2 import ( "errors" "fmt" "slices" "time" "github.com/juanfont/headscale/hscontrol/types" "github.com/juanfont/headscale/hscontrol/util" "github.com/rs/zerolog/log" "go4.org/netipx" "tailscale.com/tailcfg" "tailscale.com/types/views" ) var ErrInvalidAction = errors.New("invalid action") // compil...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/policy/v2/filter_test.go
hscontrol/policy/v2/filter_test.go
package v2 import ( "encoding/json" "net/netip" "slices" "strings" "testing" "time" "github.com/google/go-cmp/cmp" "github.com/juanfont/headscale/hscontrol/types" "github.com/prometheus/common/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "gorm.io/gorm" "tailscale.com/...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
true
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/policy/v2/utils.go
hscontrol/policy/v2/utils.go
package v2 import ( "errors" "slices" "strconv" "strings" "tailscale.com/tailcfg" ) // splitDestinationAndPort takes an input string and returns the destination and port as a tuple, or an error if the input is invalid. func splitDestinationAndPort(input string) (string, string, error) { // Find the last occurr...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/hscontrol/policy/v2/utils_test.go
hscontrol/policy/v2/utils_test.go
package v2 import ( "errors" "testing" "github.com/google/go-cmp/cmp" "tailscale.com/tailcfg" ) // TestParseDestinationAndPort tests the parseDestinationAndPort function using table-driven tests. func TestParseDestinationAndPort(t *testing.T) { testCases := []struct { input string expectedDst string...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/headscale/headscale.go
cmd/headscale/headscale.go
package main import ( "os" "time" "github.com/jagottsicher/termcolor" "github.com/juanfont/headscale/cmd/headscale/cli" "github.com/rs/zerolog" "github.com/rs/zerolog/log" ) func main() { var colors bool switch l := termcolor.SupportLevel(os.Stderr); l { case termcolor.Level16M: colors = true case termco...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/headscale/headscale_test.go
cmd/headscale/headscale_test.go
package main import ( "io/fs" "os" "path/filepath" "testing" "github.com/juanfont/headscale/hscontrol/types" "github.com/juanfont/headscale/hscontrol/util" "github.com/spf13/viper" "gopkg.in/check.v1" ) func Test(t *testing.T) { check.TestingT(t) } var _ = check.Suite(&Suite{}) type Suite struct{} func (...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/headscale/cli/health.go
cmd/headscale/cli/health.go
package cli import ( v1 "github.com/juanfont/headscale/gen/go/headscale/v1" "github.com/spf13/cobra" ) func init() { rootCmd.AddCommand(healthCmd) } var healthCmd = &cobra.Command{ Use: "health", Short: "Check the health of the Headscale server", Long: "Check the health of the Headscale server. This command...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/headscale/cli/policy.go
cmd/headscale/cli/policy.go
package cli import ( "fmt" "io" "os" v1 "github.com/juanfont/headscale/gen/go/headscale/v1" "github.com/juanfont/headscale/hscontrol/db" "github.com/juanfont/headscale/hscontrol/policy" "github.com/juanfont/headscale/hscontrol/types" "github.com/juanfont/headscale/hscontrol/util" "github.com/rs/zerolog/log" ...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/headscale/cli/root.go
cmd/headscale/cli/root.go
package cli import ( "fmt" "os" "runtime" "slices" "strings" "github.com/juanfont/headscale/hscontrol/types" "github.com/rs/zerolog" "github.com/rs/zerolog/log" "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/tcnksm/go-latest" ) const ( deprecateNamespaceMessage = "use --user" ) var cfgFil...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/headscale/cli/api_key.go
cmd/headscale/cli/api_key.go
package cli import ( "fmt" "strconv" "time" v1 "github.com/juanfont/headscale/gen/go/headscale/v1" "github.com/juanfont/headscale/hscontrol/util" "github.com/prometheus/common/model" "github.com/pterm/pterm" "github.com/rs/zerolog/log" "github.com/spf13/cobra" "google.golang.org/protobuf/types/known/timesta...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/headscale/cli/utils.go
cmd/headscale/cli/utils.go
package cli import ( "context" "crypto/tls" "encoding/json" "fmt" "os" v1 "github.com/juanfont/headscale/gen/go/headscale/v1" "github.com/juanfont/headscale/hscontrol" "github.com/juanfont/headscale/hscontrol/types" "github.com/juanfont/headscale/hscontrol/util" "github.com/rs/zerolog/log" "google.golang.o...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/headscale/cli/root_test.go
cmd/headscale/cli/root_test.go
package cli import ( "testing" ) func TestFilterPreReleasesIfStable(t *testing.T) { tests := []struct { name string currentVersion string tag string expectedFilter bool description string }{ { name: "stable version filters alpha tag", currentVersion: "0.23.0", ...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/headscale/cli/serve.go
cmd/headscale/cli/serve.go
package cli import ( "errors" "fmt" "net/http" "github.com/rs/zerolog/log" "github.com/spf13/cobra" "github.com/tailscale/squibble" ) func init() { rootCmd.AddCommand(serveCmd) } var serveCmd = &cobra.Command{ Use: "serve", Short: "Launches the headscale server", Args: func(cmd *cobra.Command, args []st...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/headscale/cli/configtest.go
cmd/headscale/cli/configtest.go
package cli import ( "github.com/rs/zerolog/log" "github.com/spf13/cobra" ) func init() { rootCmd.AddCommand(configTestCmd) } var configTestCmd = &cobra.Command{ Use: "configtest", Short: "Test the configuration.", Long: "Run a test of the configuration and exit.", Run: func(cmd *cobra.Command, args []stri...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/headscale/cli/preauthkeys.go
cmd/headscale/cli/preauthkeys.go
package cli import ( "fmt" "strconv" "strings" "time" v1 "github.com/juanfont/headscale/gen/go/headscale/v1" "github.com/prometheus/common/model" "github.com/pterm/pterm" "github.com/rs/zerolog/log" "github.com/spf13/cobra" "google.golang.org/protobuf/types/known/timestamppb" ) const ( DefaultPreAuthKeyEx...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/headscale/cli/nodes.go
cmd/headscale/cli/nodes.go
package cli import ( "fmt" "log" "net/netip" "slices" "strconv" "strings" "time" v1 "github.com/juanfont/headscale/gen/go/headscale/v1" "github.com/juanfont/headscale/hscontrol/util" "github.com/pterm/pterm" "github.com/samber/lo" "github.com/spf13/cobra" "google.golang.org/grpc/status" "google.golang.o...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/headscale/cli/debug.go
cmd/headscale/cli/debug.go
package cli import ( "fmt" v1 "github.com/juanfont/headscale/gen/go/headscale/v1" "github.com/juanfont/headscale/hscontrol/types" "github.com/rs/zerolog/log" "github.com/spf13/cobra" "google.golang.org/grpc/status" ) // Error is used to compare errors as per https://dave.cheney.net/2016/04/07/constant-errors t...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/headscale/cli/pterm_style.go
cmd/headscale/cli/pterm_style.go
package cli import ( "time" "github.com/pterm/pterm" ) func ColourTime(date time.Time) string { dateStr := date.Format("2006-01-02 15:04:05") if date.After(time.Now()) { dateStr = pterm.LightGreen(dateStr) } else { dateStr = pterm.LightRed(dateStr) } return dateStr }
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/headscale/cli/mockoidc.go
cmd/headscale/cli/mockoidc.go
package cli import ( "encoding/json" "errors" "fmt" "net" "net/http" "os" "strconv" "time" "github.com/oauth2-proxy/mockoidc" "github.com/rs/zerolog/log" "github.com/spf13/cobra" ) const ( errMockOidcClientIDNotDefined = Error("MOCKOIDC_CLIENT_ID not defined") errMockOidcClientSecretNotDefined = Err...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/headscale/cli/version.go
cmd/headscale/cli/version.go
package cli import ( "github.com/juanfont/headscale/hscontrol/types" "github.com/spf13/cobra" ) func init() { rootCmd.AddCommand(versionCmd) versionCmd.Flags().StringP("output", "o", "", "Output format. Empty for human-readable, 'json', 'json-line' or 'yaml'") } var versionCmd = &cobra.Command{ Use: "version"...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/headscale/cli/generate.go
cmd/headscale/cli/generate.go
package cli import ( "fmt" "github.com/spf13/cobra" "tailscale.com/types/key" ) func init() { rootCmd.AddCommand(generateCmd) generateCmd.AddCommand(generatePrivateKeyCmd) } var generateCmd = &cobra.Command{ Use: "generate", Short: "Generate commands", Aliases: []string{"gen"}, } var generatePrivateK...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/headscale/cli/users.go
cmd/headscale/cli/users.go
package cli import ( "errors" "fmt" "net/url" "strconv" v1 "github.com/juanfont/headscale/gen/go/headscale/v1" "github.com/juanfont/headscale/hscontrol/util" "github.com/pterm/pterm" "github.com/rs/zerolog/log" "github.com/spf13/cobra" "google.golang.org/grpc/status" ) func usernameAndIDFlag(cmd *cobra.Com...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/headscale/cli/dump_config.go
cmd/headscale/cli/dump_config.go
package cli import ( "fmt" "github.com/spf13/cobra" "github.com/spf13/viper" ) func init() { rootCmd.AddCommand(dumpConfigCmd) } var dumpConfigCmd = &cobra.Command{ Use: "dumpConfig", Short: "dump current config to /etc/headscale/config.dump.yaml, integration test only", Hidden: true, Args: func(cmd *co...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/hi/cleanup.go
cmd/hi/cleanup.go
package main import ( "context" "fmt" "log" "os" "path/filepath" "strings" "time" "github.com/cenkalti/backoff/v5" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/image" "github.com/docker/docker/client" "github.com/docker/do...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/hi/stats.go
cmd/hi/stats.go
package main import ( "context" "encoding/json" "errors" "fmt" "log" "sort" "strings" "sync" "time" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/events" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/clien...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/hi/docker.go
cmd/hi/docker.go
package main import ( "bytes" "context" "encoding/json" "errors" "fmt" "io" "log" "os" "os/exec" "path/filepath" "strings" "time" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/image" "github.com/docker/docker/api/types/mount" "github.com/docker/docker/client" "git...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/hi/doctor.go
cmd/hi/doctor.go
package main import ( "context" "errors" "fmt" "log" "os/exec" "strings" ) var ErrSystemChecksFailed = errors.New("system checks failed") // DoctorResult represents the result of a single health check. type DoctorResult struct { Name string Status string // "PASS", "FAIL", "WARN" Message str...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/hi/run.go
cmd/hi/run.go
package main import ( "errors" "fmt" "log" "os" "path/filepath" "strings" "time" "github.com/creachadair/command" ) var ErrTestPatternRequired = errors.New("test pattern is required as first argument or use --test flag") // formatRunningTestError creates a detailed error message about a running test. func f...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/hi/main.go
cmd/hi/main.go
package main import ( "context" "os" "github.com/creachadair/command" "github.com/creachadair/flax" ) var runConfig RunConfig func main() { root := command.C{ Name: "hi", Help: "Headscale Integration test runner", Commands: []*command.C{ { Name: "run", Help: "Run integration tests", ...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/cmd/mapresponses/main.go
cmd/mapresponses/main.go
package main import ( "encoding/json" "fmt" "os" "github.com/creachadair/command" "github.com/creachadair/flax" "github.com/juanfont/headscale/hscontrol/mapper" "github.com/juanfont/headscale/integration/integrationutil" ) type MapConfig struct { Directory string `flag:"directory,Directory to read map respon...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/tailscale.go
integration/tailscale.go
package integration import ( "io" "net/netip" "net/url" "time" "github.com/juanfont/headscale/hscontrol/types" "github.com/juanfont/headscale/hscontrol/util" "github.com/juanfont/headscale/integration/dockertestutil" "github.com/juanfont/headscale/integration/tsic" "tailscale.com/ipn/ipnstate" "tailscale.co...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/dns_test.go
integration/dns_test.go
package integration import ( "encoding/json" "fmt" "strings" "testing" "time" "github.com/juanfont/headscale/integration/hsic" "github.com/juanfont/headscale/integration/tsic" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "tailscale.com/tailcfg" ) func TestResolveMagicDNS(t *te...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/api_auth_test.go
integration/api_auth_test.go
package integration import ( "crypto/tls" "encoding/json" "fmt" "io" "net/http" "strings" "testing" "time" v1 "github.com/juanfont/headscale/gen/go/headscale/v1" "github.com/juanfont/headscale/integration/hsic" "github.com/juanfont/headscale/integration/tsic" "github.com/stretchr/testify/assert" "github....
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/tags_test.go
integration/tags_test.go
package integration import ( "sort" "testing" "time" v1 "github.com/juanfont/headscale/gen/go/headscale/v1" policyv2 "github.com/juanfont/headscale/hscontrol/policy/v2" "github.com/juanfont/headscale/integration/hsic" "github.com/juanfont/headscale/integration/tsic" "github.com/stretchr/testify/assert" "gith...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
true
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/scenario_test.go
integration/scenario_test.go
package integration import ( "testing" "github.com/juanfont/headscale/integration/dockertestutil" "github.com/juanfont/headscale/integration/tsic" "github.com/stretchr/testify/require" ) // This file is intended to "test the test framework", by proxy it will also test // some Headscale/Tailscale stuff, but mostl...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/embedded_derp_test.go
integration/embedded_derp_test.go
package integration import ( "testing" "time" "github.com/juanfont/headscale/integration/hsic" "github.com/juanfont/headscale/integration/tsic" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "tailscale.com/tailcfg" "tailscale.com/types/key" ) type ClientsSpec struct { Plain ...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/auth_web_flow_test.go
integration/auth_web_flow_test.go
package integration import ( "fmt" "net/netip" "slices" "testing" "time" v1 "github.com/juanfont/headscale/gen/go/headscale/v1" "github.com/juanfont/headscale/hscontrol/types" "github.com/juanfont/headscale/integration/hsic" "github.com/juanfont/headscale/integration/integrationutil" "github.com/samber/lo" ...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/cli_test.go
integration/cli_test.go
package integration import ( "cmp" "encoding/json" "fmt" "slices" "strconv" "strings" "testing" "time" tcmp "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" v1 "github.com/juanfont/headscale/gen/go/headscale/v1" policyv2 "github.com/juanfont/headscale/hscontrol/policy/v2" "github.com...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
true
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/acl_test.go
integration/acl_test.go
package integration import ( "fmt" "net/netip" "strconv" "strings" "testing" "time" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" v1 "github.com/juanfont/headscale/gen/go/headscale/v1" policyv2 "github.com/juanfont/headscale/hscontrol/policy/v2" "github.com/juanfont/headscale/hscont...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
true
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/route_test.go
integration/route_test.go
package integration import ( "cmp" "encoding/json" "fmt" "maps" "net/netip" "slices" "sort" "strconv" "strings" "testing" "time" cmpdiff "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" v1 "github.com/juanfont/headscale/gen/go/headscale/v1" policyv2 "github.com/juanfont/headscale/h...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
true
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/control.go
integration/control.go
package integration import ( "net/netip" v1 "github.com/juanfont/headscale/gen/go/headscale/v1" "github.com/juanfont/headscale/hscontrol" policyv2 "github.com/juanfont/headscale/hscontrol/policy/v2" "github.com/juanfont/headscale/hscontrol/routes" "github.com/juanfont/headscale/hscontrol/types" "github.com/ory...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/scenario.go
integration/scenario.go
package integration import ( "context" "crypto/tls" "encoding/json" "errors" "fmt" "io" "log" "net" "net/http" "net/http/cookiejar" "net/netip" "net/url" "os" "slices" "strconv" "strings" "sync" "testing" "time" v1 "github.com/juanfont/headscale/gen/go/headscale/v1" "github.com/juanfont/headscale...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
true
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/auth_key_test.go
integration/auth_key_test.go
package integration import ( "fmt" "net/netip" "slices" "strconv" "testing" "time" v1 "github.com/juanfont/headscale/gen/go/headscale/v1" policyv2 "github.com/juanfont/headscale/hscontrol/policy/v2" "github.com/juanfont/headscale/hscontrol/types" "github.com/juanfont/headscale/integration/hsic" "github.com...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/ssh_test.go
integration/ssh_test.go
package integration import ( "fmt" "log" "strings" "testing" "time" policyv2 "github.com/juanfont/headscale/hscontrol/policy/v2" "github.com/juanfont/headscale/integration/hsic" "github.com/juanfont/headscale/integration/tsic" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "tail...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/auth_oidc_test.go
integration/auth_oidc_test.go
package integration import ( "maps" "net/netip" "net/url" "sort" "strconv" "testing" "time" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" v1 "github.com/juanfont/headscale/gen/go/headscale/v1" policyv2 "github.com/juanfont/headscale/hscontrol/policy/v2" "github.com/juanfont/headsca...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
true
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/derp_verify_endpoint_test.go
integration/derp_verify_endpoint_test.go
package integration import ( "fmt" "net" "strconv" "testing" "github.com/juanfont/headscale/hscontrol/util" "github.com/juanfont/headscale/integration/dsic" "github.com/juanfont/headscale/integration/hsic" "github.com/juanfont/headscale/integration/integrationutil" "github.com/juanfont/headscale/integration/...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/general_test.go
integration/general_test.go
package integration import ( "context" "encoding/json" "fmt" "net/netip" "strconv" "strings" "testing" "time" v1 "github.com/juanfont/headscale/gen/go/headscale/v1" "github.com/juanfont/headscale/hscontrol/types" "github.com/juanfont/headscale/hscontrol/util" "github.com/juanfont/headscale/integration/hsi...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
true
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/helpers.go
integration/helpers.go
package integration import ( "bufio" "bytes" "fmt" "io" "net/netip" "strconv" "strings" "sync" "testing" "time" "github.com/cenkalti/backoff/v5" "github.com/google/go-cmp/cmp" v1 "github.com/juanfont/headscale/gen/go/headscale/v1" policyv2 "github.com/juanfont/headscale/hscontrol/policy/v2" "github.com...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
true
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/tsic/tsic.go
integration/tsic/tsic.go
package tsic import ( "archive/tar" "bytes" "context" "encoding/json" "errors" "fmt" "io" "log" "net/netip" "net/url" "os" "reflect" "runtime/debug" "slices" "strconv" "strings" "time" "github.com/cenkalti/backoff/v5" "github.com/juanfont/headscale/hscontrol/types" "github.com/juanfont/headscale/h...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
true
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/dsic/dsic.go
integration/dsic/dsic.go
package dsic import ( "crypto/tls" "errors" "fmt" "log" "net" "net/http" "strconv" "strings" "time" "github.com/juanfont/headscale/hscontrol/util" "github.com/juanfont/headscale/integration/dockertestutil" "github.com/juanfont/headscale/integration/integrationutil" "github.com/ory/dockertest/v3" "github...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/hsic/hsic.go
integration/hsic/hsic.go
package hsic import ( "archive/tar" "bytes" "cmp" "crypto/tls" "encoding/json" "errors" "fmt" "io" "log" "maps" "net/http" "net/netip" "os" "path" "path/filepath" "sort" "strconv" "strings" "time" "github.com/davecgh/go-spew/spew" v1 "github.com/juanfont/headscale/gen/go/headscale/v1" "github.co...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
true
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/hsic/config.go
integration/hsic/config.go
package hsic import "github.com/juanfont/headscale/hscontrol/types" func MinimumConfigYAML() string { return ` private_key_path: /tmp/private.key noise: private_key_path: /tmp/noise_private.key ` } func DefaultConfigEnv() map[string]string { return map[string]string{ "HEADSCALE_LOG_LEVEL": ...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/integrationutil/util.go
integration/integrationutil/util.go
package integrationutil import ( "archive/tar" "bytes" "crypto/rand" "crypto/rsa" "crypto/x509" "crypto/x509/pkix" "encoding/pem" "fmt" "io" "math/big" "path/filepath" "time" "github.com/juanfont/headscale/hscontrol/types" "github.com/juanfont/headscale/hscontrol/util" "github.com/juanfont/headscale/in...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/dockertestutil/network.go
integration/dockertestutil/network.go
package dockertestutil import ( "errors" "fmt" "log" "net" "github.com/juanfont/headscale/hscontrol/util" "github.com/ory/dockertest/v3" "github.com/ory/dockertest/v3/docker" ) var ErrContainerNotFound = errors.New("container not found") func GetFirstOrCreateNetwork(pool *dockertest.Pool, name string) (*dock...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/dockertestutil/config.go
integration/dockertestutil/config.go
package dockertestutil import ( "fmt" "os" "strings" "time" "github.com/juanfont/headscale/hscontrol/util" "github.com/ory/dockertest/v3" ) const ( // TimestampFormatRunID is used for generating unique run identifiers // Format: "20060102-150405" provides compact date-time for file/directory names. Timestam...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/dockertestutil/build.go
integration/dockertestutil/build.go
package dockertestutil import ( "context" "os/exec" "time" ) // RunDockerBuildForDiagnostics runs docker build manually to get detailed error output. // This is used when a docker build fails to provide more detailed diagnostic information // than what dockertest typically provides. // // Returns the build output ...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/dockertestutil/execute.go
integration/dockertestutil/execute.go
package dockertestutil import ( "bytes" "errors" "fmt" "sync" "time" "github.com/ory/dockertest/v3" ) const dockerExecuteTimeout = time.Second * 10 var ( ErrDockertestCommandFailed = errors.New("dockertest command failed") ErrDockertestCommandTimeout = errors.New("dockertest command timed out") ) type Exe...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/integration/dockertestutil/logs.go
integration/dockertestutil/logs.go
package dockertestutil import ( "bytes" "context" "io" "log" "os" "path" "github.com/ory/dockertest/v3" "github.com/ory/dockertest/v3/docker" ) const filePerm = 0o644 func WriteLog( pool *dockertest.Pool, resource *dockertest.Resource, stdout io.Writer, stderr io.Writer, ) error { return pool.Client.Lo...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/tools/capver/main.go
tools/capver/main.go
package main //go:generate go run main.go import ( "context" "encoding/json" "errors" "fmt" "go/format" "io" "log" "net/http" "os" "regexp" "slices" "sort" "strconv" "strings" xmaps "golang.org/x/exp/maps" "tailscale.com/tailcfg" ) const ( ghcrTokenURL = "https://ghcr.io/token?servic...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/gen/go/headscale/v1/apikey.pb.go
gen/go/headscale/v1/apikey.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 // protoc (unknown) // source: headscale/v1/apikey.proto package v1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.g...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/gen/go/headscale/v1/user.pb.go
gen/go/headscale/v1/user.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 // protoc (unknown) // source: headscale/v1/user.proto package v1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.gol...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/gen/go/headscale/v1/policy.pb.go
gen/go/headscale/v1/policy.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 // protoc (unknown) // source: headscale/v1/policy.proto package v1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.g...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/gen/go/headscale/v1/node.pb.go
gen/go/headscale/v1/node.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 // protoc (unknown) // source: headscale/v1/node.proto package v1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.gol...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
true
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/gen/go/headscale/v1/device.pb.go
gen/go/headscale/v1/device.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 // protoc (unknown) // source: headscale/v1/device.proto package v1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.g...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/gen/go/headscale/v1/headscale_grpc.pb.go
gen/go/headscale/v1/headscale_grpc.pb.go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: headscale/v1/headscale.proto package v1 import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
true
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/gen/go/headscale/v1/headscale.pb.go
gen/go/headscale/v1/headscale.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 // protoc (unknown) // source: headscale/v1/headscale.proto package v1 import ( _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/gen/go/headscale/v1/preauthkey.pb.go
gen/go/headscale/v1/preauthkey.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 // protoc (unknown) // source: headscale/v1/preauthkey.proto package v1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "goog...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
false
juanfont/headscale
https://github.com/juanfont/headscale/blob/84c092a9f9875ed274aa40c9c14ebbcb05166f43/gen/go/headscale/v1/headscale.pb.gw.go
gen/go/headscale/v1/headscale.pb.gw.go
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. // source: headscale/v1/headscale.proto /* Package v1 is a reverse proxy. It translates gRPC into RESTful JSON APIs. */ package v1 import ( "context" "errors" "io" "net/http" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosyst...
go
BSD-3-Clause
84c092a9f9875ed274aa40c9c14ebbcb05166f43
2026-01-07T08:36:04.247985Z
true
halfrost/LeetCode-Go
https://github.com/halfrost/LeetCode-Go/blob/d78a9e0927a302038992428433d2eb450efd93a2/leetcode/1380.Lucky-Numbers-in-a-Matrix/1380. Lucky Numbers in a Matrix_test.go
leetcode/1380.Lucky-Numbers-in-a-Matrix/1380. Lucky Numbers in a Matrix_test.go
package leetcode import ( "fmt" "testing" ) type question1380 struct { para1380 ans1380 } // para 是参数 // one 代表第一个参数 type para1380 struct { one [][]int } // ans 是答案 // one 代表第一个答案 type ans1380 struct { one []int } func Test_Problem1380(t *testing.T) { qs := []question1380{ { para1380{[][]int{{3, 7, 8...
go
MIT
d78a9e0927a302038992428433d2eb450efd93a2
2026-01-07T08:36:06.754118Z
false
halfrost/LeetCode-Go
https://github.com/halfrost/LeetCode-Go/blob/d78a9e0927a302038992428433d2eb450efd93a2/leetcode/1380.Lucky-Numbers-in-a-Matrix/1380. Lucky Numbers in a Matrix.go
leetcode/1380.Lucky-Numbers-in-a-Matrix/1380. Lucky Numbers in a Matrix.go
package leetcode func luckyNumbers(matrix [][]int) []int { t, r, res := make([]int, len(matrix[0])), make([]int, len(matrix[0])), []int{} for _, val := range matrix { m, k := val[0], 0 for j := 0; j < len(matrix[0]); j++ { if val[j] < m { m = val[j] k = j } if t[j] < val[j] { t[j] = val[j] ...
go
MIT
d78a9e0927a302038992428433d2eb450efd93a2
2026-01-07T08:36:06.754118Z
false
halfrost/LeetCode-Go
https://github.com/halfrost/LeetCode-Go/blob/d78a9e0927a302038992428433d2eb450efd93a2/leetcode/0171.Excel-Sheet-Column-Number/171. Excel Sheet Column Number.go
leetcode/0171.Excel-Sheet-Column-Number/171. Excel Sheet Column Number.go
package leetcode func titleToNumber(s string) int { val, res := 0, 0 for i := 0; i < len(s); i++ { val = int(s[i] - 'A' + 1) res = res*26 + val } return res }
go
MIT
d78a9e0927a302038992428433d2eb450efd93a2
2026-01-07T08:36:06.754118Z
false
halfrost/LeetCode-Go
https://github.com/halfrost/LeetCode-Go/blob/d78a9e0927a302038992428433d2eb450efd93a2/leetcode/0171.Excel-Sheet-Column-Number/171. Excel Sheet Column Number_test.go
leetcode/0171.Excel-Sheet-Column-Number/171. Excel Sheet Column Number_test.go
package leetcode import ( "fmt" "testing" ) type question171 struct { para171 ans171 } // para 是参数 // one 代表第一个参数 type para171 struct { s string } // ans 是答案 // one 代表第一个答案 type ans171 struct { one int } func Test_Problem171(t *testing.T) { qs := []question171{ { para171{"A"}, ans171{1}, }, {...
go
MIT
d78a9e0927a302038992428433d2eb450efd93a2
2026-01-07T08:36:06.754118Z
false