Commit Graph

261 Commits

Author SHA1 Message Date
Philipp Krivanec d0113732fe
optimize generateACLPeerCacheMap (#1377) 2023-04-26 06:02:54 +02:00
Kristoffer Dalby a5562850a7
MapResponse optimalisations, peer list integration tests (#1254)
Co-authored-by: Allen <979347228@qq.com>
2023-03-06 17:50:26 +01:00
dnaq a82a603db6
Return 404 on unmatched routes (#1201) 2023-03-03 17:14:30 +01:00
Kristoffer Dalby e3a2593344 Rename [Nn]amespace -> [Uu]ser in go code
Use gopls, ag and perl to rename all occurances of Namespace

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
2023-01-18 15:40:04 +01:00
Even Holthe 26282b7a54 Fix SIGSEGV crash related to map of state changes
See https://github.com/juanfont/headscale/issues/1114#issuecomment-1373698441
2023-01-10 22:26:21 +01:00
Juan Font 4de49f5f49 Add isEphemeral() method to Machine 2023-01-05 14:59:02 +01:00
Even Holthe 085912cfb4 expire machines after db expiry 2023-01-04 09:23:52 +01:00
Juan Font 593040b73d Run the Noise handlers under a new struct so we can access the noiseConn from the handlers
In TS2021 the MachineKey can be obtained from noiseConn.Peer() - contrary to what I thought before,
where I assumed MachineKey was dropped in TS2021.

By having a ts2021App and hanging from there the TS2021 handlers, we can fetch again the MachineKey.
2022-12-21 20:52:08 +01:00
Juan Font a506d0fcc8 Run handlePrimarySubnetFailover() with a ticker when Serve 2022-12-06 08:17:14 +01:00
Even Holthe 52a323b90d Add SSH capability advertisement
Advertises the SSH capability, and parses the SSH ACLs to pass to the
tailscale client. Doesn’t support ‘autogroup’ ACL functionality.

Co-authored-by: Daniel Brooks <db48x@headline.com>
2022-11-26 11:53:31 +01:00
Orville Q. Song e69176e200 Tweak 2022-11-24 16:13:47 +01:00
Orville Q. Song 72b9803a08 Change DBssl to string 2022-11-24 16:13:47 +01:00
Juan Font d461097247 Remove mTLS stuff from code 2022-11-19 19:50:34 +01:00
Grigoriy Mikhalkin 0e405c7ce0 remove private key constant errors from NewHeadscale 2022-11-10 15:35:22 +00:00
Kristoffer Dalby 527b580f5e
Add build flag to enable TS2019 (#928) 2022-11-04 11:26:33 +01:00
Andrey Pechkurov 0e12b66706 Simplify code around latest state change map updates 2022-10-27 23:22:33 +03:00
Jonathan de Jong 70ecda6fd1
Fix warning on success 2022-09-27 11:51:00 +02:00
Kristoffer Dalby ed58b2e4e2
Merge branch 'main' into fix-https-listen 2022-09-26 11:50:20 +02:00
Kristoffer Dalby 81dd9b2386
format
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
2022-09-26 11:34:04 +02:00
Kristoffer Dalby 9088521252
Move lets enc listener into go routine
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
2022-09-26 11:33:48 +02:00
Kristoffer Dalby fb25a06a66
Preserve current behaviour with a config flag
Add a configuration flag (default true to preserve current behaviour) to
allow headscale to start without OIDC being able to initialise.

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
2022-09-26 09:57:28 +02:00
Kristoffer Dalby dbe58e53e4
Allow headscale to start if oidc setup fails.
This commit makes headscale fall back to CLI authentication if oidc
fails to initialised and posts a warning to users.

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
2022-09-26 09:52:32 +02:00
Juan Font Alonso 434747e007 Use timeout in lets encrypt http server 2022-09-04 11:47:05 +02:00
Juan Font Alonso 0d074b1da6 setLastStateChangeToNow was always receiving nil 2022-09-04 11:37:49 +02:00
Juan Font Alonso 582122851d Go do not like underscores in packages 2022-09-04 11:34:23 +02:00
Juan Font Alonso f0a8a2857b Clarified why we have a different key 2022-08-20 00:23:33 +02:00
Juan Font 67ffebc30a
Merge branch 'main' into hs2021-v2 2022-08-18 17:56:56 +02:00
Azz 7e06abdca2
chore: azz forgot how to write code 2022-08-17 20:12:45 +01:00
Azz c316f53e23
fix: ci happy now? 2022-08-17 19:32:20 +01:00
Juan Font Alonso 0db7fc5ab7 Mark all namespaces to lastChange now 2022-08-16 13:39:15 +02:00
Azz 3f5ea7998f
Merge branch 'main' into main 2022-08-16 08:56:36 +01:00
azz 4c7f54020b
feat: add support for TLS with Postgres 2022-08-16 08:50:30 +01:00
Juan Font c701f9e817
Merge branch 'main' into hs2021-v2 2022-08-15 22:56:39 +02:00
Juan Font Alonso aaa33cf093 Minor change in router 2022-08-14 21:07:05 +02:00
Juan Font Alonso c10142f767 Added noise poll handler 2022-08-14 17:05:04 +02:00
Juan Font Alonso 1880035f6f Add registration handler over Noise protocol 2022-08-13 21:12:19 +02:00
Juan Font Alonso be24bacb79 Add noise mux and Noise path to base router 2022-08-13 20:55:37 +02:00
Victor Freire ec5acf7be2 Add ability to connect to PostgreSQL via unix socket 2022-08-13 11:34:12 -03:00
Juan Font Alonso 014e7abc68 Make private key errors constants 2022-08-13 14:46:23 +02:00
Juan Font Alonso 6e8e2bf508 Generate and read the Noise private key 2022-08-13 11:14:38 +02:00
Juan Font 8e56d8b425
Merge branch 'main' into switch-to-db-d 2022-08-11 13:11:38 +02:00
Juan Font Alonso 804d70386d Switch to nodekey in urls 2022-08-11 12:15:16 +02:00
Juan Font Alonso fb3b2e6bc8 Improve protocol implementation for client registration (fixes #706) 2022-08-11 12:11:02 +02:00
Adrien Raffin-Caboisse 79688e6187
chore(all): apply formater 2022-08-04 10:47:00 +02:00
Juan Font abae078855
Merge branch 'main' into feature/db-health-check 2022-07-24 22:10:16 +02:00
Juan Font 7c87ef6c86
Merge branch 'main' into graceful-shutdown 2022-07-22 09:06:46 +02:00
Juan Font Alonso a4d0efbe8d Fix API router 2022-07-21 23:57:07 +02:00
Grigoriy Mikhalkin 3f0639c87d graceful shutdown lint fixes 2022-07-21 23:47:20 +02:00
Grigoriy Mikhalkin 889eff265f graceful shutdown fix 2022-07-21 23:47:20 +02:00
Jiang Zhu aca5646032 remove gin completely, ~2MB reduction on final binary 2022-07-16 02:03:46 +08:00