134 Commits

Author SHA1 Message Date
Juan Font Alonso
d29411408b Merge branch 'main' into bump-tailscale-v1.30 2022-09-03 16:20:25 +02:00
Juan Font Alonso
f519c513c2 Target go 1.19 in go.mod 2022-09-03 12:21:04 +02:00
Juan Font Alonso
12385d4357 Target Tailscale v1.30.0 2022-09-01 20:50:56 +02:00
Juan Font Alonso
04e4fa785b Updated dependencies 2022-08-20 00:11:07 +02:00
Juan Font Alonso
f8958d4e22 Update xsync library (helps in #704) 2022-08-10 10:55:45 +02:00
Juan Font Alonso
70807e40f6 Updated base dependencies 2022-08-10 10:54:23 +02:00
Juan Font Alonso
9a01e3d192 Bump tailscale to 1.28.0 2022-08-10 10:47:49 +02:00
Juan Font Alonso
b344524a6d Update runc dependencies to fix security notification 2022-07-26 12:02:58 +02:00
Jiang Zhu
aca5646032 remove gin completely, ~2MB reduction on final binary 2022-07-16 02:03:46 +08:00
Juan Font Alonso
082fbead66 Added mux dependency 2022-06-20 21:12:23 +02:00
Juan Font Alonso
d89fb68a7a Switch to use gorilla's mux as muxer 2022-06-18 18:41:42 +02:00
Kristoffer Dalby
43fa7f9fd5 Upgrade tailscale lib to 1.26 2022-06-11 15:34:02 +00:00
Kristoffer Dalby
a443255b3e Validate isOutdated against all namespaces
This commit makes isOutdated validate a nodes necessity to update
against all namespaces, and not just the nodes own namespace (which made
more sense before).

getLastStateChange is now uses the passed namespaces as a filter,
meaning that not requesting any namespace will give you the total last
updated state.

In addition, the sync.Map is exchanged for a variant that uses generics
which allows us to remove some casting logic.
2022-05-30 13:35:40 +02:00
Kristoffer Dalby
59a1a85a2b Change to a go generics set implementation, no more casting 🎉 2022-05-30 11:49:35 +02:00
Juan Font Alonso
4f3f0542d4 Fix some issues in testing with new hostname handling 2022-05-28 12:54:57 +02:00
Adrien Raffin-Caboisse
68417cc888
fix(go): add missing updated files 2022-05-03 20:37:06 +02:00
Kristoffer Dalby
db8db0299e Resolve merge 2022-04-25 16:58:06 +00:00
Kristoffer Dalby
a23035aee7 update rest of deps 2022-04-24 07:21:50 +00:00
Kristoffer Dalby
e51e6f487f Resolve merge conflict 2022-04-23 08:31:57 +00:00
Kristoffer Dalby
4d2949bda9 Upgrade tailscale dep 2022-04-23 08:29:26 +00:00
Kristoffer Dalby
ecf5259693 resolve merge conflict 2022-04-22 22:34:20 +02:00
Moritz Poldrack
3023323528
remove necessary buf installation
This commit adds buf as a regular dependency and go running it instead
of requiring installing buf to one's own GOBIN.
2022-04-21 20:23:21 +02:00
Kristoffer Dalby
2dacf839dc Upgrade tailscale dep 2022-04-21 08:35:08 +00:00
Kristoffer Dalby
5c285afda5
Merge branch 'main' into flake-build-env 2022-04-21 09:21:10 +01:00
Kristoffer Dalby
b781446e86 Upgrade to go 1.18 2022-03-17 17:43:11 +00:00
Kristoffer Dalby
a806694d23 fix gosum merge 2022-03-08 17:11:46 +00:00
Juan Font Alonso
cc0c88a63a Added small integration test for stun 2022-03-08 12:11:51 +01:00
Kristoffer Dalby
15f8cb5034 Remove hacky go tool install 2022-03-07 07:40:56 +00:00
Juan Font Alonso
9d43f589ae Added missing deps 2022-03-04 00:04:28 +01:00
Kristoffer Dalby
8a95fe517a Use specific types for all fields on machine (no datatypes.json)
This commit removes the need for datatypes.JSON and makes the code a bit
cleaner by allowing us to use proper types throughout the code when it
comes to hostinfo and other datatypes on the machine object.

This allows us to remove alot of unmarshal/marshal operations and remove
a lot of obsolete error checks.

This following commits will clean away a lot of untyped data and
uneccessary error checks.
2022-03-01 16:31:25 +00:00
Kristoffer Dalby
1cb39d914c Update dependencies 2022-03-01 07:35:17 +00:00
Kristoffer Dalby
bfbcea35a0 Remove dependency on CGO
This commit changes the SQLite dependency to one that does not depend on
CGO. It uses a C-to-Go translated sqlite library that is Pure go.
2022-02-22 16:51:54 +00:00
Kristoffer Dalby
2357fb6f80 Upgrade all dependencies 2022-02-11 08:43:31 +00:00
Kristoffer Dalby
ba8afdb7be Upgrade to tailscale 1.20.4 2022-02-11 08:39:00 +00:00
Kristoffer Dalby
726ccc8c1f Upgrade to latest tailscale 2022-01-28 18:15:41 +00:00
Juan Font Alonso
4660b265d9 Minor security updates in go.mod 2022-01-12 15:17:55 +01:00
Kristoffer Dalby
6295b0bd84 Go mod tidy 2021-11-27 20:34:46 +00:00
Kristoffer Dalby
2ae882d801 Update go version 2021-11-27 20:31:33 +00:00
Kristoffer Dalby
50b47adaa3 Upgrade tailscale to 1.18 2021-11-26 23:27:09 +00:00
Kristoffer Dalby
e1f45f9d07 Remove unused dep 2021-11-08 18:27:57 +00:00
Kristoffer Dalby
26718e8308 Revert gorm upgrade 2021-11-06 20:23:04 +00:00
Kristoffer Dalby
319237910b Resolve new dependencies 2021-11-04 22:28:35 +00:00
Kristoffer Dalby
cbf3f5d640 Resolve merge conflict 2021-10-30 15:33:01 +00:00
Kristoffer Dalby
a9da7c8fd9 Update go.mod 2021-10-26 20:41:35 +00:00
Raal Goff
74e6c1479e updates from code review 2021-10-10 17:22:42 +08:00
Juan Font
c4487b73c4
Merge branch 'main' into magic-dns-support 2021-10-09 12:24:07 +02:00
Kristoffer Dalby
2997f4d251
Merge branch 'main' into main 2021-10-08 22:21:41 +01:00
Kristoffer Dalby
f0c54490ed Allow multiple namespaces to be checked for state at the same time 2021-10-06 22:06:07 +00:00
Raal Goff
c487591437 use go-oidc instead of verifying and extracting tokens ourselves, rename oidc_endpoint to oidc_issuer to be more inline with spec 2021-10-06 17:19:15 +08:00
Juan Font Alonso
b02a9f9769 Go mod updates 2021-10-04 23:50:26 +02:00
Kristoffer Dalby
1d5b090579 Initial work on Prometheus metrics
This commit adds some Prometheus metrics to /metrics in headscale.

It will add the standard go metrics, some automatic gin metrics and some
initial headscale specific ones.

Some of them has been added to aid debugging #97 (loop bug)

In the future, we can use the metrics to get rid of the sleep in the
integration tests by checking that our expected number of nodes has been
registered:

```
headscale_machine_registrations_total
```
2021-10-04 16:28:07 +00:00
Kristoffer Dalby
0475eb6ef7
Move DB call of pollmap to Machine inside a function 2021-10-02 21:58:28 +01:00
Kristoffer Dalby
0393ab524c
Merge branch 'main' into main 2021-09-28 11:20:31 +01:00
Juan Font Alonso
2048e9e136 Added version checker on startup 2021-09-27 16:26:18 +02:00
Kristoffer Dalby
cc054d71fe
Merge branch 'main' into main 2021-09-26 21:35:26 +01:00
Kristoffer Dalby
9811809f6a
Resolve conflict 2021-09-26 20:51:07 +01:00
Raal Goff
e7a2501fe8 initial work on OIDC (SSO) integration 2021-09-26 16:53:05 +08:00
Kristoffer Dalby
2d39d6602c Merge remote-tracking branch 'upstream/main' into apple-mobileconfig 2021-09-19 18:00:40 +01:00
Kristoffer Dalby
40c5263927
Add initial code for generating Apple profiles
This code adds new http handlers that will generate iOS and macOS
configuration profiles allowing us to override the Control server of the
official Tailscale.app.

Currently, macOS is working, as I have not found the correct "key" to
inject for iOS.

This means that a profile will allow users to no longer log in via the
command line, but they can use the app.
2021-09-19 17:54:41 +01:00
Juan Font
5840f88251 Update tailscale dependencies to v1.14 2021-09-14 23:46:16 +02:00
Juan Font
2c2968473a Update basic dependencies 2021-09-14 23:42:19 +02:00
Juan Font
47b61c0cea
Merge pull request #86 from juanfont/better-ui
Improve tables in CLI
2021-08-16 09:33:47 +02:00
Juan Font
36f5f78f46 pterm dependency 2021-08-15 23:10:50 +02:00
Kristoffer Dalby
9698abbfd5
Resolve merge conflict 2021-08-13 10:33:19 +01:00
Kristoffer Dalby
4e077b053c Initial work, add integration tests
This commit adds integration tests to headscale. They are currently
quite simple, but it lays the groundwork for more comprehensive testing
and ensuring we dont break things with the official tailscale client.

The test works by leveraging Docker (via dockertest) to spin up a
Headscale container, and a number of tailscale containers (10).

Each tailscale container is joined to the headscale and then "passed on"
to the tests.

Currently three tests have been implemented:

- Have all tailscale containers join headscale (in the setup process)
- Get IP from each container (I plan to extend this with cross-ping)
- List nodes with headscales CLI and verify all has been registered

This test depends on Docker, and currently, I have not looked into
hooking it into Github Actions.
2021-08-08 17:50:32 +01:00
Kristoffer Dalby
73a00c89ff Try to detect color support, make color configurable
This commit tries to detect if users can render colors in their terminal
and only enables color logs if that is true.

It also adds no-color.org's NO_COLOR env var support to allow it to be
disabled.
2021-08-06 07:29:57 +01:00
Kristoffer Dalby
ee704f8ef3
Initial port to zerologger 2021-08-05 18:11:26 +01:00
Juan Font Alonso
0f649aae8b Ask for confirmation before deleting 2021-07-17 11:09:42 +02:00
Juan Font
bd86975d10 Added missing go.mod 2021-07-04 13:10:15 +02:00
Juan Font
5644dadaf9 Added dependency on hujson 2021-07-03 12:02:46 +02:00
Juan Font Alonso
736182f651 Update dependencies, including Tailscale 1.10.x 2021-06-25 18:56:49 +02:00
Juan Font Alonso
d67be9ef58 go.mod updates 2021-06-24 15:49:27 +02:00
Juan Font Alonso
84aba256bb Added some deps + updates 2021-05-15 00:06:17 +02:00
Ward Vandewege
b34e90c45d Fix bug in preauthkeys: namespace object was not populated in the return
value from CreatePreAuthKey and GetPreAuthKeys. Add tests for that bug,
and the rest of the preauthkeys functionality.

Fix path in `compress` Makefile target.
2021-05-02 14:58:05 -04:00
Ward Vandewege
f7c7b4873a Address a bunch of golangci-lint warnings. 2021-04-24 11:41:29 -04:00
Ward Vandewege
426b4fd98a Add support for automatic TLS certificates via Let's Encrypt. Add a
configuration reference to the README.md file.
2021-04-23 22:55:01 -04:00
Juan Font Alonso
9c40e829ec Create preauthkeys kinda working (not usable yet) 2021-04-23 00:40:42 +02:00
Juan Font Alonso
c284f3eefa Bump mod 2021-04-08 23:57:47 +02:00
Juan Font Alonso
db75cd39a7 Update in preparation of supporting exit nodes 2021-03-10 22:33:37 +01:00
Juan Font Alonso
b1d06f3ffd headscale now has a CLI - registration of machines occurs there 2021-02-21 01:30:03 +01:00
Juan Font Alonso
a6100dc4d0 Load DERP servers from file 2021-02-20 23:57:06 +01:00
Juan Font Alonso
c5fbc5baa8 Bumped dependencies 2021-02-20 22:43:07 +01:00
Juan Font Alonso
1ddb4febe8 Embedding frontend via Pkger 2020-07-04 13:38:58 +02:00
Juan Font Alonso
7198c8bd77 Initial commit 2020-06-21 12:32:08 +02:00