Compare commits

..

2232 Commits

Author SHA1 Message Date
Juan Font Alonso 07f6bad067 Docs update 2022-09-02 19:20:41 +02:00
Juan Font Alonso 9c8131b967 Updated changelog 2022-09-02 19:19:10 +02:00
Juan Font Alonso 3454e03331 Release related stuff to 1.19 2022-09-02 19:16:43 +02:00
Juan Font Alonso e84bda4fe6 Move Dockerfiles to 1.19 2022-09-02 19:13:15 +02:00
Juan Font Alonso f4152a166e Target go 1.19 in go.mod 2022-09-02 19:12:41 +02:00
Juan Font Alonso f3b99e31e4 Minor change in go.mod 2022-09-02 09:23:02 +02:00
Juan Font Alonso d5cc5b2bc8 Move integration tests to net/netip 2022-09-02 09:22:34 +02:00
Juan Font Alonso 51abf90db6 Use net/netip in derp server 2022-09-02 09:16:19 +02:00
Juan Font Alonso 71410cb6da Port dns to net/netip 2022-09-02 09:15:05 +02:00
Juan Font Alonso efb12f208c Move db to net/netip 2022-09-02 09:13:50 +02:00
Juan Font Alonso 64ede5dbef Move namespaces unit tests to net/netip 2022-09-02 09:13:07 +02:00
Juan Font Alonso 7af78152a4 Migrate routes to net/netip 2022-09-02 00:06:19 +02:00
Juan Font Alonso 290ec8bb19 Migrate ACLs to net/netip 2022-09-02 00:05:43 +02:00
Juan Font Alonso cdf48b1216 Migrate utils to net/netip 2022-09-02 00:05:18 +02:00
Juan Font Alonso a24710a961 Migrate machine to net/netip 2022-09-02 00:04:31 +02:00
Juan Font Alonso 197da8afcb Migrate config.go to net/netip 2022-09-02 00:04:04 +02:00
Juan Font Alonso 12385d4357 Target Tailscale v1.30.0 2022-09-01 20:50:56 +02:00
Juan Font e7f8bb866f Merge pull request #772 from juanfont/enable-1.30-in-tests
Add Tailscale v1.30.0 to the integration test roaster
2022-09-01 00:03:21 +02:00
Juan Font Alonso 1ad19a3bd8 Add 1.30.0 to the version roaster 2022-08-31 22:17:13 +02:00
Kristoffer Dalby cc0bec15ef Merge pull request #760 from juanfont/update-contributors 2022-08-23 21:21:50 +02:00
github-actions[bot] 20970b580a docs(README): update contributors 2022-08-22 12:47:42 +00:00
Juan Font 53857d418a Merge pull request #756 from huskyii/env_config
Env config
2022-08-22 14:47:01 +02:00
Jiang Zhu a81a4d274f Update CHANGELOG.md 2022-08-22 20:20:20 +08:00
Jiang Zhu ce4a1cf447 1. add noise key to config file
2. lower node check interval
2022-08-22 00:35:08 +08:00
Jiang Zhu 35dd9209b9 update CHANGELOG.md 2022-08-21 23:51:04 +08:00
Jiang Zhu 81f91f03b4 add env var to specify config location 2022-08-21 23:51:04 +08:00
Juan Font 84a5edf345 Merge pull request #738 from juanfont/hs2021-v2
Implement TS2021 protocol in headscale
2022-08-21 16:02:28 +02:00
Juan Font Alonso 4aafe6c9d1 Added line in CHANGELOG 2022-08-21 12:32:01 +02:00
Juan Font 3ab1487641 Merge branch 'main' into hs2021-v2 2022-08-21 11:57:33 +02:00
Kristoffer Dalby 0c7f1eac82 Merge pull request #757 from juanfont/changelog-0.16.4 2022-08-21 11:15:30 +02:00
Juan Font Alonso 6fe895fd22 Updated changelog for 0.16.4 2022-08-21 10:51:58 +02:00
Juan Font Alonso 71d22dc994 Added missing files 2022-08-21 10:47:45 +02:00
Juan Font Alonso 4424a9abc0 Noise private key now a nested field in config 2022-08-21 10:42:23 +02:00
Juan Font Alonso e20e818a42 Integrate expiration fixes (#754) in TS2021 branch 2022-08-20 11:46:44 +02:00
Juan Font 061e2fe4b4 Merge pull request #754 from Aluxima/expired-machine-registration
Fix cli registration of expired machines
2022-08-20 11:41:15 +02:00
Juan Font Alonso f0a8a2857b Clarified why we have a different key 2022-08-20 00:23:33 +02:00
Juan Font Alonso 175dfa1ede Update flake.nix sum 2022-08-20 00:15:46 +02:00
Juan Font Alonso 04e4fa785b Updated dependencies 2022-08-20 00:11:07 +02:00
Juan Font Alonso 6aec520889 Merge branch 'hs2021-v2' of https://github.com/juanfont/headscale into hs2021-v2 2022-08-20 00:06:58 +02:00
Juan Font Alonso e9906b522f Use upstream AcceptHTTP for the Noise upgrade 2022-08-20 00:06:26 +02:00
Juan Font 2f554133c5 Move comment up
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2022-08-19 23:49:06 +02:00
Juan Font Alonso 922b8b5365 Merge branch 'hs2021-v2' of https://github.com/juanfont/headscale into hs2021-v2 2022-08-19 16:32:18 +02:00
Juan Font Alonso c894db3dd4 Use common core for noise registration 2022-08-19 16:29:04 +02:00
Laurent Marchaud e85562268d Switch to using nodeKey instead of machineKey for expired machines registration
Signed-off-by: Laurent Marchaud <laurent@marchaud.com>
2022-08-19 15:48:35 +02:00
Laurent Marchaud fca33aacbe Fix rebased errors scope in machine.go
Signed-off-by: Laurent Marchaud <laurent@marchaud.com>
2022-08-19 15:07:01 +02:00
Juan Font e43713a866 Merge branch 'main' into hs2021-v2 2022-08-19 15:02:01 +02:00
Juan Font Alonso b6e3cd81c6 Fixed minor linting things 2022-08-19 14:27:40 +02:00
Juan Font Alonso 43ad0d4416 Removed unused method 2022-08-19 14:24:43 +02:00
Juan Font Alonso a33b5a5c00 Merge branch 'hs2021-v2' of https://github.com/juanfont/headscale into hs2021-v2 2022-08-19 14:20:55 +02:00
Juan Font Alonso e2bffd4f5a Make legacy protocol use common methods for client registration 2022-08-19 14:20:24 +02:00
Juan Font Alonso a87a9636e3 Expanded response marshal methods to support legacy and Noise 2022-08-19 14:19:29 +02:00
Laurent Marchaud a31432ee7b Fix changelog
Signed-off-by: Laurent Marchaud <laurent@marchaud.com>
2022-08-19 14:14:30 +02:00
Laurent Marchaud 0c66590108 Update changelog
Signed-off-by: Laurent Marchaud <laurent@marchaud.com>
2022-08-19 14:11:19 +02:00
Laurent Marchaud c6ea9b4b80 Fix cli registration of expired machines
Signed-off-by: Laurent Marchaud <laurent@marchaud.com>
2022-08-19 14:11:13 +02:00
Juan Font 19455399f4 Merge pull request #752 from juanfont/add-code-of-conduct
Create CODE_OF_CONDUCT.md
2022-08-19 00:38:01 +02:00
Juan Font 43ba1fb176 Prettier 2022-08-18 22:32:53 +00:00
Juan Font a6f56b4285 Create CODE_OF_CONDUCT.md 2022-08-18 22:08:33 +02:00
Juan Font 9d430d3c72 Update noise.go
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2022-08-18 21:33:56 +02:00
Juan Font Alonso f9a2a2b57a Add docker DNS IP to the remaining files 2022-08-18 18:07:15 +02:00
Juan Font Alonso e4d961cfad Merge branch 'hs2021-v2' of https://github.com/juanfont/headscale into hs2021-v2 2022-08-18 17:57:06 +02:00
Juan Font 67ffebc30a Merge branch 'main' into hs2021-v2 2022-08-18 17:56:56 +02:00
Juan Font Alonso cf731fafab Catch retry error in taildrop send 2022-08-18 17:56:01 +02:00
Juan Font Alonso f43a83aad7 Find out IPv4 for taildrop 2022-08-18 17:53:36 +02:00
Juan Font Alonso 7185f8dfea Only use released versions in public integration tests 2022-08-18 17:53:25 +02:00
Juan Font Alonso 8a707de5f1 Add local Docker DNS server (makes resolving http://headscale more reliable) 2022-08-18 17:53:04 +02:00
Juan Font 61bb6292b7 Merge pull request #746 from gozssky/patch-1
Fix charset typo in swagger.go
2022-08-18 12:23:45 +02:00
Juan Font 40e0ae99da Merge branch 'main' into patch-1 2022-08-18 11:49:15 +02:00
Juan Font 2dd615a4ef Merge pull request #745 from 617a7a/main
feat: add support for TLS with Postgres
2022-08-18 11:48:33 +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
Azz b6d324be69 Merge branch 'main' of https://github.com/juanfont/headscale
# Conflicts:
#	CHANGELOG.md
2022-08-17 19:31:26 +01:00
Juan Font f7380312d3 Merge pull request #747 from juanfont/fix-oidc
Fix error decoding OIDC claims (#744)
2022-08-17 18:30:50 +02:00
Juan Font 287309b65c Update changelog 2022-08-17 15:08:29 +00:00
Juan Font cc3de7e723 Fix error decoding claims (#744) 2022-08-17 15:03:10 +00:00
Yujie Xia e03b3029e3 Fix charset typo in swagger.go 2022-08-17 12:27:58 +08:00
Juan Font Alonso ba07bac46a Use IPv4 in the tests 2022-08-16 18:42:22 +02:00
Juan Font Alonso b71a881d0e Retry magicdns tests 2022-08-16 18:19:04 +02:00
Juan Font Alonso ce53bb0eee Minor changes to HEAD Dockerfile 2022-08-16 17:52:59 +02:00
Juan Font Alonso c0fe1abf4d Use node_key to find peers 2022-08-16 17:51:43 +02:00
Juan Font Alonso 0db7fc5ab7 Mark all namespaces to lastChange now 2022-08-16 13:39:15 +02:00
azz 701ad3e017 chore: update CHANGELOG.md 2022-08-16 09:09:28 +01:00
azz 0cc14d0aca feat: added db_ssl to config-example.yaml 2022-08-16 09:02:51 +01: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 Alonso eb461d0713 Enable HEAD and unstable in integration tests 2022-08-16 00:18:02 +02:00
Juan Font Alonso 128ec6717c Merge branch 'hs2021-v2' of https://github.com/juanfont/headscale into hs2021-v2 2022-08-15 23:35:24 +02:00
Juan Font Alonso b3cf5289f8 Use CapVer to offer Noise only to supported clients 2022-08-15 23:35:06 +02:00
Juan Font c701f9e817 Merge branch 'main' into hs2021-v2 2022-08-15 22:56:39 +02:00
Juan Font e1a95e2057 Merge pull request #734 from vtrf/postgres-connection-string
Add ability to connect to PostgreSQL via unix socket
2022-08-15 19:20:01 +02:00
Victor Freire 0a5db52855 Add ability to connect to PostgreSQL via unix socket 2022-08-15 11:55:38 -03:00
Juan Font 7197ade4b4 Merge branch 'main' into postgres-connection-string 2022-08-15 13:37:09 +02:00
Juan Font Alonso 865f1ffb3c Fix issues with DERP integration tests due to tailscale/tailscale#4323 2022-08-15 11:25:47 +02:00
Juan Font Alonso 8db7629edf Fix config file in integration tests for Noise 2022-08-15 10:53:06 +02:00
Juan Font Alonso b8980b9ed3 More minor logging stuff 2022-08-15 10:44:22 +02:00
Juan Font Alonso 5cf9eedf42 Minor logging corrections 2022-08-15 10:43:39 +02:00
Juan Font 193b4213b3 Merge pull request #739 from juanfont/updated-changelog-0.16.2
Added changelog entries for 0.16.x
2022-08-14 23:27:27 +02:00
Juan Font Alonso 8557bcedae Added changelog entries for 0.16.x 2022-08-14 23:22:41 +02:00
Juan Font Alonso f599bea216 Fixed issue when not using compression 2022-08-14 23:15:41 +02:00
Juan Font Alonso 704a19b0a5 Removed legacy method to generate MapResponse 2022-08-14 23:13:07 +02:00
Juan Font Alonso e29b344e0f Move Noise poll to new file, and use common poll 2022-08-14 23:12:18 +02:00
Juan Font Alonso 7cc227d01e Added Noise field to logging 2022-08-14 23:11:33 +02:00
Juan Font Alonso df8ecdb603 Working on common codebase for poll, starting with legacy 2022-08-14 22:57:03 +02:00
Juan Font Alonso f4bab6b290 Created common methods for keep and map poll responses 2022-08-14 22:50:39 +02:00
Juan Font Alonso 35f3dee1d0 Move Noise API to new file 2022-08-14 21:19:52 +02:00
Juan Font Alonso db89fdea23 Added file for legacy protocol 2022-08-14 21:16:29 +02:00
Juan Font Alonso d0898ecabc Move common parts of the protocol to dedicated file 2022-08-14 21:15:58 +02:00
Juan Font Alonso e640c6df05 Fixes in Noise poll (clients should work now) 2022-08-14 21:10:08 +02:00
Juan Font Alonso ab18c721bb Support for Noise machines in getPeers 2022-08-14 21:07:29 +02:00
Juan Font Alonso aaa33cf093 Minor change in router 2022-08-14 21:07:05 +02:00
Juan Font Alonso 0f09e19e38 Updated go.mod checksum 2022-08-14 17:09:14 +02:00
Juan Font Alonso b301405f24 Merge branch 'hs2021-v2' of https://github.com/juanfont/headscale into hs2021-v2 2022-08-14 17:06:03 +02:00
Juan Font Alonso 1f3032ad21 Merge branch 'main' into hs2021-v2 2022-08-14 17:05:51 +02:00
Juan Font Alonso c10142f767 Added noise poll handler 2022-08-14 17:05:04 +02:00
Juan Font Alonso 0d0042b7e6 Added zstd constant for linting 2022-08-14 17:04:07 +02:00
Juan Font Alonso 78a179c971 Minor update in docs 2022-08-14 16:53:54 +02:00
Juan Font Alonso cab828c9d4 Fixed unit tests to load config 2022-08-14 16:52:57 +02:00
Juan Font Alonso ff46f3ff49 Move reusable method to common api file 2022-08-14 16:13:17 +02:00
Juan Font b67cff50f5 Merge branch 'main' into hs2021-v2 2022-08-14 13:44:12 +02:00
Juan Font e29ac8a4ab Merge pull request #737 from juanfont/fix-machinekey-oidc
Fixed another recurrence of MachineKey
2022-08-14 13:44:01 +02:00
Juan Font Alonso 20d2615081 Check json encoder errors 2022-08-14 12:47:04 +02:00
Juan Font 7fb2f83540 Merge branch 'main' into fix-machinekey-oidc 2022-08-14 12:44:30 +02:00
Juan Font Alonso eb8d8f142c And more linting stuff 2022-08-14 12:44:07 +02:00
Juan Font Alonso 3bea20850a Some linting fixes 2022-08-14 12:40:22 +02:00
Juan Font Alonso ade1b73779 Output an error when a user runs headscale without noise_private_key_path defined 2022-08-14 12:35:14 +02:00
Juan Font Alonso 281ae59b5a Update integration tests to work with Noise protocol 2022-08-14 12:18:33 +02:00
Juan Font Alonso 90bb6ea907 Minor formatting changes 2022-08-14 12:10:20 +02:00
Juan Font Alonso 5b14cafddd Fixed another recurrence of MachineKey 2022-08-14 12:04:31 +02:00
Juan Font Alonso 9994fce9d5 Fixed some linting errors 2022-08-14 12:00:43 +02:00
Kristoffer Dalby c19e1a481e Merge pull request #736 from juanfont/update-contributors 2022-08-14 08:16:58 +02:00
Juan Font Alonso 39b85b02bb Move getMapResponse into reusable function by TS2019 and TS2021 2022-08-14 03:20:53 +02:00
Juan Font Alonso 7a91c82cda Merge branch 'main' into hs2021-v2 2022-08-14 03:07:43 +02:00
Juan Font Alonso c7cea9ef16 updated paths 2022-08-14 03:07:28 +02:00
github-actions[bot] d56b409cb9 docs(README): update contributors 2022-08-13 20:44:38 +00:00
Juan Font ee8f38111e Merge pull request #735 from juanfont/fix-expired-url
Fix expired node registration URL
2022-08-13 22:44:04 +02:00
Juan Font Alonso 8c13f64d3c Changed missing path 2022-08-13 21:55:44 +02:00
Juan Font Alonso a7efc22045 Fix expired node registration URL 2022-08-13 21:17:05 +02:00
Juan Font Alonso 1880035f6f Add registration handler over Noise protocol 2022-08-13 21:12:19 +02:00
Juan Font Alonso fdd0c50402 Added helper method to fetch machines by any nodekey + tests 2022-08-13 21:03:02 +02:00
Juan Font Alonso be24bacb79 Add noise mux and Noise path to base router 2022-08-13 20:55:37 +02:00
Juan Font Alonso b261d19cfe Added Noise upgrade handler and Noise mux 2022-08-13 20:52:11 +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 3e8f0e9984 Added support for Noise clients in /key handler 2022-08-13 11:24:05 +02:00
Juan Font Alonso 6e8e2bf508 Generate and read the Noise private key 2022-08-13 11:14:38 +02:00
Juan Font 09cd7ba304 Merge pull request #725 from juanfont/switch-to-db-d
Improve registration protocol implementation and switch to NodeKey as main identifier
2022-08-12 09:56:17 +02:00
Juan Font Alonso 77bf1e81ec Added missing dot in comment 2022-08-12 09:36:17 +02:00
Juan Font Alonso a9b9a2942d Update changelog 2022-08-12 09:31:11 +02:00
Juan Font a261e27113 Update api.go
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2022-08-12 09:03:32 +02:00
Juan Font f01a33491b Update api.go
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2022-08-12 09:03:11 +02:00
Juan Font 739e11e1ee Update api.go
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2022-08-12 09:02:58 +02:00
Juan Font 393aae01df Merge branch 'main' into switch-to-db-d 2022-08-11 15:02:08 +02:00
Juan Font 73cd428ed2 Merge pull request #729 from juanfont/fix-reuse-of-ns
Minor fix to linting issue introduced when fixing excludeCorrectlyTaggedNodes (#707)
2022-08-11 15:01:53 +02:00
Juan Font Alonso 1e7b57e513 Minor fix to linting issue introduced in #707 2022-08-11 14:12:45 +02:00
Juan Font Alonso e1e3feb6a8 Add a sleep to reduce the impact of #727 2022-08-11 13:37:25 +02:00
Juan Font 8e56d8b425 Merge branch 'main' into switch-to-db-d 2022-08-11 13:11:38 +02:00
Juan Font 6c8445988c Merge pull request #707 from restanrm/fix-bug-in-excludecorrectlytaggednodes
Fix bug in excludeCorrectlyTaggedNodes
2022-08-11 13:08:43 +02:00
Adrien Raffin-Caboisse 110b01befa Merge remote-tracking branch 'origin/main' into fix-bug-in-excludecorrectlytaggednodes 2022-08-11 12:49:26 +02:00
Juan Font Alonso d586b9d285 Added comment clarifying registration API 2022-08-11 12:16:50 +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
Juan Font Alonso 030d7264e6 Fixed comment for linting 2022-08-10 16:03:33 +02:00
Juan Font Alonso e91c378bd4 Replace machine key with node key in preparation for Noise in auth related stuff 2022-08-10 15:35:26 +02:00
Juan Font Alonso e950b3be29 Add method to fetch by nodekey 2022-08-10 13:15:31 +02:00
Juan Font dbf0e206b8 Merge pull request #722 from juanfont/bump-versions-20220810
Update dependencies versions
2022-08-10 11:25:03 +02:00
Juan Font Alonso 84f66090fd Updated CHangelog and flake 2022-08-10 11:04:42 +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 a03a99569d Merge pull request #720 from juanfont/replace-ioutil
Replaced legacy ioutil usage
2022-08-10 07:41:50 +02:00
Juan Font Alonso 2d887046de Replaced legacy ioutil usage 2022-08-09 23:21:19 +02:00
Juan Font 3a091896fb Merge pull request #685 from GrigoriyMikhalkin/oidc-refactoring
Decompose OIDCCallback method
2022-08-09 20:52:32 +02:00
Juan Font 8a9fe1da4b Merge branch 'main' into oidc-refactoring 2022-08-09 20:29:02 +02:00
Juan Font abf478c9e6 Merge pull request #703 from nnsee/android-readme
Update the readme and documentation with details on the Android app
2022-08-09 15:39:45 +02:00
Juan Font 913a94d2ab Merge branch 'main' into android-readme 2022-08-09 15:37:20 +02:00
Juan Font 01e5be3b57 Merge pull request #711 from sophware/typofix
typo fixed from advertised to advertise
2022-08-09 15:11:23 +02:00
Juan Font e93529e9f3 Merge branch 'main' into typofix 2022-08-09 15:05:53 +02:00
Juan Font ade4e23e14 Merge pull request #698 from GrigoriyMikhalkin/export-errors
Export API errors
2022-08-09 15:04:51 +02:00
Juan Font fc65ded2d5 Merge branch 'main' into oidc-refactoring 2022-08-09 14:37:58 +02:00
Juan Font aa2b92703f Merge branch 'main' into export-errors 2022-08-09 14:33:10 +02:00
Juan Font 2c9dbe158d Merge pull request #713 from juanfont/update-buf-lint
Update buf setup action for proto-lint
2022-08-09 14:32:52 +02:00
Juan Font Alonso d6fa5c96ae Update setup action for proto lint 2022-08-09 14:21:45 +02:00
Juan Font 0506e68a96 Merge branch 'main' into export-errors 2022-08-09 14:16:24 +02:00
Juan Font b32f986105 Merge pull request #710 from juanfont/cosmetic-changes-integration
Improvements in integration tests
2022-08-09 14:16:10 +02:00
Juan Font Alonso 577eedef11 Restore the number of containers 2022-08-09 13:53:25 +02:00
Juan Font Alonso 27855880b2 Updated versions for taiscale 2022-08-09 13:53:02 +02:00
Juan Font Alonso b01d392f9e Run integrtation tests in different steps in Github Actions 2022-08-09 12:26:58 +02:00
Juan Font Alonso d548f5de3f Splitted integration tests in Makefile 2022-08-09 12:26:29 +02:00
Juan Font Alonso f8986132d4 Use tags to split the integration tests 2022-08-09 12:26:12 +02:00
Juan Font Alonso e7148b8080 Temporarily disable unstable branch 2022-08-09 09:58:45 +02:00
Juan Font Alonso 0a29492fc5 Increase swap size in integration tests 2022-08-08 23:20:29 +02:00
Grigoriy Mikhalkin a1e7e771ce refactor OIDC callback aux functions 2022-08-07 13:57:07 +02:00
Grigoriy Mikhalkin 00d2a447f4 decompose OIDCCallback method 2022-08-07 13:27:29 +02:00
Steve Malloy 2254ac2102 typo fixed from advertised to advertise 2022-08-05 15:44:11 -04:00
Juan Font Alonso 21ae31e77d Reduce number of containers in integration tests (for testing) 2022-08-05 18:57:08 +02:00
Juan Font Alonso a6113066ff Improved logs in integration tests 2022-08-05 17:35:28 +02:00
Adrien Raffin-Caboisse 0bb205d31f Merge remote-tracking branch 'origin/main' into fix-bug-in-excludecorrectlytaggednodes 2022-08-05 11:56:33 +02:00
Juan Font d7e8db7adc Merge branch 'main' into export-errors 2022-08-05 10:14:35 +02:00
Juan Font 0eb3b23f16 Merge pull request #708 from juanfont/revert-680-topic/speedup-build
Revert BuildKit (docker buildx) support
2022-08-05 10:14:19 +02:00
Juan Font 54e381cecb Revert "Topic/speedup build" 2022-08-05 00:31:39 +02:00
Grigoriy Mikhalkin cc1343d31d fixed typo in ErrCannotDecryptResponse name 2022-08-05 00:00:36 +02:00
Adrien Raffin-Caboisse bce59345e4 docs: add entry in changelog 2022-08-04 10:51:06 +02:00
Adrien Raffin-Caboisse 79688e6187 chore(all): apply formater 2022-08-04 10:47:00 +02:00
Adrien Raffin-Caboisse babf9470c2 fix(acl): fix issue with groups in excludeCorretlyTaggedNodes
This commit fix issue #563
2022-08-04 10:42:47 +02:00
Rasmus Moorats 10d566c946 add details on how to use the android app 2022-08-02 09:49:28 +03:00
Grigoriy Mikhalkin 911e6ba6de exported API errors 2022-07-29 17:35:21 +02:00
Juan Font f9c4d577e2 Merge pull request #680 from ohdearaugustin/topic/speedup-build
Topic/speedup build
2022-07-28 23:07:32 +02:00
Juan Font 9826b518bd Merge branch 'main' into topic/speedup-build 2022-07-28 22:58:07 +02:00
Juan Font 32a8f06486 Merge pull request #689 from restanrm/fix-duplicate-tags-returned-by-api
Remove duplicate tags if sent by the client
2022-07-28 22:52:35 +02:00
Juan Font 2ab2b8656b Merge branch 'main' into fix-duplicate-tags-returned-by-api 2022-07-27 00:37:07 +02:00
Juan Font d9ab98e47f Merge branch 'main' into topic/speedup-build 2022-07-26 18:45:41 +02:00
Juan Font 9d584bb0d3 Merge pull request #692 from juanfont/update-runc-dependencies
Update runc dependencies to fix security notification
2022-07-26 17:20:51 +02:00
Juan Font 4f725ba9e1 Merge branch 'main' into update-runc-dependencies 2022-07-26 13:59:35 +02:00
Juan Font b75a113c91 Merge pull request #688 from juanfont/prepare-cl-0.17.0
Prepare changelog structure for 0.17.0
2022-07-26 13:59:24 +02:00
Juan Font Alonso 75af83bb81 Update checksum for nix 2022-07-26 12:11:15 +02:00
Juan Font 0f6f0c3b6b Merge branch 'main' into prepare-cl-0.17.0 2022-07-26 12:05:28 +02:00
Juan Font Alonso b344524a6d Update runc dependencies to fix security notification 2022-07-26 12:02:58 +02:00
Juan Font Alonso 6f4d5a532e fixed linting errors 2022-07-26 11:25:20 +02:00
Juan Font 2d83c70173 Merge pull request #670 from iSchluff/feature/db-health-check
ping db in health check
2022-07-26 00:40:23 +02:00
Adrien Raffin-Caboisse c90e862460 fix(grpc): add more checks for tag validation 2022-07-25 14:01:41 +02:00
Adrien Raffin-Caboisse c46a34e6b8 fix(machine): remove duplicate in forcedTags 2022-07-25 11:04:30 +02:00
Juan Font Alonso 693f59ba2f Prepare changelog structure for 0.17.0 2022-07-25 10:35:21 +02:00
Juan Font abae078855 Merge branch 'main' into feature/db-health-check 2022-07-24 22:10:16 +02:00
Juan Font 0212db3fad Merge pull request #687 from huskyii/node_ls
more intuitive output of node ls
2022-07-24 12:06:41 +02:00
Jiang Zhu 49354f678e update CHANGELOG 2022-07-23 04:47:37 +08:00
Jiang Zhu dc94570c4a more intuitive output of node ls 2022-07-23 01:33:11 +08:00
Kristoffer Dalby 51b1027aec Merge pull request #686 from juanfont/update-contributors 2022-07-22 18:56:49 +02:00
github-actions[bot] 936adb7d2c docs(README): update contributors 2022-07-22 07:36:16 +00:00
Juan Font 581d1f3bfa Merge pull request #668 from GrigoriyMikhalkin/graceful-shutdown
graceful shutdown fix
2022-07-22 09:35:40 +02:00
Juan Font 7c87ef6c86 Merge branch 'main' into graceful-shutdown 2022-07-22 09:06:46 +02:00
Juan Font 1a9a9b718d Merge pull request #684 from juanfont/fix-api-mux
Fix API router
2022-07-22 09:06:06 +02:00
Juan Font Alonso 6c9f3420e2 Updated changelog 2022-07-21 23:59:44 +02:00
Juan Font Alonso a4d0efbe8d Fix API router 2022-07-21 23:57:07 +02:00
Grigoriy Mikhalkin 56858a56db Revert "decompose OIDCCallback method"
This reverts commit 395caaad42.
2022-07-21 23:54:35 +02:00
Grigoriy Mikhalkin 395caaad42 decompose OIDCCallback method 2022-07-21 23:47:20 +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
Kristoffer Dalby c6eb7be7fb Merge pull request #683 from juanfont/update-contributors 2022-07-20 10:57:38 +02:00
github-actions[bot] 02c7a46b97 docs(README): update contributors 2022-07-20 07:21:19 +00:00
Kristoffer Dalby ea7b3baa8b Merge pull request #677 from huskyii/remove_gin 2022-07-20 09:20:24 +02:00
Jiang Zhu 5724f4607c fix nix build 2022-07-19 20:45:32 +08:00
Jiang Zhu b755d47652 update CHANGELOG 2022-07-19 20:45:23 +08:00
ohdearaugustin 96221cc4f7 docs: add bulding container docs 2022-07-17 21:18:04 +02:00
ohdearaugustin 34d261179e Speedup docker container build 2022-07-17 21:18:04 +02:00
ohdearaugustin 091b05f155 Change build os 2022-07-17 21:18:04 +02:00
Jiang Zhu aca5646032 remove gin completely, ~2MB reduction on final binary 2022-07-16 02:03:46 +08:00
Kristoffer Dalby 7e9abbeaec Merge pull request #676 from juanfont/update-contributors 2022-07-15 09:15:18 +01:00
Anton Schubert c6aaa37f2d ping db in health check 2022-07-12 22:56:53 +02:00
github-actions[bot] b8c3387892 docs(README): update contributors 2022-07-12 11:35:28 +00:00
Juan Font c50d3aa9bd Merge pull request #675 from juanfont/configurable-update-interval
Make tailnet updates check interval configurable
2022-07-12 13:34:49 +02:00
Juan Font Alonso 4ccff8bf28 Added the new parameter to the integration test params 2022-07-12 13:13:04 +02:00
Juan Font Alonso 5b5298b025 Renamed config param for node update check internal 2022-07-12 12:52:03 +02:00
Juan Font Alonso 8e0939f403 Updated changelog 2022-07-12 12:33:42 +02:00
Juan Font Alonso cf3fc85196 Make tailnet updates check configurable 2022-07-12 12:27:28 +02:00
Juan Font e0b15c18ce Merge pull request #667 from kradalby/rerun-docker
Make integration tests retry on failure.
2022-06-27 17:04:39 +02:00
Kristoffer Dalby 566b8c3df3 Fix issue were dockertest fails to start because of container mismatch 2022-06-27 12:07:30 +00:00
Kristoffer Dalby 32a6151df9 Rerun integration tests 5 times if error 2022-06-27 12:02:29 +00:00
Kristoffer Dalby 3777de7133 Use failnow for cli tests aswell 2022-06-27 12:00:21 +00:00
Kristoffer Dalby 8cae4f80d7 Fail tests instead of fatal
Currently we exit the program if the setup does not work, this can cause
is to leave containers and other resources behind since we dont run
TearDown. This change will just fail the test if we cant set up, which
should mean that the TearDown runs aswell.
2022-06-27 11:58:16 +00:00
Kristoffer Dalby 911c5bddce Make saving logs from tests an option (default false)
We currently have a bit of flaky logic which prevents the docker plugin
from cleaning up the containers if the tests or setup fatals or crashes,
this is due to a limitation in the save / passed stats handling.

This change makes it an environment variable which by default ditches
the logs and makes the containers clean up "correctly" in the teardown
method.
2022-06-27 11:56:37 +00:00
Juan Font 4a200c308b Merge pull request #656 from juanfont/abandon-gin
Drop Gin as web framework for TS2019 API
2022-06-26 15:54:41 +02:00
Juan Font Alonso 625e45b1cb Merge branch 'abandon-gin' of https://github.com/juanfont/headscale into abandon-gin 2022-06-26 14:25:05 +02:00
Juan Font Alonso 8551b0dde0 Fixed issue when in linting rampage 2022-06-26 14:24:57 +02:00
Juan Font 050782aff3 Merge branch 'main' into abandon-gin 2022-06-26 12:36:49 +02:00
Juan Font Alonso 00885dffe1 Fix implicit memory aliasing in for loop (lint 8/n) 2022-06-26 12:35:18 +02:00
Juan Font Alonso ffcc72876c Lint fixes 7/n 2022-06-26 12:30:52 +02:00
Juan Font Alonso fa91ece5b4 Lint fixes 6/n 2022-06-26 12:25:26 +02:00
Juan Font Alonso c810b24eb9 Lint fixes 5/n 2022-06-26 12:21:35 +02:00
Juan Font Alonso 03ced0ecfe Lint fixes 4/n 2022-06-26 12:06:25 +02:00
Juan Font Alonso c859bea0cf Lint fixes 3/n 2022-06-26 12:01:04 +02:00
Juan Font Alonso a913d1b521 Lint fixes 2/n 2022-06-26 11:55:37 +02:00
Kristoffer Dalby 2464c92572 Merge pull request #665 from juanfont/update-contributors 2022-06-26 11:48:11 +02:00
Juan Font Alonso 10cd87e5a2 Lint fixes 1/n 2022-06-26 11:43:17 +02:00
Juan Font Alonso 58c336e7f4 updated nix flake go.sum 2022-06-26 11:31:31 +02:00
Juan Font bb4a9583a7 Merge branch 'main' into abandon-gin 2022-06-26 11:08:48 +02:00
github-actions[bot] 7ae38346e5 docs(README): update contributors 2022-06-26 08:22:05 +00:00
Kristoffer Dalby 7604c0f691 Merge pull request #658 from juanfont/fix-segfault-when-not-runner 2022-06-26 10:21:27 +02:00
Kristoffer Dalby f2f4c3f684 Merge branch 'main' into fix-segfault-when-not-runner 2022-06-26 09:52:15 +02:00
Kristoffer Dalby 34f489b1f4 Update cmd/headscale/cli/utils.go 2022-06-26 09:52:11 +02:00
Kristoffer Dalby 72d1d2630e Update cmd/headscale/cli/utils.go 2022-06-26 09:52:04 +02:00
Kristoffer Dalby d559e23bc6 Merge pull request #651 from iSchluff/fix/db-shutdown 2022-06-26 09:51:45 +02:00
Kristoffer Dalby 4637400d29 Update CHANGELOG.md 2022-06-26 09:30:16 +02:00
Kristoffer Dalby 0fa943e4b7 Update CHANGELOG.md 2022-06-26 09:29:33 +02:00
Kristoffer Dalby 9707b1f540 Merge branch 'main' into fix/db-shutdown 2022-06-26 08:28:50 +01:00
Juan Font Alonso 657fb208d6 Flush buffered data on polling 2022-06-25 20:47:42 +02:00
Juan Font 647972c7cf Merge branch 'main' into fix-segfault-when-not-runner 2022-06-23 22:17:33 +02:00
Juan Font Alonso 39b58f7d4c Use a signal to close the longpolls on shutdown 2022-06-23 19:40:07 +02:00
Juan Font Alonso c8378e8b7d Quick fix to segfault on CLI when Headscale is not running (fix #652) 2022-06-22 14:40:40 +02:00
Juan Font Alonso d404ba102d Use request context to close when client disconnects 2022-06-20 21:47:02 +02:00
Juan Font Alonso 5e9004c407 Fix issues in the poll loop 2022-06-20 21:40:28 +02:00
Juan Font Alonso 8e63b53b0c Merge branch 'abandon-gin' of https://github.com/juanfont/headscale into abandon-gin 2022-06-20 21:38:03 +02:00
Juan Font Alonso 116bef25a7 Fixed wrong copy paste in Header 2022-06-20 21:19:49 +02:00
Juan Font 294975ba87 Merge branch 'main' into abandon-gin 2022-06-20 21:16:11 +02:00
Juan Font Alonso 51b8c659f1 Updated changelog 2022-06-20 21:13:12 +02:00
Juan Font Alonso 082fbead66 Added mux dependency 2022-06-20 21:12:23 +02:00
Juan Font Alonso 73c16ffc65 Fixed issue with the method used to send data 2022-06-20 20:30:08 +02:00
Juan Font Alonso dec51348e6 Minor status change 2022-06-20 20:29:42 +02:00
Juan Font Alonso b0b919efb0 Added more logging to derp server 2022-06-20 12:32:13 +02:00
Juan Font Alonso 396c3ecdf7 Remove Gin from the OIDC handlers 2022-06-20 12:31:19 +02:00
Juan Font Alonso 53e5c05b0a Remove gin from the poll handlers 2022-06-20 12:30:51 +02:00
Juan Font Alonso dedeb4c181 Remove Gin from the Registration handler 2022-06-20 12:30:41 +02:00
Juan Font Alonso e611063669 Migrate platform config out of Gin 2022-06-20 12:29:59 +02:00
Juan Font Alonso 6c9c9a401f Remove gin from DERP server 2022-06-18 19:51:37 +02:00
Juan Font 6da4396faa Merge pull request #654 from ChibangLW/main
Add version info to binary in Docker container
2022-06-18 18:48:35 +02:00
Juan Font Alonso d89fb68a7a Switch to use gorilla's mux as muxer 2022-06-18 18:41:42 +02:00
Leon Lenzen 8d9462147c chore: use docker-meta version 2022-06-18 12:00:02 +02:00
Leon Lenzen 89b7fa6b06 chore: fix lint 2022-06-18 11:39:27 +02:00
Leon Lenzen d4a550bb4c chore: add version to binary in containers 2022-06-18 11:36:09 +02:00
Juan Font Alonso d5e331a2fb Remove Gin from OIDC callback 2022-06-17 17:42:17 +02:00
Juan Font Alonso 367da0fcc2 Remove Gin from simple endpoints for TS2019 2022-06-17 16:48:04 +02:00
Anton Schubert 8111b0aa83 update changelog 2022-06-17 11:07:35 +02:00
Anton Schubert 735440d1a3 add timeout for http shutdown, add db disconnect 2022-06-17 11:07:25 +02:00
Juan Font 3ae340527f Merge pull request #648 from juanfont/show-nodes-online
Send Online field of tailcfg.Node based on LastSeen
2022-06-16 19:26:13 +02:00
Juan Font bfa9ed814d Merge branch 'main' into show-nodes-online 2022-06-16 18:53:25 +02:00
Juan Font Alonso 1e4678c02f Updated changelog 2022-06-16 18:48:32 +02:00
Juan Font Alonso 66fffd69ce Send Online field of tailcfg.Node based on LastSeen 2022-06-16 18:43:50 +02:00
Kristoffer Dalby e3f99d670e Merge pull request #646 from juanfont/update-contributors 2022-06-16 16:08:31 +01:00
github-actions[bot] 360488abb4 docs(README): update contributors 2022-06-16 13:08:07 +00:00
Kristoffer Dalby 8dda44105e Merge pull request #643 from iSchluff/fix/dns-name-panic 2022-06-16 14:07:21 +01:00
Kristoffer Dalby 2215e17223 Merge branch 'main' into fix/dns-name-panic 2022-06-16 11:04:31 +01:00
Kristoffer Dalby 157db307f9 Merge pull request #642 from kradalby/ignore-integtest-dump 2022-06-16 08:35:47 +01:00
Juan Font 0bd39b2c5e Merge branch 'main' into ignore-integtest-dump 2022-06-16 00:25:45 +02:00
Anton Schubert 8f31ed51e1 fix occasional panic on registration
GenerateRandomStringDNSSafe will panic occasionally if the random base64
string contains too many - and _ due to the replacement. Fix by looping.
2022-06-15 12:22:57 +02:00
Kristoffer Dalby d2d1f92836 Merge pull request #641 from juanfont/update-contributors 2022-06-12 22:57:32 +01:00
Kristoffer Dalby c02819ab9f Ignore new dump file 2022-06-12 17:26:44 +00:00
github-actions[bot] 28a3a5bd61 docs(README): update contributors 2022-06-12 17:00:23 +00:00
Kristoffer Dalby 891815634b Merge pull request #639 from kradalby/ephemeral-error-msg 2022-06-12 17:59:48 +01:00
Kristoffer Dalby 8650328922 Remove debug output, it runs before we disable it 2022-06-12 16:40:43 +00:00
Kristoffer Dalby 7bd07e3b9b Merge branch 'main' into ephemeral-error-msg 2022-06-12 14:33:49 +01:00
Kristoffer Dalby 76195bb3ac Add warn if configuration could not be found 2022-06-12 13:32:16 +00:00
Juan Font 6afd492095 Merge pull request #638 from kradalby/update-nodes-derp
Simplify DERP maps update function
2022-06-12 15:26:20 +02:00
Kristoffer Dalby c95bce4aea Update changelog 2022-06-12 13:18:49 +00:00
Kristoffer Dalby fd3a1c13e3 Add a default to ephemeral_node_inactivity_timeout 2022-06-12 13:12:53 +00:00
Kristoffer Dalby 95824ac2ec MOve ephemeral inactivity config check to all the other config check 2022-06-12 13:12:43 +00:00
Kristoffer Dalby a050158d11 Use new update state logic for derp maps 2022-06-12 12:27:37 +00:00
Kristoffer Dalby e0ef601123 Merge pull request #636 from huskyii/fix_issue635 2022-06-12 12:53:19 +01:00
Jiang Zhu 9c5d485fdd fix issue 635 2022-06-12 17:01:17 +08:00
Juan Font cb88b16207 Merge pull request #630 from kradalby/test-126
Add 1.26 to tests
2022-06-11 18:14:38 +02:00
Kristoffer Dalby 257c025975 Update build system 2022-06-11 15:42:06 +00:00
Kristoffer Dalby 50bdf9d3b9 Update vendor sha 2022-06-11 15:39:37 +00:00
Kristoffer Dalby 8d58894daa Tailscale 1.26 uses dnstype pointer 2022-06-11 15:34:02 +00:00
Kristoffer Dalby 43fa7f9fd5 Upgrade tailscale lib to 1.26 2022-06-11 15:34:02 +00:00
Kristoffer Dalby f2a8bfeb9f Merge branch 'main' into test-126 2022-06-11 16:04:35 +01:00
Kristoffer Dalby 06bbeea37f Merge pull request #632 from juanfont/update-contributors 2022-06-11 16:04:21 +01:00
github-actions[bot] e5f26f819a docs(README): update contributors 2022-06-11 14:35:56 +00:00
Kristoffer Dalby a058f17946 Merge branch 'main' into test-126 2022-06-11 15:35:36 +01:00
Kristoffer Dalby a4b4fc8b6c Merge pull request #624 from iSchluff/feature/configure-randomize-port 2022-06-11 15:35:24 +01:00
Kristoffer Dalby ab35baaa29 Merge branch 'main' into feature/configure-randomize-port 2022-06-11 15:07:47 +01:00
Kristoffer Dalby 883bb92991 Merge pull request #618 from juanfont/acl-syntax-fixes 2022-06-11 15:07:29 +01:00
Kristoffer Dalby bfb58de7b8 Add 1.26 to tests 2022-06-11 13:45:32 +00:00
Kristoffer Dalby 6faf2d63d0 Update integration dump tests 2022-06-11 13:31:30 +00:00
Kristoffer Dalby 569f3caab9 Use constants in tests 2022-06-11 13:17:07 +00:00
Kristoffer Dalby 7cd0f5e8a4 Merge branch 'main' into acl-syntax-fixes 2022-06-11 14:14:21 +01:00
Kristoffer Dalby 02cc6bcc05 Merge branch 'main' into feature/configure-randomize-port 2022-06-11 13:49:32 +01:00
Kristoffer Dalby 9ff09b73ad Update Changelog 2022-06-11 13:49:17 +01:00
Kristoffer Dalby f93cf4b980 Merge pull request #628 from kradalby/acl-update-nodes 2022-06-11 13:32:57 +01:00
Juan Font Alonso 3d7be5b287 Minor rename 2022-06-11 14:12:53 +02:00
Juan Font Alonso cdf41bd500 Merge branch 'acl-syntax-fixes' of https://github.com/juanfont/headscale into acl-syntax-fixes 2022-06-11 14:12:39 +02:00
Juan Font Alonso 735a6aaa39 Use const for IANA protcol numbers 2022-06-11 14:09:08 +02:00
Kristoffer Dalby 0c2648c188 Update the nodes after we have reloaded the ACL policy with sighup 2022-06-11 12:54:44 +01:00
Kristoffer Dalby 7e6291c21c Change Set state change function to filter instead of single namespace
This commit makes the setLastStateChangeToNow function take a list of
namespaces instead of a single namespace. If no namespaces is passed,
all namespaces will be updated. This means that the argument acts like a
filter.
2022-06-11 12:53:02 +01:00
Kristoffer Dalby 3f7749c6d4 Merge branch 'main' into feature/configure-randomize-port 2022-06-11 10:55:05 +01:00
Kristoffer Dalby 586c5411f1 Merge pull request #611 from huskyii/doc_openbsd 2022-06-11 10:54:28 +01:00
Jiang Zhu 2be16b581c 1) fix typo 2) another hard coded version 2022-06-11 17:23:01 +08:00
Jiang Zhu 06e22bf878 Merge branch 'juanfont:main' into doc_openbsd 2022-06-11 16:54:01 +08:00
Jiang Zhu 0b4b530809 remove the hardcoded version(suggested by @kradalby) 2022-06-11 16:41:52 +08:00
Kristoffer Dalby efca3daa5c Merge pull request #612 from huskyii/enhance_cli_config 2022-06-10 20:38:11 +01:00
Kristoffer Dalby fdefe46c40 Merge branch 'main' into enhance_cli_config 2022-06-10 20:18:33 +01:00
Anton Schubert 34be10840c add ability to set randomizeClientPort 2022-06-09 21:26:40 +02:00
Juan Font 80ad1db228 Merge branch 'main' into acl-syntax-fixes 2022-06-09 14:09:26 +02:00
Juan Font e918ea89a3 Merge pull request #619 from majst01/simplify-split
Use strings.Cut to simplify logic
2022-06-09 14:08:49 +02:00
Juan Font Alonso 19b968849f Added missing file 2022-06-08 18:21:35 +02:00
Juan Font Alonso 5bc11891f5 Update internal docs with protocol usage 2022-06-08 18:15:38 +02:00
Juan Font Alonso 818d26b5f9 Updated changelog 2022-06-08 18:12:56 +02:00
Juan Font Alonso c47354bdc3 Update internal docs to the new syntax 2022-06-08 18:12:47 +02:00
Stefan Majer 86ce0e0c66 Use strings.Cut to simplify logic 2022-06-08 18:09:11 +02:00
Juan Font Alonso 39f03b86c8 Added ACL test file 2022-06-08 18:06:25 +02:00
Juan Font Alonso 8287ba24b9 Do not lint the protocol magic numbers
I happily use https://pkg.go.dev/golang.org/x/net/internal/iana, but it is internal
2022-06-08 17:55:32 +02:00
Juan Font Alonso ab1aac9f3e Improve ACLs by adding protocol parsing support 2022-06-08 17:43:59 +02:00
Juan Font Alonso 3e353004b8 Migrate ACLs syntax to new Tailscale format
Implements #617.

Tailscale has changed the format of their ACLs to use a more firewall-y terms ("users" & "ports" -> "src" & "dst"). They have also started using all-lowercase tags. This PR applies these changes.
2022-06-08 13:40:15 +02:00
Jiang Zhu bcb04d38a5 Merge branch 'main' into enhance_cli_config
Extract LoadConfig from GetHeadscaleConfig, as they are conceptually
different operation, e.g.,
1) you can reload config through LoadConfig and do not get config
2) you can get config without reload config
2022-06-07 22:51:47 +08:00
Jiang Zhu de0e2bf828 Merge branch 'main' into doc_openbsd 2022-06-07 22:31:32 +08:00
Kristoffer Dalby 8fed47a2be Merge pull request #616 from juanfont/update-contributors 2022-06-07 15:58:53 +02:00
github-actions[bot] 17d4968425 docs(README): update contributors 2022-06-07 06:16:00 +00:00
Kristoffer Dalby 54acee6880 Merge pull request #615 from demiflat/fix_typo 2022-06-07 08:15:17 +02:00
Darrell Kundel a4e05d4db3 fix typo for GGO->CGO 2022-06-07 11:36:13 +08:00
Kristoffer Dalby b0acbed329 Merge pull request #608 from kradalby/config-rework 2022-06-05 20:18:20 +02:00
Kristoffer Dalby 1b2967320b Merge branch 'main' into config-rework 2022-06-05 17:57:15 +02:00
Kristoffer Dalby 90f6be0c98 Rename one char var 2022-06-05 17:52:28 +02:00
Kristoffer Dalby 78ed610b50 Switch config to pointer 2022-06-05 17:47:26 +02:00
Kristoffer Dalby af891808f6 Make get config load the config, use config in main method 2022-06-05 17:47:12 +02:00
Jiang Zhu 0c5a402206 add changelog 2022-06-05 23:15:21 +08:00
Jiang Zhu 8744eeeb19 ExecuteCommand set HEADSCALE_LOG_LEVEL to disabled 2022-06-05 23:14:49 +08:00
Jiang Zhu ce13596077 add integration test for headscale -c 2022-06-05 23:13:58 +08:00
Jiang Zhu 402a29e50c impl heascale -c to specify config file 2022-06-05 18:25:09 +08:00
Jiang Zhu 0363e58467 cli.LoadConfig accepts config file now 2022-06-05 17:55:27 +08:00
Jiang Zhu c8a14ccabb fix prettier 2022-06-05 16:01:53 +08:00
Jiang Zhu 1de29fd4e6 fix rcd link 2022-06-05 15:49:24 +08:00
Jiang Zhu 75a0155f73 add openbsd doc 2022-06-05 15:45:38 +08:00
Kristoffer Dalby adb55bcfe9 Merge pull request #610 from huskyii/fix_pie_build 2022-06-04 12:37:02 +02:00
Jiang Zhu 2201ec8905 some GOOS do not support pie build, detect in makefile and fall back to non-pie build 2022-06-04 18:11:10 +08:00
Kristoffer Dalby 39f6fdef1a Merge pull request #609 from kradalby/add-arm64-darwin-drop-32 2022-06-04 11:42:51 +02:00
Kristoffer Dalby 699aa5cf38 Merge branch 'main' into add-arm64-darwin-drop-32 2022-06-03 19:36:01 +02:00
Kristoffer Dalby 1486adb25a Update changelog 2022-06-03 17:35:47 +00:00
Kristoffer Dalby 2653c2f5e8 Drop arm32 (armhf) for linux and add Darwin arm64 2022-06-03 17:34:06 +00:00
Kristoffer Dalby 7b7244dac2 Merge pull request #607 from juanfont/update-contributors 2022-06-03 11:01:07 +02:00
github-actions[bot] 571ce2b0b9 docs(README): update contributors 2022-06-03 08:49:19 +00:00
Kristoffer Dalby c3db5ed749 Merge remote-tracking branch 'upstream/main' into config-rework 2022-06-03 10:49:08 +02:00
Kristoffer Dalby 0797148076 Merge pull request #601 from kradalby/signals-reload-acl 2022-06-03 10:48:43 +02:00
Kristoffer Dalby 24c9530eee Add loglevel and disable update to config struct 2022-06-03 10:37:45 +02:00
Kristoffer Dalby 679cf7c0d7 Merge branch 'main' into signals-reload-acl 2022-06-03 10:23:53 +02:00
Kristoffer Dalby 19b6405332 Merge pull request #597 from kradalby/db-error-handling 2022-06-03 10:23:21 +02:00
Kristoffer Dalby aee8aa1c61 Move TLS config into its own struct 2022-06-03 10:14:14 +02:00
Kristoffer Dalby 5514a862dc Update headscale read config tests 2022-06-03 09:26:46 +02:00
Kristoffer Dalby 1ea8bb782c Move all read config logic to config.go 2022-06-03 09:26:36 +02:00
Kristoffer Dalby 35722cd5aa Move FilePerm function from cli to headscale 2022-06-03 09:24:36 +02:00
Kristoffer Dalby 533ecee252 Move config struct to its own file 2022-06-03 09:05:41 +02:00
Kristoffer Dalby f1db2d0c8e Merge branch 'main' into signals-reload-acl 2022-06-02 11:12:15 +02:00
Kristoffer Dalby 6f6fb4dcd6 Merge branch 'main' into db-error-handling 2022-06-02 11:11:58 +02:00
Kristoffer Dalby b1ba7ba685 Merge pull request #602 from iSchluff/fix/forced-tags-with-tagOwner 2022-06-02 11:11:43 +02:00
Anton Schubert 6dccfee862 Fix forced Tags with legitimate tagOwners
Also replace loops contains
2022-06-01 15:43:32 +02:00
Kristoffer Dalby 6f32b80b2b Update changelog 2022-05-31 14:30:11 +02:00
Kristoffer Dalby 2feed18b28 Support reloading ACLs with SIGHUP
Also continously listen for signals, not just once.
2022-05-31 14:28:23 +02:00
Kristoffer Dalby 36dca3516a Move Abspath function to headscale utils 2022-05-31 14:28:23 +02:00
Kristoffer Dalby 06129277ed Rename abspath function to describe what it does 2022-05-31 14:28:23 +02:00
Kristoffer Dalby 6b1482daee Use config object instead of viper for policy path 2022-05-31 14:28:23 +02:00
Kristoffer Dalby 24e4787a64 Make ACL policy part of the config struct 2022-05-31 14:28:23 +02:00
Kristoffer Dalby 5bfae22c8f Make config get function global 2022-05-31 14:28:23 +02:00
Kristoffer Dalby 3e078f0494 Fix logtail config function name 2022-05-31 14:28:01 +02:00
Kristoffer Dalby 0b4f59b82b Improve signal handling
This commit starts to wire up better signal handling, it starts with
handling shutdown a bit better, using the graceful shutdown for all the
listeners we use.

It also adds the initial switch case for handling config and acl reload,
which is to be implemented.
2022-05-31 14:28:00 +02:00
Kristoffer Dalby a19af04582 Fix errors introduced by merge 2022-05-31 11:03:08 +02:00
Kristoffer Dalby 0676aa11a9 Merge branch 'main' into db-error-handling 2022-05-31 10:18:13 +02:00
Kristoffer Dalby be25bbce92 Merge pull request #560 from kradalby/rename-fixess 2022-05-31 10:14:48 +02:00
Kristoffer Dalby 5ecfbbaf5d Fix pointer in machine save call 2022-05-31 10:05:00 +02:00
Kristoffer Dalby 7f7cd737dc Merge branch 'main' into rename-fixess 2022-05-31 09:45:49 +02:00
Kristoffer Dalby b472e5a689 Merge pull request #599 from kradalby/parse-duration-improv 2022-05-31 09:45:36 +02:00
Kristoffer Dalby 25c674ed32 Merge branch 'main' into parse-duration-improv 2022-05-31 09:43:18 +02:00
Kristoffer Dalby 3d93cf9e2d Update changelog 2022-05-31 09:42:50 +02:00
Kristoffer Dalby f7edea5f40 Merge branch 'main' into rename-fixess 2022-05-31 09:42:20 +02:00
Kristoffer Dalby d26e220fb9 Merge pull request #598 from kradalby/parse-duration-improv 2022-05-31 09:42:00 +02:00
Kristoffer Dalby d860270733 Use Prometheus duration parser (support days and weeks) 2022-05-30 16:10:39 +02:00
Kristoffer Dalby a09633e859 Check errors of more database calls 2022-05-30 15:39:24 +02:00
Kristoffer Dalby a1837a4d69 Merge branch 'main' into db-error-handling 2022-05-30 15:31:56 +02:00
Kristoffer Dalby 52cc3bc8eb Check all errors for db.Save 2022-05-30 15:31:06 +02:00
Kristoffer Dalby 9175aca094 Merge branch 'main' into rename-fixess 2022-05-30 15:29:50 +02:00
Kristoffer Dalby 848727a21d Merge pull request #596 from kradalby/disable-logcatcher 2022-05-30 15:29:35 +02:00
Kristoffer Dalby df7d5fa2b9 Fix lint 2022-05-30 14:58:40 +02:00
Kristoffer Dalby 86dfc91dd5 update readme 2022-05-30 14:57:49 +02:00
Kristoffer Dalby 7f66d9184b Add config test 2022-05-30 14:57:43 +02:00
Kristoffer Dalby ff5f31b87e Disable logtail for clients 2022-05-30 14:52:50 +02:00
Kristoffer Dalby a0c465c2eb Wire up setting to enable/disable logtail 2022-05-30 14:47:41 +02:00
Kristoffer Dalby d11279e615 Merge branch 'main' into rename-fixess 2022-05-30 13:38:28 +02:00
Kristoffer Dalby 266aac9e61 Update CHANGELOG 2022-05-30 13:35:40 +02:00
Kristoffer Dalby 4ffd3eacb0 Override golangci-lint to use go 1.17 2022-05-30 13:35:40 +02: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 a992840c9b Give UpdateMachine a more meaningful name 2022-05-30 13:35:40 +02:00
Kristoffer Dalby dbc1d981c9 Revert golines 2022-05-30 13:35:28 +02:00
github-actions[bot] 9993f51b5e docs(README): update contributors 2022-05-30 13:35:28 +02:00
Kristoffer Dalby 3a3fc0a4be Update headscale checksum 2022-05-30 12:03:16 +02:00
Kristoffer Dalby 5316dd9c27 Use new nix stable (22.05) 2022-05-30 11:59:22 +02:00
Kristoffer Dalby 59a1a85a2b Change to a go generics set implementation, no more casting 🎉 2022-05-30 11:49:35 +02:00
Kristoffer Dalby fc502e1e79 Update golines and fix go mod checksum 2022-05-30 11:13:31 +02:00
Kristoffer Dalby 405de9e0f8 Merge pull request #595 from juanfont/update-contributors 2022-05-29 18:13:40 +01:00
Kristoffer Dalby 6eac5046c6 Merge branch 'main' into rename-fixess 2022-05-29 17:21:51 +01:00
github-actions[bot] f7f722af52 docs(README): update contributors 2022-05-29 14:49:25 +00:00
Kristoffer Dalby 583f6eeedd Merge pull request #594 from juanfont/update-contributors 2022-05-29 15:48:41 +01:00
github-actions[bot] bec35b4965 docs(README): update contributors 2022-05-29 11:03:33 +00:00
Kristoffer Dalby e596d8287c Merge pull request #593 from juanfont/update-contributors 2022-05-29 12:02:49 +01:00
github-actions[bot] 6c903d2d93 docs(README): update contributors 2022-05-29 10:23:00 +00:00
Kristoffer Dalby 914431b94a Merge pull request #591 from pvinis/patch-2 2022-05-29 11:22:26 +01:00
Kristoffer Dalby 11da7436c7 Merge branch 'main' into patch-2 2022-05-29 11:19:29 +01:00
Kristoffer Dalby 0f532aa5c1 Merge pull request #590 from pvinis/patch-1 2022-05-29 11:19:14 +01:00
Pavlos Vinieratos 835828fe92 link fix 2022-05-28 20:48:59 +03:00
Pavlos Vinieratos fff1011ed8 typo 2022-05-28 20:46:01 +03:00
Kristoffer Dalby ef497caa1b Merge pull request #2 from juanfont/fix-rename-integration-tests 2022-05-28 17:14:41 +01:00
Juan Font Alonso 4f3f0542d4 Fix some issues in testing with new hostname handling 2022-05-28 12:54:57 +02:00
Kristoffer Dalby 5fa987519d move populate to after when given_name exist 2022-05-23 17:33:07 +01:00
Kristoffer Dalby 77ceeaf5fd Test magic dns with the correct urls 2022-05-18 21:18:04 +02:00
Kristoffer Dalby 4a9d3bedf9 Use new names to resolve magic dns 2022-05-18 20:14:18 +02:00
Kristoffer Dalby 802eb931d1 Make sure givenname is set for preauthkeys 2022-05-17 22:02:18 +02:00
Kristoffer Dalby 9ebeb3d7e4 Retreive hostnames from headscale, now that they are random 2022-05-17 22:11:51 +02:00
Kristoffer Dalby e631c6f7e0 Merge master 2022-05-16 21:41:46 +02:00
Kristoffer Dalby 163e5c29e4 fix trace log message 2022-05-16 20:35:35 +02:00
Kristoffer Dalby 4aae917f74 Require GivenName to be unique 2022-05-16 20:33:47 +02:00
Kristoffer Dalby 9b393eb861 Add integration cli tests for rename command 2022-05-16 20:32:56 +02:00
Kristoffer Dalby 5fa3016703 Generate unique givennames for hosts joining (and debug added) 2022-05-16 20:32:38 +02:00
Kristoffer Dalby 03cccd60a6 Reword FQDN normalize errors to not _only_ cover namespaces 2022-05-16 20:31:32 +02:00
Kristoffer Dalby 177c21b294 Add helper function to create a unique givenname 2022-05-16 20:30:43 +02:00
Kristoffer Dalby f4873d9387 Fix rename cli error 2022-05-16 20:29:31 +02:00
Kristoffer Dalby 747d64cdae Merge pull request #558 from restanrm/feat-list-tags-of-machines 2022-05-16 19:03:48 +01:00
Kristoffer Dalby c9efd5c132 Merge branch 'main' into feat-list-tags-of-machines 2022-05-16 16:35:52 +01:00
Kristoffer Dalby 546ddd2a84 Merge pull request #510 from reynico/acls-doc 2022-05-16 16:32:51 +01:00
Kristoffer Dalby 2edb5428f9 Merge branch 'main' into acls-doc 2022-05-16 16:32:18 +01:00
Adrien Raffin-Caboisse 9f082125fa fix: remove version pinning for golangci-lint it does not work 2022-05-16 16:48:04 +02:00
Adrien Raffin-Caboisse 11582105ab fix: flake.nex update sha256 2022-05-16 15:26:00 +02:00
Adrien Raffin-Caboisse c4e69fe2c3 fix: ignore exhaust linter 2022-05-16 15:13:16 +02:00
Adrien Raffin-Caboisse 4435a4f19d chore: apply lint recommendations 2022-05-16 14:59:46 +02:00
Adrien Raffin-Caboisse 02ae7a0563 fix: pin version of golangci-lint to match dev config 2022-05-16 14:40:45 +02:00
Adrien Raffin-Caboisse 852dc0f4de feat: add golangci-lint in nix develop 2022-05-16 14:40:05 +02:00
Adrien Raffin-Caboisse 844ad15109 fix: revert previous commit and add exclusion of linter 2022-05-16 14:29:05 +02:00
Adrien Raffin-Caboisse 522e892099 fix: remove unknown linters:
When running in CI, I obtained the following error:

```
  Running [/home/runner/golangci-lint-1.41.0-linux-amd64/golangci-lint run --out-format=github-actions --new-from-patch=/tmp/tmp-1795-28vaWZek2jfM/pull.patch --new=false --new-from-rev=] in [] ...
  level=error msg="Running error: unknown linters: 'ireturn,maintidx', run 'golangci-lint linters' to see the list of supported linters"
```
2022-05-16 14:17:31 +02:00
Adrien Raffin-Caboisse 0445f404ec fix: pin version of golangci-lint in GA 2022-05-16 14:12:49 +02:00
Adrien Raffin-Caboisse bc1909fa22 Merge branch 'feat-list-tags-of-machines' of github.com:restanrm/headscale into feat-list-tags-of-machines 2022-05-16 11:17:36 +02:00
Adrien Raffin-Caboisse ca71830963 docs: add small documentation on getTags func 2022-05-16 11:16:07 +02:00
Kristoffer Dalby a28eebfca3 Merge branch 'main' into feat-list-tags-of-machines 2022-05-15 12:11:28 +01:00
Kristoffer Dalby 0d31ea08c3 Merge pull request #578 from samson4649/main 2022-05-15 11:58:40 +01:00
Samuel Lock 614c003704 updated changelog 2022-05-14 22:36:04 +10:00
Adrien Raffin-Caboisse b511295349 fix: integration tests result
Execute command doesn't fail, the result is passed in json content.
2022-05-13 13:02:40 +02:00
Adrien Raffin-Caboisse fcdc292647 fix: update tag in db if acl is enabled 2022-05-13 13:00:32 +02:00
Adrien Raffin-Caboisse 09836cd150 chore: update vendorSha after update of go.mod and go.sum 2022-05-13 12:19:32 +02:00
Adrien Raffin-Caboisse 49ec9943b9 fix: loop over result machines instead of startup machines 2022-05-13 12:14:11 +02:00
Adrien Raffin-Caboisse 72c1edaaa4 Merge remote-tracking branch 'origin/main' into feat-list-tags-of-machines 2022-05-13 11:56:06 +02:00
Adrien Raffin-Caboisse 294ed7a751 docs: update changelog 2022-05-13 11:51:31 +02:00
Adrien Raffin-Caboisse 31c0062d5e feat: add integration tests for tag support 2022-05-13 11:47:22 +02:00
Adrien Raffin-Caboisse 63d920510d feat: improve nodes list with inputs from @deonthomasgy
cf: https://github.com/juanfont/headscale/compare/main...deonthomasgy:dev/thomas/show-tags
2022-05-13 11:46:28 +02:00
Adrien Raffin-Caboisse 16f9691e80 fix: ignore emptyPolicy errors for db insertion 2022-05-13 11:20:40 +02:00
Adrien Raffin-Caboisse 209d003832 feat: handle insert into database error 2022-05-13 11:09:28 +02:00
Adrien Raffin-Caboisse 62cfd60e38 feat: add validation of tags 2022-05-13 10:18:01 +02:00
Adrien Raffin-Caboisse fdbc9657bc feat: return error if validation is failed 2022-05-13 10:14:38 +02:00
Adrien Raffin-Caboisse ad4401aa40 fix: remove debug code 2022-05-13 10:14:36 +02:00
Samuel Lock c26280c331 modified code to satisfy golangci-lint and added integration test 2022-05-11 09:31:24 +10:00
Kristoffer Dalby b028a7dfc9 Merge branch 'main' into main 2022-05-10 22:33:33 +01:00
Kristoffer Dalby 41cd0d30eb Merge pull request #576 from juanfont/update-contributors 2022-05-10 18:26:14 +01:00
Samuel Lock 8be9e9655c fixed issue #360 2022-05-10 20:51:14 +10:00
github-actions[bot] 31bdba7456 docs(README): update contributors 2022-05-08 21:57:04 +00:00
Kristoffer Dalby d6e1d10b12 Merge pull request #573 from deonthomasgy/patch-1 2022-05-08 22:56:32 +01:00
Kristoffer Dalby 21268f7abe Merge branch 'main' into patch-1 2022-05-08 22:55:19 +01:00
Juan Font 91b95ff707 Merge pull request #574 from deonthomasgy/main
show ipv4 address first in node list
2022-05-08 23:32:25 +02:00
Deon Thomas 6ed79b7bb8 order Ip Address, IPv4 first, cleanup 2022-05-08 15:21:10 -04:00
Deon Thomas b4f5ed6618 order ip address output, IPv4 first 2022-05-08 15:06:12 -04:00
Deon Thomas ed46491a3d fixed typo
not => note
2022-05-07 16:23:26 -04:00
Adrien Raffin-Caboisse dc8c20e002 fix: handle empty aclPolicy for integration tests 2022-05-04 22:56:55 +02:00
Adrien Raffin-Caboisse 68417cc888 fix(go): add missing updated files 2022-05-03 20:37:06 +02:00
Adrien Raffin-Caboisse a2fb5b2b9d Merge remote-tracking branch 'origin/main' into feat-list-tags-of-machines 2022-05-03 20:35:28 +02:00
Kristoffer Dalby 3fbfc5a649 Merge pull request #570 from juanfont/update-contributors 2022-05-02 22:23:30 +01:00
github-actions[bot] 00535a2016 docs(README): update contributors 2022-05-02 21:12:01 +00:00
Kristoffer Dalby fd452d52ca Merge pull request #565 from apognu/dev/oidc-custom-config 2022-05-02 22:11:14 +01:00
Antoine POPINEAU 7cc58af932 Allow more configuration over the OIDC flow.
Adds knobs to configure three aspects of the OpenID Connect flow:

 * Custom scopes to override the default "openid profile email".
 * Custom parameters to be added to the Authorize Endpoint request.
 * Domain allowlisting for authenticated principals.
 * User allowlisting for authenticated principals.
2022-05-02 17:11:07 +02:00
Kristoffer Dalby ddb87af5ce Merge pull request #569 from Kazauwa/362-add-move-command 2022-05-02 12:38:00 +01:00
Igor Perepilitsyn b9ea83fed8 check that new command does not break nodes list output 2022-05-02 15:04:24 +04:00
Igor Perepilitsyn e279224484 add integrations tests 2022-05-02 14:00:09 +04:00
Igor Perepilitsyn 12d8f0f4b0 remove redundant lines of code, fix response when output is not plain text 2022-05-02 14:00:00 +04:00
Igor Perepilitsyn 6ba68d150c correctly update machine namespace 2022-05-02 13:58:28 +04:00
Igor Perepilitsyn 1b3a7bbf03 apply styling fixes 2022-05-02 08:32:33 +04:00
Igor Perepilitsyn 4e686f8b77 add unit test 2022-05-01 21:40:18 +04:00
Igor Perepilitsyn 62c780a448 update changelog 2022-05-01 17:56:02 +04:00
Igor Perepilitsyn bc055edf12 add command for moving node between namespaces 2022-05-01 17:55:34 +04:00
Igor Perepilitsyn 47c72a4e2e add rpc method for moving node 2022-05-01 17:55:34 +04:00
Juan Font 02a78e5a45 Merge pull request #568 from juanfont/reduce-containers-int-tests
Reduce the number of containers in integration tests
2022-05-01 08:07:29 +02:00
Juan Font Alonso 01d9a2f589 Fixed linting issues 2022-04-30 23:48:28 +02:00
Juan Font 5403f215bc Reduce the number of containers in integration tests 2022-04-30 21:19:54 +00:00
Kristoffer Dalby 96e2955ba7 Merge pull request #566 from juanfont/fix-spurious-updates 2022-04-30 22:12:57 +01:00
Juan Font 03659c4175 Updated changelog 2022-04-30 14:50:55 +00:00
Juan Font 843e2bd9b6 Do not setLastStateChangeToNow every 5 seconds 2022-04-30 14:47:16 +00:00
Kristoffer Dalby 28efd92fca Merge pull request #559 from kradalby/update-deps 2022-04-28 10:17:54 +01:00
Kristoffer Dalby 7bb87a7300 Update vendor sha 2022-04-26 19:57:49 +00:00
Adrien Raffin-Caboisse fec8cda16a fix: fix linting issue on my computer 2022-04-25 22:33:53 +02:00
Adrien Raffin-Caboisse 2c448d4a5c chore: apply linting 2022-04-25 22:27:44 +02:00
Adrien Raffin-Caboisse 3d302441b6 fix: order error in the tests 2022-04-25 22:17:23 +02:00
Adrien Raffin-Caboisse 8061abe279 refact: use generics for contains functions 2022-04-25 22:17:23 +02:00
Adrien Raffin-Caboisse ea9aaa6022 feat: update functions to use set command 2022-04-25 22:17:23 +02:00
Adrien Raffin-Caboisse cc9eeda889 feat: updating cli to match the set command 2022-04-25 22:17:23 +02:00
Adrien Raffin-Caboisse 25f1dcf724 feat: update generated files 2022-04-25 22:17:23 +02:00
Adrien Raffin-Caboisse 31debf7055 feat: rewrite proto to only update tags of machine 2022-04-25 22:17:23 +02:00
Kristoffer Dalby db8db0299e Resolve merge 2022-04-25 16:58:06 +00:00
Juan Font e80954b6c8 Merge pull request #482 from kradalby/flake-build-env
Add Nix reproducible build system
2022-04-25 18:38:44 +02:00
Kristoffer Dalby 8504d0d8ba Move todo to correct file 2022-04-24 21:12:45 +01:00
Kristoffer Dalby 7ef8cd881c Fix comment 2022-04-24 21:10:50 +01:00
Kristoffer Dalby 79704dc9b0 Update command with new fields 2022-04-24 20:57:15 +01:00
Kristoffer Dalby 06c928bc52 Migrate name and nickname fields 2022-04-24 20:56:42 +01:00
Kristoffer Dalby 62808cbd86 Bubble error up to user for rename 2022-04-24 20:56:28 +01:00
Kristoffer Dalby 14994cb6cc Use new logic and fields for dns 2022-04-24 20:55:54 +01:00
Kristoffer Dalby 6b79679cb4 Generate from proto 2022-04-24 20:55:20 +01:00
Kristoffer Dalby caf79f6910 Change nickname to givenname in proto 2022-04-24 20:55:11 +01:00
Kristoffer Dalby 6e2768097a Rename name -> hostname, nickname -> givenname 2022-04-24 20:54:38 +01:00
Kristoffer Dalby 8845938881 Merge branch 'main' into main 2022-04-24 09:48:00 +02: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 f78deaebb6 Add new tailscale to integration tests 2022-04-23 08:30:13 +00:00
Kristoffer Dalby 4d2949bda9 Upgrade tailscale dep 2022-04-23 08:29:26 +00:00
Kristoffer Dalby cb0899b534 Update vendor shar 2022-04-23 00:02:57 +02:00
Kristoffer Dalby ecf5259693 resolve merge conflict 2022-04-22 22:34:20 +02:00
Kristoffer Dalby 3a90079ab8 Merge branch 'main' into feat-list-tags-of-machines 2022-04-22 22:27:36 +02:00
Kristoffer Dalby 970dea5d68 Merge pull request #557 from mpldr/remove-buf-installation 2022-04-22 08:16:03 +01:00
Kristoffer Dalby cd9807a1d3 Merge branch 'main' into flake-build-env 2022-04-22 07:52:29 +01:00
Kristoffer Dalby 613dc61339 Merge branch 'main' into remove-buf-installation 2022-04-22 07:51:40 +01:00
Adrien Raffin-Caboisse b9fee36f6e fix: linting 2022-04-21 23:56:58 +02:00
Adrien Raffin-Caboisse 17d6624bb9 chore: fix lint 2022-04-21 23:49:21 +02:00
Adrien Raffin-Caboisse f53bb63b2d fix: move tag command to subcommand of nodes 2022-04-21 23:43:20 +02:00
Adrien Raffin-Caboisse ea7bcfffbb Merge branch 'main' into feat-list-tags-of-machines 2022-04-21 20:38:51 +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 2dfd8a9098 Merge pull request #556 from juanfont/update-contributors 2022-04-21 12:53:14 +01:00
github-actions[bot] c8ed1f0f43 docs(README): update contributors 2022-04-21 11:51:30 +00:00
Kristoffer Dalby f9e2ce2c8c Merge pull request #551 from mpldr/patch-1 2022-04-21 12:50:50 +01:00
Moritz Poldrack 886e95c00d Merge branch 'main' into patch-1 2022-04-21 11:00:33 +02:00
Moritz Poldrack 6dd9e93346 expanded arguments in useradd to be easier to understand for beginners 2022-04-21 11:00:17 +02:00
Kristoffer Dalby 2dacf839dc Upgrade tailscale dep 2022-04-21 08:35:08 +00:00
Kristoffer Dalby 8f6952acee Merge branch 'main' into flake-build-env 2022-04-21 09:23:23 +01:00
Kristoffer Dalby 235a90276f Merge pull request #531 from juanfont/suggest-english 2022-04-21 09:21:37 +01:00
Kristoffer Dalby 5c285afda5 Merge branch 'main' into flake-build-env 2022-04-21 09:21:10 +01:00
Kristoffer Dalby db930af50e Merge branch 'main' into patch-1 2022-04-21 09:13:34 +01:00
Kristoffer Dalby ffa570e877 Merge branch 'main' into suggest-english 2022-04-21 09:13:08 +01:00
Kristoffer Dalby 96ae78f422 Merge pull request #553 from kradalby/fix-discord-link 2022-04-21 09:12:49 +01:00
Kristoffer Dalby 580c72bf16 Update discord link so it does not grant temp memberships 2022-04-21 09:06:30 +01:00
Kristoffer Dalby 9254afff2d Add direnv and nix output to gitignore 2022-04-21 09:06:13 +01:00
Moritz Poldrack 7ce0bd053c removed leading whitespace 2022-04-16 23:58:05 +02:00
Moritz Poldrack 41a8c14acb add information on how to create a headscale user 2022-04-16 23:56:57 +02:00
Moritz Poldrack be2487f4c0 Clarified systemd friendly path
Suggested-by: Rendezvous
2022-04-16 23:52:06 +02:00
Adrien Raffin-Caboisse 4651c44dde feat: print tags in nodes list 2022-04-16 13:32:00 +02:00
Adrien Raffin-Caboisse 4fcc5e253c chore: fmt for grpc file 2022-04-16 13:15:18 +02:00
Adrien Raffin-Caboisse 89a1a56328 feat: add unit tests and fmt 2022-04-16 13:15:04 +02:00
Adrien Raffin-Caboisse db1528bc73 feat: add invalid and valid tags to grpc response 2022-04-16 12:27:54 +02:00
Adrien Raffin-Caboisse 587bdc75de feat: add valid and invalid fields
Also change ID in proto for ForcedTags since the previous ID's should be reserved for commented fields
2022-04-16 11:30:51 +02:00
Adrien Raffin-Caboisse 98f54c9f7f chore: apply format and lint 2022-04-15 18:27:57 +02:00
Adrien Raffin-Caboisse cd1d10761f feat(acls): add support for forced tags 2022-04-15 18:01:13 +02:00
Adrien Raffin-Caboisse 9de9bc23f8 feat(cli): add tag subcommand to add and remove tags 2022-04-15 16:12:35 +02:00
Adrien Raffin-Caboisse 02f68ebac8 feat: add forcedTags field and update proto 2022-04-15 16:00:08 +02:00
Kristoffer Dalby dd3f24b83f Merge branch 'main' into suggest-english 2022-04-12 18:16:39 +01:00
Kristoffer Dalby bc63c577a9 Merge pull request #537 from reynico/exit-if-acl-wrong 2022-04-12 18:15:15 +01:00
Kristoffer Dalby 57c81e4153 Merge branch 'main' into exit-if-acl-wrong 2022-04-12 17:01:40 +01:00
Kristoffer Dalby 556ca5fec7 Merge pull request #544 from mpldr/makefile-improvements 2022-04-12 17:00:58 +01:00
Kristoffer Dalby 93682ab708 Merge branch 'main' into makefile-improvements 2022-04-12 17:00:30 +01:00
Kristoffer Dalby 6eeee8e5c7 Merge pull request #545 from mpldr/fix-discord-invite 2022-04-12 16:59:40 +01:00
Kristoffer Dalby d195847d8f Merge branch 'main' into fix-discord-invite 2022-04-12 16:59:04 +01:00
Moritz Poldrack 3d8dc9d2bf fix discord invite
Fixes: https://github.com/juanfont/headscale/issues/533
2022-04-11 19:08:07 +02:00
Moritz Poldrack 8601dd1f42 fixed CGO disabling 2022-04-11 14:57:12 +02:00
Kristoffer Dalby 3abdc870d8 Merge branch 'main' into makefile-improvements 2022-04-11 11:49:55 +01:00
Kristoffer Dalby 367f8489db Merge pull request #542 from mpldr/issue-342-send-on-closed-channel 2022-04-11 11:48:53 +01:00
Moritz Poldrack c312f8bf4a set up Makefile for reproducible builds 2022-04-11 08:56:40 +02:00
Moritz Poldrack 1f43c39f93 replaced version-at-commit script with git-describe call 2022-04-11 08:54:12 +02:00
Moritz Poldrack 9f03a012fb updated changelog 2022-04-10 22:47:52 +02:00
Moritz Poldrack 22dd61d849 fixed the issue of sending on closed channel
This commit fixes the issue of headscale crashing after sending on a
closed channel by moving the channel close to the sender side, instead
of the creator. closeChanWithLog is also implemented with generics now.

Fixes: https://github.com/juanfont/headscale/issues/342
Signed-off-by: Moritz Poldrack <git@moritz.sh>
2022-04-10 17:31:09 +02:00
Kristoffer Dalby a92f6abc6e Merge pull request #541 from juanfont/update-contributors 2022-04-10 10:04:44 +01:00
github-actions[bot] 9cdaa9730b docs(README): update contributors 2022-04-10 09:03:16 +00:00
Kristoffer Dalby 5d67ed0ce1 Merge pull request #540 from yangchuansheng/dev 2022-04-10 10:02:42 +01:00
Carson Yang 62d774b6ee Fix key name about derp port 2022-04-10 09:53:27 +08:00
Kristoffer Dalby a14f50eeca Merge pull request #538 from artemklevtsov/patch-1 2022-04-09 18:49:47 +01:00
Artem Klevtsov 98e98a8adb Fix wrong metrics port in docs
It should be 9090.
2022-04-09 16:24:57 +07:00
Nico Rey fa7ef3df2f make linter happy 2022-04-07 15:21:26 -03:00
Nico Rey c3324371d6 Update changelog 2022-04-06 18:41:13 -03:00
Nico Rey 6e08241712 Exit Headscale if ACL policy file cannot be parsed 2022-04-06 11:05:08 -03:00
Kristoffer Dalby c07dd3f14f Merge pull request #534 from nning/main 2022-04-06 08:35:39 +01:00
henning mueller b2ae9b6cac fix: Remove days from expiry option value examples 2022-04-05 18:45:29 +02:00
Juan Font 57536b020e Merge branch 'main' into suggest-english 2022-04-02 11:47:11 +02:00
Juan Font Alonso 0003e30084 Suggest English as lingua franca 2022-04-02 11:45:18 +02:00
Juan Font 23be13b113 Merge pull request #528 from juanfont/update-contributors
docs(README): update contributors
2022-03-29 23:12:16 +02:00
github-actions[bot] 5e44266292 docs(README): update contributors 2022-03-28 15:06:39 +00:00
Kristoffer Dalby 32522cb482 Merge pull request #521 from Niek/patch-1 2022-03-28 16:06:00 +01:00
Niek van der Maas 6d296a195d Update docs/running-headscale-container.md
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2022-03-28 08:58:33 +02:00
Niek van der Maas 3272febfb3 Change publish interface 2022-03-26 13:33:31 +01:00
Niek van der Maas 7dae780be1 Update docs/running-headscale-container.md
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2022-03-25 23:44:55 +01:00
Niek van der Maas 73f1c06f65 Fix long line 2022-03-25 07:46:01 +00:00
Niek van der Maas b60727b205 Merge branch 'main' into patch-1 2022-03-25 08:44:16 +01:00
Niek van der Maas 8cee31d8d7 Fix prettier 2022-03-25 07:43:15 +00:00
Juan Font b5aace6d3a Merge pull request #519 from hdhoang/pak-counter
Fix labels cardinality error when registering unknown pre-auth key
2022-03-25 00:25:19 +01:00
Niek van der Maas 7e286c570e Docker docs enhancements
While configuring a Docker setup I noticed that the docs could use some enhancements.
2022-03-22 13:45:30 +01:00
hdhoang 52fd13bfc4 Fix labels cardinality error when registering unknown pre-auth key 2022-03-21 15:49:14 +07:00
Kristoffer Dalby b8e4aeede8 Upgrade golines 2022-03-20 22:39:43 +00:00
Kristoffer Dalby 9a632c17d1 Merge pull request #518 from juanfont/update-contributors 2022-03-20 14:42:41 +00:00
github-actions[bot] 8758ee1c4d docs(README): update contributors 2022-03-20 14:18:39 +00:00
Kristoffer Dalby 150ae1846a Merge pull request #517 from juanfont/changelog-prep-0.15
Prepare CHANGELOG for v0.15.0
2022-03-20 14:18:01 +00:00
Juan Font 452286552c Update CHANGELOG.md to include future 0.16.0
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2022-03-20 15:07:22 +01:00
Juan Font Alonso 631cf58ff0 Added date for 0.15.0 in changelog 2022-03-20 13:36:25 +01:00
Juan Font 8a2c0e88f4 Merge pull request #513 from juanfont/unstable-integration-tests
Add Tailscale unstable channel and repo HEAD to integration tests
2022-03-20 13:35:23 +01:00
Juan Font Alonso af6a47fdd3 Changelog updated 2022-03-20 12:36:30 +01:00
Juan Font 94d910557f Merge branch 'main' into unstable-integration-tests 2022-03-20 12:34:04 +01:00
Juan Font Alonso a8a683d3cc Added default values in Dockerfile.tailscale 2022-03-20 12:33:41 +01:00
Juan Font Alonso a1caa5b45c Minor improvements on logging 2022-03-20 12:31:18 +01:00
Juan Font Alonso f42868f67f Docker requires lowercase for the container names 2022-03-20 12:30:56 +01:00
Juan Font Alonso a6455653c0 Added missing package 2022-03-20 12:30:08 +01:00
Kristoffer Dalby c8aa653275 Merge branch 'main' into main 2022-03-19 09:36:36 +00:00
Kristoffer Dalby 91e5cbd793 Add direnv flake support 2022-03-19 09:23:03 +00:00
Kristoffer Dalby 79fc74c7a4 Merge branch 'main' into acls-doc 2022-03-18 22:43:17 +00:00
Kristoffer Dalby c8503075e0 Merge pull request #514 from aofei/main 2022-03-18 21:18:22 +00:00
Kristoffer Dalby 4068a7b00b Merge branch 'main' into main 2022-03-18 21:02:05 +00:00
Kristoffer Dalby daae2fe549 Merge pull request #512 from restanrm/feat-add-debug-log 2022-03-18 21:01:16 +00:00
Kristoffer Dalby 47bbb85a20 Merge branch 'main' into acls-doc 2022-03-18 20:44:44 +00:00
Kristoffer Dalby 739653fa71 Merge branch 'main' into feat-add-debug-log 2022-03-18 20:44:21 +00:00
Kristoffer Dalby 304109a6c5 Merge pull request #511 from restanrm/fix-machine-registration-expired 2022-03-18 20:44:05 +00:00
Kristoffer Dalby c29af96a19 Merge branch 'main' into main 2022-03-18 20:42:44 +00:00
Kristoffer Dalby d21e9d29d1 Merge branch 'main' into feat-add-debug-log 2022-03-18 19:41:32 +00:00
Kristoffer Dalby b65bd5baa8 Merge branch 'main' into fix-machine-registration-expired 2022-03-18 19:41:26 +00:00
Juan Font Alonso 0165b89941 Fixed paths 2022-03-18 19:35:09 +01:00
Kristoffer Dalby 53b62f3f39 Merge pull request #499 from juanfont/mandatory-stun 2022-03-18 18:28:37 +00:00
Kristoffer Dalby cd2914ab3b Merge branch 'main' into mandatory-stun 2022-03-18 17:44:12 +00:00
Kristoffer Dalby e85b97143c Merge pull request #509 from kradalby/go118 2022-03-18 17:43:41 +00:00
Aofei Sheng 1eafe960b8 fix: possible panic in Headscale.scheduledDERPMapUpdateWorker
There is a possible nil pointer dereference panic in the
`Headscale.scheduledDERPMapUpdateWorker`. Such as when the embedded
DERP server is disabled.
2022-03-19 01:20:25 +08:00
Juan Font Alonso 749c92954c Add Tailscale unstable channel and repo HEAD to integration tests
In preparation for the implementation of the new TS2021 protocol (Tailscale control protocol v2) we are expanding the test infrastructure
2022-03-18 17:05:28 +01:00
Juan Font Alonso db9ba17920 Added missing file 2022-03-18 13:10:35 +01:00
Juan Font Alonso d5ce7d7523 Prettier 2022-03-18 13:09:57 +01:00
Juan Font Alonso 2e6687209b Make STUN server mandatory if DERP embedded is enabled 2022-03-18 12:58:00 +01:00
Adrien Raffin-Caboisse 2e04abf4bb feat(oidc): add debug log 2022-03-18 09:40:12 +01:00
Adrien Raffin-Caboisse 882c0c34c1 chore(changelog): update changelog 2022-03-18 09:34:18 +01:00
Adrien Raffin-Caboisse 61ebb713f2 fix(oidc): Reset expiry for reauthentication
The previous code resetted the expiry time to be expired.  So the machine was never reauthenticated
2022-03-18 09:32:07 +01:00
Kristoffer Dalby ac5ad42474 Fix integration nix 2022-03-18 08:24:21 +00:00
Nico Rey d68d7d5a6f Docs/ACLs: Add a network diagram to help explain ACLs 2022-03-17 19:58:56 -03:00
Nico Rey bff9036f14 Docs/ACLs: Add router examples with subnets 2022-03-17 19:58:34 -03:00
Nico Rey 8b08c2a918 Docs/ACLs: Namespaces are created automatically 2022-03-17 19:24:39 -03:00
Nico Rey b9f0fabb5c Docs/ACLs: Wording, add intermediary router example 2022-03-17 19:23:37 -03:00
Kristoffer Dalby 9d4822b8c7 Actually set up nix 2022-03-17 18:20:01 +00:00
Kristoffer Dalby 466d03d574 Nixify integration test 2022-03-17 18:18:51 +00:00
Kristoffer Dalby d43fec7f96 Merge branch 'main' into flake-build-env 2022-03-17 18:11:21 +00:00
Kristoffer Dalby 62f4c205f5 Run binary build with nix 2022-03-17 18:11:04 +00:00
Kristoffer Dalby 003c19004d Run tests with nix 2022-03-17 18:10:50 +00:00
Kristoffer Dalby 70274d528c Add nix to runn on lint and integration 2022-03-17 18:08:49 +00:00
Kristoffer Dalby 6d41279781 Upgrade to go 1.18 2022-03-17 18:07:26 +00:00
Kristoffer Dalby b781446e86 Upgrade to go 1.18 2022-03-17 17:43:11 +00:00
Kristoffer Dalby 1c9b1c0579 Merge pull request #507 from juanfont/update-contributors 2022-03-17 07:28:42 +00:00
github-actions[bot] ade9552736 docs(README): update contributors 2022-03-17 06:38:00 +00:00
Kristoffer Dalby 68403cb76e Merge pull request #505 from y0ngb1n/fix-docs-metrics-endpoint 2022-03-17 06:37:27 +00:00
Yang Bin 537ecb8db0 docs: fixed /metrics endpoint 8080 → 9090, reference config-example.yaml 2022-03-17 09:25:42 +08:00
Juan Font Alonso 8f5875efe4 Reorg errors 2022-03-16 19:46:59 +01:00
Juan Font 98ac88d5ef Changed comment position
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2022-03-16 18:45:34 +01:00
Kristoffer Dalby d13338a9fb Merge branch 'main' into mandatory-stun 2022-03-16 07:18:18 +00:00
Juan Font 1579ffb66a Merge pull request #500 from bravechamp/patch-1
Fix API access
2022-03-15 14:53:23 +01:00
bravechamp 0bfa5302a7 Fix API access
By allowing API keys to be validated
2022-03-15 16:05:56 +03:00
Juan Font Alonso b8aad5451d Make STUN run by default when embedded DERP is enabled
This commit also allows to set an external STUN server, while running the embedded DERP server (without embedded STUN)
2022-03-15 13:22:25 +01:00
bravechamp 60ee04674d Normalize nickname before saving to database 2022-03-13 21:55:36 +00:00
bravechamp 9901d6b2e7 Ability to clear nickname 2022-03-13 21:10:41 +00:00
bravechamp 663e8384a3 Nickname support 2022-03-13 21:03:20 +00:00
Kristoffer Dalby 61440c42d3 Merge pull request #496 from juanfont/update-contributors
docs(README): update contributors
2022-03-10 19:58:24 +00:00
github-actions[bot] 18ee6274e1 docs(README): update contributors 2022-03-10 19:50:59 +00:00
Kristoffer Dalby 0abfbdc18a Merge pull request #495 from appbricks/appbricks/main-bug-fix
Regression bug fix when re-authenticating machine with auth-key
2022-03-10 19:50:23 +00:00
Mevan Samaratunga 082a852c5e fixed linting recommendation 2022-03-10 10:40:20 -05:00
Mevan Samaratunga af081e9fd3 fixed lint errors 2022-03-10 10:22:21 -05:00
Mevan Samaratunga 8b5e8b7dfc Refresh expired machine on re-auth - closes #489 2022-03-10 08:59:28 -05:00
Kristoffer Dalby 1e7d7e510e Update go sha for flake 2022-03-08 17:17:02 +00:00
Kristoffer Dalby a806694d23 fix gosum merge 2022-03-08 17:11:46 +00:00
Kristoffer Dalby 62d7fae056 Merge pull request #311 from restanrm/docs-acl-modifications
Issues with current ACL implementation and solution proposal
2022-03-08 17:08:17 +00:00
Kristoffer Dalby 06d85688fd set version based on git rev 2022-03-08 17:07:25 +00:00
Kristoffer Dalby dd219d0ff6 Merge branch 'main' into docs-acl-modifications 2022-03-08 17:05:59 +00:00
Kristoffer Dalby 6087e1cf6f Merge pull request #488 from juanfont/update-contributors 2022-03-08 17:02:47 +00:00
github-actions[bot] c47fb1ae54 docs(README): update contributors 2022-03-08 16:50:11 +00:00
Kristoffer Dalby 48cec3cd90 Merge pull request #486 from e-zk/main 2022-03-08 16:49:32 +00:00
Kristoffer Dalby e54c508c10 Merge branch 'main' into main 2022-03-08 16:05:41 +00:00
Kristoffer Dalby 941e9d9b0f Merge pull request #388 from juanfont/embedded-derp 2022-03-08 16:05:30 +00:00
Kristoffer Dalby 11ccae8e52 Merge branch 'main' into flake-build-env 2022-03-08 16:04:52 +00:00
Juan Font Alonso b803240dc1 Added new line for prettier 2022-03-08 12:21:08 +01:00
Juan Font Alonso bdbf620ece Merge branch 'embedded-derp' of https://github.com/juanfont/headscale into embedded-derp 2022-03-08 12:16:43 +01:00
Juan Font e5d22b8a70 Merge branch 'main' into embedded-derp 2022-03-08 12:16:34 +01:00
Juan Font Alonso 05c5e2280b Updated CHANGELOG and README 2022-03-08 12:15:05 +01:00
Juan Font Alonso b41d89946a Merge branch 'embedded-derp' of https://github.com/juanfont/headscale into embedded-derp 2022-03-08 12:11:59 +01:00
Juan Font Alonso cc0c88a63a Added small integration test for stun 2022-03-08 12:11:51 +01:00
e-zk c06689dec1 fix: make register html/template consistent with other html
- makes the html/template for /register follow the same formatting
  as /apple and /windows
- adds a <title> element
- minor change for consistency's sake
2022-03-08 18:34:46 +10:00
Kristoffer Dalby b85dd7abbd Merge pull request #484 from juanfont/prtemplate-fix
Fix checkboxes in PR template
2022-03-08 07:29:30 +00:00
Kristoffer Dalby 6aeaff43aa Fix checkboxes in PR template 2022-03-08 07:21:04 +00:00
Kristoffer Dalby dd26cbd193 Merge branch 'main' into embedded-derp 2022-03-08 07:18:51 +00:00
Kristoffer Dalby 9a60eeaf86 Merge branch 'main' into flake-build-env 2022-03-08 07:18:21 +00:00
Kristoffer Dalby b0ae3240fd Merge pull request #387 from restanrm/fix-magic-dns-and-uppercase-letters
Fix magic dns and uppercase letters
2022-03-08 07:17:45 +00:00
Adrien Raffin-Caboisse 41efe98953 fix: apply fmt and fix missing name changes 2022-03-07 23:20:30 +01:00
Adrien Raffin-Caboisse 2b68c90778 chore: update changelog 2022-03-07 23:14:39 +01:00
Adrien Raffin-Caboisse f19c048569 fix: change normalization function name 2022-03-07 22:55:54 +01:00
Adrien Raffin-Caboisse 6cc8bbc24f feat(api): add normalisation at machine register step 2022-03-07 22:46:29 +01:00
Kristoffer Dalby c24de595f6 Add example commands for docker 2022-03-07 17:41:16 +00:00
Kristoffer Dalby 63641a7b17 Correct pkgs call 2022-03-07 17:37:53 +00:00
Kristoffer Dalby a6570d33a6 Add option to build docker image
This commit adds dockerbuild to flakes.nix:

```
nix build .#headscale-docker
```

This uses the Nix infra to build and _does not_ use Dockerfile.

It currently works on Linux (no macOS)
2022-03-07 17:18:41 +00:00
Kristoffer Dalby 124d8a3424 Update readme with nix notes 2022-03-07 16:58:07 +00:00
Kristoffer Dalby 5de9de14a9 Add flake build file
This commit adds a flake.nix build file, it can be used for three
things:

Build `headscale` from local or straight from git:

nix build
or
nix build github:juanfont/headscale

Run and Build `headscale` from local or straight from git:

nix run
or
nix run github:juanfont/headscale

Set up a development environment including all our tools,
- linters
- protobuf tooling
- compilers

nix develop
2022-03-07 16:51:38 +00:00
Kristoffer Dalby 15f8cb5034 Remove hacky go tool install 2022-03-07 07:40:56 +00:00
Juan Font Alonso 03452a8dca Prettied 2022-03-07 00:29:40 +01:00
Juan Font Alonso 15ed71315c Merge branch 'embedded-derp' of https://github.com/juanfont/headscale into embedded-derp 2022-03-06 23:47:31 +01:00
Juan Font Alonso 05df8e947a Added missing file 2022-03-06 23:47:14 +01:00
Juan Font Alonso b3fa66dbd2 Check for DERP in test 2022-03-06 23:46:16 +01:00
Juan Font Alonso a27b386123 Clarified expiration dates 2022-03-06 23:45:01 +01:00
Juan Font Alonso 580db9b58f Mention that STUN is UDP 2022-03-06 23:19:21 +01:00
Adrien Raffin-Caboisse 1114449601 change: update name of method to check and normalize Domain name 2022-03-06 20:46:17 +01:00
Juan Font b47de07eea Update Dockerfile.tailscale
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2022-03-06 20:42:27 +01:00
Juan Font e1fcf0da26 Added more version
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2022-03-06 20:40:55 +01:00
Juan Font dcf3ea567c Merge branch 'main' into fix-magic-dns-and-uppercase-letters 2022-03-06 17:37:48 +01:00
Juan Font Alonso de2ea83b3b Linting here and there 2022-03-06 17:35:54 +01:00
Juan Font Alonso eb06054a7b Make DERP Region configurable 2022-03-06 17:25:21 +01:00
Juan Font Alonso eb500155e8 Make STUN server configurable 2022-03-06 17:00:56 +01:00
Juan Font Alonso dc909ba6d7 Improved logging on startup 2022-03-06 16:54:19 +01:00
Juan Font Alonso 70910c4595 Working /bootstrap-dns DERP helper 2022-03-06 01:23:35 +01:00
Juan Font Alonso 54c3e00a1f Merge local DERP server region with other configured DERP sources 2022-03-05 20:04:31 +01:00
Juan Font Alonso e78c002f5a Fix minor issue 2022-03-05 19:48:30 +01:00
Juan Font Alonso 237f7f1027 Merge branch 'main' into embedded-derp 2022-03-05 19:42:29 +01:00
Juan Font Alonso 992efbd84a Added missing private TLS key 2022-03-05 19:35:15 +01:00
Juan Font Alonso e9eb90fa76 Added integration tests for the embedded DERP server 2022-03-05 19:34:06 +01:00
Juan Font Alonso 88378c22fb Rename the file to derp_server.go for coherence 2022-03-05 19:31:50 +01:00
Juan Font Alonso b742379627 Do not use the term embedded 2022-03-05 19:30:30 +01:00
Juan Font Alonso df37d1a639 Do not offer the option to be DERP insecure
Websockets, in which DERP is based, requires a TLS certificate. At the same time,
if we use a certificate it must be valid... otherwise Tailscale wont connect (does not
have an Insecure option). So there is no option to expose insecure here
2022-03-05 19:19:21 +01:00
Juan Font Alonso 758b1ba1cb Renamed configuration items of the DERP server 2022-03-05 16:22:02 +01:00
Kristoffer Dalby 435ee36d78 Merge pull request #394 from juanfont/renovateaction/dockerfiles 2022-03-05 00:41:22 +00:00
Renovate Bot 35efd8f95a chore(deps): update dependency docker.io/golang to v1.17.8 2022-03-05 00:09:36 +00:00
Juan Font Alonso 09d78c7a05 Even more stuff moved to common 2022-03-04 13:54:59 +01:00
Kristoffer Dalby 60655c5242 Merge pull request #393 from juanfont/update-contributors 2022-03-04 12:30:20 +00:00
Juan Font Alonso 22d2443281 Move more stuff to common 2022-03-04 13:26:45 +01:00
github-actions[bot] a70669fca7 docs(README): update contributors 2022-03-04 11:04:12 +00:00
Kristoffer Dalby 0720473033 Merge pull request #392 from e-zk/windows-endpoint 2022-03-04 11:03:33 +00:00
Kristoffer Dalby e799307e74 Merge branch 'main' into windows-endpoint 2022-03-04 10:47:52 +00:00
e-zk 575f33d183 docs: fix comments to comply with golangci-lint 2022-03-04 20:35:09 +10:00
Juan Font Alonso 607c1eb316 Be consistent with uppercase DERP 2022-03-04 11:31:41 +01:00
e-zk d69dada8ff feat(windows): rename apple_mobileconfig.go => platform_config.go
rename apple_mobileconfig.go to platform_config.go since the file
includes configuration info for multiple platforms now.
2022-03-04 20:03:49 +10:00
e-zk f9e0c13890 docs: update CHANGELOG 2022-03-04 19:53:57 +10:00
e-zk 12a50ac8ac feat(windows): add /windows endpoint for Windows configuration
- registry file /windows/tailscale.reg is generated, filling in the
  associated control server URL
- also includes CLI instructions
- fix /apple incorrect template: 'Url' is supposed to be '.URL'
2022-03-04 19:53:44 +10:00
e-zk b342cf0240 feat(windows): cleanup /apple endpoint
- rename the gin function to AppleConfigMessage
- use <pre> + <code> for code blocks
- add headscale heading
- reword some sections
2022-03-04 19:53:29 +10:00
Kristoffer Dalby e3ff87b7ef Merge pull request #389 from e-zk/main 2022-03-04 07:26:35 +00:00
zakaria 745696b310 docs: fix mistake in ACME challenge type comment 2022-03-04 12:11:43 +10:00
Juan Font Alonso 23cde8445f Merge branch 'main' into embedded-derp 2022-03-04 00:04:59 +01:00
Juan Font Alonso 9d43f589ae Added missing deps 2022-03-04 00:04:28 +01:00
Juan Font Alonso 897d480f4d Add an embedded DERP server to Headscale
This series of commit will be adding an embedded DERP server (and STUN) to Headscale,
thus making it completely self-contained and not dependant in other infrastructure.
2022-03-04 00:01:31 +01:00
Adrien Raffin-Caboisse 6f172a6e4c fix(acls): remove dead error code 2022-03-03 23:53:08 +01:00
Adrien Raffin-Caboisse 44a5372c53 fix(poll): Normalize hostname
This function is called often. Normalization of the hostname will be written in database.
2022-03-03 23:52:25 +01:00
Kristoffer Dalby f2ea6fb30f Merge pull request #384 from restanrm/fix-issue-with-empty-namespace-and-acl-evaluation 2022-03-03 08:43:37 +00:00
Adrien Raffin-Caboisse 4a4952899b feat(acls): add some logs and skip error
logs looks like the following
```
2022-03-02T20:43:08Z DBG Expanding alias=app-test
2022-03-02T20:43:08Z DBG Expanding alias=kube-test
2022-03-02T20:43:08Z DBG Expanding alias=test
2022-03-02T20:43:08Z WRN No IPs found with the alias test
2022-03-02T20:43:08Z DBG Expanding alias=prod
2022-03-02T20:43:08Z WRN No IPs found with the alias prod
2022-03-02T20:43:08Z DBG Expanding alias=prod
2022-03-02T20:43:08Z WRN No IPs found with the alias prod
```
2022-03-02 21:54:43 +01:00
Kristoffer Dalby b72a8aa7d1 Merge pull request #381 from juanfont/update-contributors 2022-03-02 14:18:09 +00:00
github-actions[bot] e301d0d1df docs(README): update contributors 2022-03-02 13:44:26 +00:00
Kristoffer Dalby 75ca91b0f7 Merge pull request #380 from juanfont/update-contributors
docs(README): update contributors
2022-03-02 13:43:53 +00:00
github-actions[bot] e208ccc982 docs(README): update contributors 2022-03-02 13:42:25 +00:00
Kristoffer Dalby 71a62697aa Merge pull request #379 from juanfont/kradalby-patch-1
Second contributor attempt
2022-03-02 13:41:50 +00:00
Kristoffer Dalby f9c0597875 Second contributor attempt 2022-03-02 13:40:37 +00:00
Kristoffer Dalby aa3eb5171a Merge pull request #344 from reynico/metrics-listen 2022-03-02 13:06:29 +00:00
Nico Rey dcc46af8de Changelog: add breaking change 2022-03-02 09:22:29 -03:00
Kristoffer Dalby b61500670c Merge branch 'main' into metrics-listen 2022-03-02 11:35:33 +00:00
Kristoffer Dalby ccec534e19 Merge pull request #377 from juanfont/smarter-contribute-pipeline 2022-03-02 11:17:02 +00:00
Kristoffer Dalby 9b10457209 Merge branch 'main' into smarter-contribute-pipeline 2022-03-02 11:14:50 +00:00
Kristoffer Dalby 9a8f605cba Merge pull request #371 from kradalby/use-specific-database-typess 2022-03-02 11:14:04 +00:00
Kristoffer Dalby 1246267ead Merge branch 'main' into smarter-contribute-pipeline 2022-03-02 10:43:07 +00:00
Kristoffer Dalby a0a56d43f8 Merge branch 'main' into use-specific-database-typess 2022-03-02 10:29:34 +00:00
Kristoffer Dalby 63d87110f6 Merge pull request #376 from e-zk/feat/command-aliases 2022-03-02 10:28:18 +00:00
Kristoffer Dalby 7c99d963e2 Merge branch 'main' into feat/command-aliases 2022-03-02 10:06:38 +00:00
zakaria a614f158be docs: update changelog 2022-03-02 19:53:07 +10:00
Kristoffer Dalby 2b6a5173da Allow upstream delete continue on failure 2022-03-02 09:12:00 +00:00
Kristoffer Dalby 32ac690494 Update contributors.yml 2022-03-02 09:08:30 +00:00
Kristoffer Dalby 0835bffc3c Update changelog 2022-03-02 08:15:21 +00:00
Kristoffer Dalby c80e364f02 Remove always nil error 2022-03-02 08:15:14 +00:00
Kristoffer Dalby 5b169010be Resolve merge conflict 2022-03-02 08:11:50 +00:00
Kristoffer Dalby eeded85d9c Merge pull request #366 from kradalby/registration-simplification 2022-03-02 08:02:26 +00:00
Kristoffer Dalby e4d81bbb16 Merge branch 'main' into registration-simplification 2022-03-02 07:31:02 +00:00
Kristoffer Dalby 1f8c7f427b Add comment 2022-03-02 07:29:56 +00:00
Kristoffer Dalby ef422e6988 Protect against expiry nil 2022-03-02 07:29:56 +00:00
Kristoffer Dalby ec4dc68524 Use correct machinekey format for oidc reg 2022-03-02 07:29:56 +00:00
Kristoffer Dalby 86ade72c19 Remove err check 2022-03-02 07:29:56 +00:00
Kristoffer Dalby 0c0653df8b Merge pull request #375 from restanrm/fix-limitations-in-source-acls-rules
Fix limitations in source acls rules
2022-03-02 07:02:29 +00:00
zakaria 12b3b5f8f1 feat(aliases): add aliases for preauthkeys command
- `preauthkey`, `authkey`, `pre` are aliases for `preauthkey` command
- `ls`, `show` are aliases for `list` subcommand
- `c`, `new` are aliases for `create` subcommand
- `revoke`, `exp`, `e` are aliases for `expire` subcommand
2022-03-02 15:42:12 +10:00
zakaria 052dbfe440 feat(aliases): add aliases for apikeys command
- `apikey`, `api` are aliases for `apikeys` command
- `ls`, `show` are aliases for `list` subcommand
- `c`, `new` are aliases for `create` subcommand
- `revoke`, `exp`, `e` are aliases for the `expire` subcommand
2022-03-02 15:32:35 +10:00
zakaria 5310f8692b feat(aliases): add aliases for namespaces command
- `namespace`, `ns`, `user`, `users` are aliases for `namespaces`
   command
- `c`, `new` are aliases for the `create` subcommand
- `delete` is an alias for the `destroy` subcommand
- `mv` is an alias for the `rename` subcommand
- `ls`, `show` are aliases for the `list` subcommand
2022-03-02 14:35:20 +10:00
zakaria aff6b84250 feat(aliases): add 'gen' alias for 'generate' command 2022-03-02 14:29:33 +10:00
zakaria 21eee912a3 feat(aliases): add aliases for nodes command
- `node`, `machine`, `machines` are aliases for `nodes` command
- `ls`, `show` aliases for `list` subcommand
- `logout`, `exp`, `e` are aliases for `expire` subcommand
- `del` is an alias for `delete` subcommand
2022-03-02 14:28:03 +10:00
zakaria dbb2af0238 feat(aliases): add aliases for route command
- `r` is alias for `route` command
- `ls`, or `show` is alias for `list` subcommand
2022-03-02 14:27:56 +10:00
Adrien Raffin-Caboisse 77fe0b01f7 docs: update changelog 2022-03-01 22:50:22 +01:00
Adrien Raffin-Caboisse 361b4f7f4f fix(machine): allow to use * in ACL sources 2022-03-01 22:48:21 +01:00
Kristoffer Dalby dec4ee5f73 Merge pull request #373 from restanrm/feat-email-in-acls 2022-03-01 21:18:13 +00:00
Adrien Raffin-Caboisse b2dca80e7a docs: update changelog 2022-03-01 21:16:33 +01:00
Adrien Raffin-Caboisse a455a874ad feat(acls): normalize the group name 2022-03-01 21:10:52 +01:00
Kristoffer Dalby 49cd761bf6 Use new machine types in tests 2022-03-01 16:34:35 +00:00
Kristoffer Dalby 6477e6a583 Use new machine types 2022-03-01 16:34:24 +00: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 a9d4fa89dc Merge branch 'main' into registration-simplification 2022-03-01 15:53:06 +01:00
Kristoffer Dalby 94c5474212 Merge pull request #369 from kradalby/update-dependencies
Update dependencies
2022-03-01 15:52:27 +01:00
Kristoffer Dalby d34d617935 Merge branch 'main' into registration-simplification 2022-03-01 15:18:24 +01:00
Kristoffer Dalby 573008757d Merge branch 'main' into update-dependencies 2022-03-01 15:16:56 +01:00
Kristoffer Dalby 4c74043f72 Merge pull request #359 from kradalby/yaml-acls
Add YAML support to ACLs
2022-03-01 15:16:37 +01:00
Kristoffer Dalby 0551b34de5 Merge branch 'main' into update-dependencies 2022-03-01 14:51:57 +01:00
Kristoffer Dalby 105812421e Merge branch 'main' into yaml-acls 2022-03-01 14:49:37 +01:00
Kristoffer Dalby 4a9fd3a680 Merge pull request #368 from kradalby/apple-profile-fix
Fix apple profile issue being generated with escaped characters
2022-03-01 14:49:07 +01:00
Kristoffer Dalby 1cb39d914c Update dependencies 2022-03-01 07:35:17 +00:00
Kristoffer Dalby 5157f356cb Fix apple profile issue being generated with escaped characters 2022-03-01 07:30:35 +00:00
Kristoffer Dalby 7c63412df5 Remove todo 2022-02-28 23:02:41 +00:00
Kristoffer Dalby 82cb6b9ddc Cleanup some unreachable code 2022-02-28 23:00:41 +00:00
Kristoffer Dalby 379017602c Reformat and add db backup note 2022-02-28 22:50:35 +00:00
Kristoffer Dalby 8bef04d8df Remove sorted todo 2022-02-28 22:45:42 +00:00
Kristoffer Dalby 5e92ddad43 Remove redundant caches
This commit removes the two extra caches (oidc, requested time) and uses
the new central registration cache instead. The requested time is
unified into the main machine object and the oidc key is just added to
the same cache, as a string with the state as a key instead of machine
key.
2022-02-28 22:42:30 +00:00
Kristoffer Dalby e64bee778f Regenerate proto 2022-02-28 22:21:14 +00:00
Kristoffer Dalby 5e1b12948e Remove registered field from proto 2022-02-28 22:21:06 +00:00
Kristoffer Dalby eea8e7ba6f Update changelog 2022-02-28 22:11:31 +00:00
Kristoffer Dalby 78251ce8ec Remove registrated field
This commit removes the field from the database and does a DB migration
**removing** all unregistered machines from headscale.

This means that from this version, all machines in the database is
considered registered.
2022-02-28 18:05:03 +00:00
Kristoffer Dalby a8649d83c4 Remove all references to Machine.Registered from tests 2022-02-28 17:42:03 +00:00
Kristoffer Dalby 16b21e8158 Remove all references to Machine.Registered 2022-02-28 16:55:57 +00:00
Kristoffer Dalby 35616eb861 Fix oidc error were namespace isnt created #365 2022-02-28 16:41:28 +00:00
Kristoffer Dalby e7bef56718 Remove reference to registered in integration test 2022-02-28 16:36:29 +00:00
Kristoffer Dalby c6b87de959 Remove poorly aged test 2022-02-28 16:36:16 +00:00
Kristoffer Dalby 50053e616a Ignore complexity linter 2022-02-28 16:35:08 +00:00
Kristoffer Dalby 54cc3c067f Implement new machine register parameter 2022-02-28 16:34:50 +00:00
Kristoffer Dalby 402a76070f Reuse machine structure for parameters, named parameters 2022-02-28 16:34:28 +00:00
Nico Rey 9a61725e9f Metrics: Disable toggle. Set default port to 9090 2022-02-28 10:40:02 -03:00
Kristoffer Dalby 6126d6d9b5 Merge branch 'main' into metrics-listen 2022-02-28 14:24:25 +01:00
Kristoffer Dalby 469551bc5d Register new machines needing callback in memory
This commit stores temporary registration data in cache, instead of
memory allowing us to only have actually registered machines in the
database.
2022-02-28 08:06:39 +00:00
Kristoffer Dalby 1caa6f5d69 Add todo for JSON datatype 2022-02-27 18:48:25 +01:00
Kristoffer Dalby ecc26432fd Fix excessive replace 2022-02-27 18:48:12 +01:00
Kristoffer Dalby caffbd8956 Update cli registration with new method 2022-02-27 18:42:43 +01:00
Kristoffer Dalby fd1e4a1dcd Generalise registration for openid 2022-02-27 18:42:24 +01:00
Kristoffer Dalby acb945841c Generalise registration for pre auth keys 2022-02-27 18:42:15 +01:00
Kristoffer Dalby c58ce6f60c Generalise the registration method to DRY stuff up 2022-02-27 18:40:10 +01:00
Kristoffer Dalby d6f6939c54 Update changelog 2022-02-27 09:08:29 +01:00
Kristoffer Dalby e0b9a317f4 Add note to config example 2022-02-27 09:05:08 +01:00
Kristoffer Dalby c159eb7541 Add basic test of yaml parsing 2022-02-27 09:04:59 +01:00
Kristoffer Dalby 8a3a0b6403 Add YAML support to ACLs 2022-02-27 09:04:48 +01:00
Kristoffer Dalby 67d6c8f946 Remove oversensitive tracing output 2022-02-27 09:04:27 +01:00
Nico Rey 06e6c29a5b metrics: make metrics endpoint toggleable 2022-02-25 18:36:03 -03:00
Nico Rey a9122c3de3 prometheus: replace default port by a port between the recommended prometheus range 2022-02-25 18:21:20 -03:00
Kristoffer Dalby b1bd17f316 Merge pull request #350 from restanrm/feat-oidc-login-as-namespace 2022-02-25 13:22:26 +01:00
Adrien Raffin-Caboisse b39faa124a Merge remote-tracking branch 'origin/main' into feat-oidc-login-as-namespace 2022-02-25 11:28:17 +01:00
Kristoffer Dalby 8689a39c96 Merge pull request #357 from kradalby/make-namespace-to-users
Remove boundaries between Namespaces
2022-02-25 11:01:41 +01:00
Kristoffer Dalby bae8ed3e70 Merge branch 'main' into make-namespace-to-users 2022-02-25 10:39:12 +01:00
Kristoffer Dalby 08c7076667 Merge pull request #346 from kradalby/integration-test-concurrent-join
Fix ip allocation bug, make integration tests faster
2022-02-25 10:37:35 +01:00
Kristoffer Dalby 91b50550ee Update readme and glossary to reflect features and goals 2022-02-25 10:34:35 +01:00
Kristoffer Dalby 2c7064462a Update changelog 2022-02-25 10:30:58 +01:00
Kristoffer Dalby d9e7f37280 Uncomment previous test and update them for no boundries 2022-02-25 10:27:27 +01:00
Kristoffer Dalby e03b3d558f Remove boundries between namespaces 2022-02-25 10:26:34 +01:00
Kristoffer Dalby 2fd36dd254 Resolve merge 2022-02-25 09:08:15 +00:00
Kristoffer Dalby 381598663d Merge pull request #347 from kradalby/remove-shared
Remove the concept of "shared nodes"
2022-02-25 10:06:58 +01:00
Kristoffer Dalby 6d699d3c29 Update changelog 2022-02-25 08:44:16 +00:00
Kristoffer Dalby ebe59a5a27 Fix utils tests, use ipset datastructure 2022-02-25 08:28:22 +00:00
Nico d55c79e75b Merge branch 'main' into metrics-listen 2022-02-24 10:41:07 -03:00
Kristoffer Dalby eda0a9f88a Lock allocation of IP address
current logic is not safe as it will allow an IP that isnt persisted to
the DB to be given out multiple times if machines joins in quick
succession.

This adds a lock around the "get ip" and machine registration and save
to DB so we ensure thiis isnt happning.

Currently this had to be done three places, which is silly, and outlined
in #294.
2022-02-24 13:18:18 +00:00
Adrien Raffin-Caboisse 47e8442d91 Update CHANGELOG.md
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2022-02-24 13:34:48 +01:00
Adrien Raffin-Caboisse f9ce32fe1a Update CHANGELOG.md
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2022-02-24 13:34:36 +01:00
Kristoffer Dalby 189e883f91 Resolve merge 2022-02-24 11:41:54 +00:00
Kristoffer Dalby aa506503e2 Merge branch 'main' into feat-oidc-login-as-namespace 2022-02-24 11:40:34 +00:00
Kristoffer Dalby 9c2c09fce7 Merge branch 'main' into remove-shared 2022-02-24 11:39:44 +00:00
Kristoffer Dalby 5596a0acef Merge pull request #297 from arch4ngel/configurable-mtls
Configurable mtls
2022-02-24 11:32:02 +00:00
Kristoffer Dalby 9687e6768d Remove retry from integration tests 2022-02-24 11:29:53 +00:00
Kristoffer Dalby fb85c78e8a Fail integration tests fast 2022-02-24 11:28:34 +00:00
Kristoffer Dalby d27f2bc538 Merge branch 'main' into metrics-listen 2022-02-24 11:16:57 +00:00
Kristoffer Dalby 8c33907655 Sort lint 2022-02-24 11:10:40 +00:00
Kristoffer Dalby afb67b6e75 Merge branch 'main' into configurable-mtls 2022-02-24 11:09:05 +00:00
Kristoffer Dalby 69f220fe5c Merge branch 'main' into feat-oidc-login-as-namespace 2022-02-24 11:01:32 +00:00
Kristoffer Dalby c46dfd761c Merge pull request #349 from kradalby/remove-cgo 2022-02-24 10:11:15 +00:00
Adrien Raffin-Caboisse 95453cba75 Merge branch 'main' into feat-oidc-login-as-namespace 2022-02-23 17:56:45 +01:00
Kristoffer Dalby ed2175706c Merge branch 'remove-cgo' of github.com:kradalby/headscale into remove-cgo 2022-02-23 16:23:53 +00:00
Kristoffer Dalby 686e45cf27 Set all anti-cgo options and add comment 2022-02-23 16:15:20 +00:00
Adrien Raffin-Caboisse ae6a20e4d9 fix: add valid test identified by linter 2022-02-23 14:28:25 +01:00
Adrien Raffin-Caboisse 046116656b chore: update formatting 2022-02-23 14:22:21 +01:00
Adrien Raffin-Caboisse 972bef1194 feat: add length error if hostname too long 2022-02-23 14:21:46 +01:00
Adrien Raffin-Caboisse 4f1f235a2e feat: add strip_email_domain to normalization of namespace 2022-02-23 14:03:07 +01:00
Adrien Raffin-Caboisse 7e4709c13f fix(namespace): remove name validation for destroy and get 2022-02-23 13:35:57 +01:00
Adrien Raffin-Caboisse cef0a2b0b3 fix(namespaces_test): fix missing namespace name 2022-02-23 11:40:48 +01:00
Adrien Raffin-Caboisse fcdbe7c510 fix(utils_test): fix namespace name 2022-02-23 11:38:20 +01:00
Adrien Raffin-Caboisse 995731a29c fix(namespace): checknamespace name before actions
I keep the check server side because it's better from a security point of view.
2022-02-23 11:32:16 +01:00
Adrien Raffin-Caboisse 45727dbb21 feat(namespace): add check function for namespace 2022-02-23 11:32:14 +01:00
Kristoffer Dalby f0a73632e0 Merge branch 'main' into remove-cgo 2022-02-23 09:01:38 +00:00
Kristoffer Dalby 823cc493f0 Merge branch 'main' into configurable-mtls 2022-02-23 07:29:31 +00:00
Juan Font a86b33f1ff Merge pull request #345 from juanfont/update-contributors
docs(README): update contributors
2022-02-22 23:46:54 +01:00
Juan Font 28c2bbeb27 Merge branch 'main' into update-contributors 2022-02-22 23:35:34 +01:00
github-actions[bot] d4761da27c docs(README): update contributors 2022-02-22 22:34:27 +00:00
Juan Font b0c7ebeb7d Merge pull request #351 from pernila/patch-1
Added FreeBSD to the supported clients
2022-02-22 23:33:58 +01:00
Juan Font 5f375d69b5 Merge branch 'main' into update-contributors 2022-02-22 23:32:02 +01:00
Juan Font 9eb705a4fb Merge branch 'main' into patch-1 2022-02-22 23:31:29 +01:00
Juan Font 1b87396a8c Merge pull request #333 from ohdearaugustin/topic/renovatebot
Topic/renovatebot
2022-02-22 23:30:46 +01:00
Juan Font bb14bcd4d2 Merge branch 'main' into topic/renovatebot 2022-02-22 23:29:08 +01:00
pernila 48c866b058 Added FreeBSD to the supported clients
Added FreeBSD to the supported clients
Now in ports: https://www.freshports.org/security/headscale/
2022-02-22 23:06:35 +02:00
Adrien Raffin-Caboisse fe0b43eaaf chore: update changelog 2022-02-22 21:20:59 +01:00
Adrien Raffin-Caboisse afd4a3706e chore: update formating 2022-02-22 21:05:39 +01:00
Adrien Raffin-Caboisse 717250adb3 feat: removing matchmap from headscale 2022-02-22 20:58:08 +01:00
Kristoffer Dalby 67f5c32b49 Only allow one connection to sqlite 2022-02-22 19:04:52 +00:00
Adrien Raffin-Caboisse 0191ea93ff feat(oidc): bind email to namespace 2022-02-22 19:59:15 +01:00
Adrien Raffin-Caboisse 92ffac625e feat(namespace): add normalization function for namespace 2022-02-22 19:59:12 +01: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 638a84adb9 Merge branch 'main' into integration-test-concurrent-join 2022-02-22 16:49:32 +00:00
Kristoffer Dalby ec58979ce0 Merge branch 'main' into remove-shared 2022-02-22 16:48:14 +00:00
Kristoffer Dalby 7e6e093f17 Merge branch 'integration-test-concurrent-join' of github.com:kradalby/headscale into integration-test-concurrent-join 2022-02-22 16:19:28 +00:00
Kristoffer Dalby 4962335860 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:18:25 +00:00
Kristoffer Dalby a37339fa54 Merge pull request #348 from restanrm/remove-comment
fix(machine): remove comment
2022-02-22 14:06:12 +00:00
Kristoffer Dalby f7eeb979fb Add timeout 2022-02-22 13:46:59 +00:00
Adrien Raffin-Caboisse f2f8d834e8 fix(machine): remove comment
After some more tests in tailscale I couldn't replicate the behavior
described in there.

When adding a rule, allowing A to talk to B the reverse connection was
instantly added to B to allow communication to B.

The previous assumption was probably wrong.
2022-02-22 11:26:21 +01:00
Kristoffer Dalby fe2f75d13d Allow integration test to retry 2022-02-22 07:40:56 +00:00
Kristoffer Dalby 52db6188df Merge branch 'main' into update-contributors 2022-02-21 23:38:56 +00:00
Kristoffer Dalby 8dca40535f Test if we can join headscale in parallell to speed up 2022-02-21 23:16:39 +00:00
Kristoffer Dalby f4c302f1fb Uncomment tests that will failed in transition period 2022-02-21 23:10:20 +00:00
Kristoffer Dalby 4ca8181dcb Remove sharing from integration tests 2022-02-21 23:04:10 +00:00
Kristoffer Dalby 24a8e198a1 Remove sharing references across the code 2022-02-21 23:01:35 +00:00
Kristoffer Dalby 9411ec47c3 Remove sharing class and tests 2022-02-21 22:53:30 +00:00
Kristoffer Dalby 1e8f4dbdff Drop shared node table 2022-02-21 22:52:55 +00:00
Kristoffer Dalby 9399754489 Remove protobuf share/unshare generated go 2022-02-21 22:48:27 +00:00
Kristoffer Dalby 9d1752acbc Remove protobuf share/unshare 2022-02-21 22:48:14 +00:00
Kristoffer Dalby 6da2a19d10 Remove grpc share/unshare functions 2022-02-21 22:45:04 +00:00
Kristoffer Dalby 9ceac5c0fc Remove CLI and tests for Shared node 2022-02-21 22:44:08 +00:00
Kristoffer Dalby f562ad579a Merge branch 'main' into configurable-mtls 2022-02-21 21:44:49 +00:00
github-actions[bot] bbadeb567a docs(README): update contributors 2022-02-21 21:41:48 +00:00
Kristoffer Dalby 69cdfbb56f Merge pull request #320 from restanrm/feat-improve-acls-usage
Improvements on the ACLs and bug fixing
2022-02-21 21:41:15 +00:00
Adrien Raffin-Caboisse d971f0f0e6 fix(acls_test): fix comment in go code 2022-02-21 21:48:05 +01:00
Adrien Raffin-Caboisse 650108c7c7 chore(fmt): apply fmt 2022-02-21 21:46:40 +01:00
Adrien Raffin-Caboisse baae266db0 Update acls_test.go
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2022-02-21 20:25:41 +01:00
Adrien Raffin-Caboisse 50af44bc2f fix: add error checking in acl and poll
If aclPolicy is not defined, in updateAclPolicy, return an error.
2022-02-21 20:06:31 +01:00
Nico Rey e3bcc88880 Linter: make linter happy 2022-02-21 15:22:36 -03:00
Nico Rey 14e49885fb metrics/kustomize: update Kustomize examples 2022-02-21 12:51:25 -03:00
Nico Rey fbc1843889 metrics/tests: update tests 2022-02-21 12:51:05 -03:00
Nico Rey 45d5ab30ff metrics/cfg: add a new entry for the Prometheus listen address 2022-02-21 12:50:44 -03:00
Nico Rey d5fd7a5c00 metrics: add a new router and listener for Prometheus' metrics endpoint 2022-02-21 12:50:15 -03:00
Justin Angel b5a59d4e7a updating changelog and docs 2022-02-21 10:20:11 -05:00
Adrien Raffin-Caboisse 211fe4034a chore(linter): ignore tt var as it's generated code (vscode) 2022-02-21 16:10:20 +01:00
Justin Angel daa75da277 Linting and updating tests 2022-02-21 10:09:23 -05:00
Adrien Raffin-Caboisse 25550f8866 chore(format): run prettier on repo 2022-02-21 16:06:20 +01:00
Adrien Raffin-Caboisse 4bbe0051f6 chore(machines): apply lint 2022-02-21 10:02:59 +01:00
Adrien Raffin-Caboisse 5ab62378ae tests(machines): test all combinations of peer filtering 2022-02-21 09:58:19 +01:00
Adrien Raffin-Caboisse f006860136 feat(machines): untie dependency with class for filter func
The dependency to the `headscale` struct makes tests harder to do.

This change allow to easily add some tests for this quite sensible function.
2022-02-21 09:58:19 +01:00
Adrien Raffin-Caboisse 9c6ce02554 fix(machines): use ListAllMachines function
added a simple filter to remove the current node
2022-02-21 09:58:19 +01:00
Adrien Raffin-Caboisse 960412a335 fix(machines): simplify complex if check
This should fix the performance issue with computation of `dst` variable. It's also easier to read now.
2022-02-21 09:58:19 +01:00
Kristoffer Dalby ecb3ee6bfa Merge branch 'main' into feat-improve-acls-usage 2022-02-21 08:51:21 +00:00
Adrien Raffin-Caboisse 5242025ab3 fix(machines): renaming following review comments 2022-02-20 23:50:08 +01:00
Adrien Raffin-Caboisse b3d0fb7a93 fix(machine): revert modifications
Using h.ListAllMachines also listed the current machine in the result. It's unnecessary (I don't know if it's harmful).

Breaking the check with the `matchSourceAndDestinationWithRule` broke the tests. We have a specificity with the '*' destination that isn't symetrical.
I need to think of a better way to do this. It too hard to read.
2022-02-20 23:47:04 +01:00
Adrien Raffin-Caboisse 5e167cc00a fix(tests): fix naming issues related to code review 2022-02-20 23:00:31 +01:00
Adrien Raffin-Caboisse d00251c63e fix(acls,machines): apply code review suggestions 2022-02-20 21:26:20 +01:00
Adrien Raffin-Caboisse 4f9ece14c5 Apply suggestions from code review on changelog
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2022-02-20 20:47:12 +01:00
Kristoffer Dalby 7bf2a91dd0 Merge branch 'main' into configurable-mtls 2022-02-20 14:33:23 +00:00
Justin Angel 385dd9cc34 refactoring 2022-02-20 09:06:14 -05:00
Kristoffer Dalby 602291df61 Merge pull request #338 from juanfont/update-contributors 2022-02-19 23:13:08 +00:00
github-actions[bot] 5245f1accc docs(README): update contributors 2022-02-19 22:48:26 +00:00
Kristoffer Dalby 91babb5130 Merge pull request #336 from ohdearaugustin/topic/fix-contributors-action 2022-02-19 21:08:53 +00:00
ohdearaugustin 8798efd353 contributor: set specific version 2022-02-19 21:36:08 +01:00
Kristoffer Dalby 66a12004e7 Merge branch 'main' into topic/renovatebot 2022-02-19 19:34:30 +00:00
Kristoffer Dalby 74621e2750 Merge pull request #332 from e-zk/main
Fix spelling error
2022-02-19 19:34:24 +00:00
Kristoffer Dalby 74c3c6bb60 Merge branch 'main' into main 2022-02-19 19:32:34 +00:00
Kristoffer Dalby 84b98e716a Merge pull request #334 from ohdearaugustin/topic/renovatebot-codeowner
CODEOWNER: add renovate config ohdearaugustin
2022-02-19 19:32:21 +00:00
ohdearaugustin e9f13b6031 CODEOWNER: add renovate config ohdearaugustin 2022-02-19 20:28:08 +01:00
ohdearaugustin fe6d47030f renovatebot: configure 2022-02-19 20:15:53 +01:00
ohdearaugustin a19550adbf prettier: renovatebot.yml 2022-02-19 19:49:12 +01:00
ohdearaugustin 3db88d27de github/workflows: init renovatebot 2022-02-19 19:49:12 +01:00
e-zk a6b7bc5939 Fix spelling error 2022-02-20 03:14:51 +10:00
Kristoffer Dalby 397b6fc4bf Merge branch 'main' into docs-acl-modifications 2022-02-18 20:13:10 +00:00
Kristoffer Dalby 7d5e6d3f0f Merge pull request #330 from kradalby/codeowners
Add ohdearaugustin to CODEOWNERS for config and docs
2022-02-18 20:12:29 +00:00
Kristoffer Dalby 7a90c2fba1 Merge branch 'main' into codeowners 2022-02-18 20:11:33 +00:00
Kristoffer Dalby 5cf215a44b Merge pull request #325 from juanfont/kradalby-patch-4
Update changelog for 0.13.0
2022-02-18 20:11:03 +00:00
Kristoffer Dalby 7916fa8b45 Add ohdearaugustin to CODEOWNERS for config and docs 2022-02-18 19:57:03 +00:00
Kristoffer Dalby 5fbef07627 Update changelog for 0.13.0 2022-02-18 18:54:27 +00:00
Kristoffer Dalby 21df798f07 Merge branch 'main' into feat-improve-acls-usage 2022-02-18 17:19:19 +00:00
Kristoffer Dalby 67bb1fc9dd Merge pull request #324 from m-tanner-dev0/patch-1 2022-02-18 07:18:22 +00:00
Tanner 61bfa79be2 Update README.md
change flippant language
2022-02-17 17:55:40 -08:00
Adrien Raffin-Caboisse f073d8f43c chore(lint): ignore linting on test_expandalias
This is a false positive on the way the function is built.
Small tests cases are all inside this functions, making it big.
2022-02-17 09:32:55 +01:00
Adrien Raffin-Caboisse 5f642eef76 chore(lint): more lint fixing 2022-02-17 09:32:54 +01:00
Adrien Raffin-Caboisse d8c4c3163b chore(fmt): apply make fmt command 2022-02-17 09:32:54 +01:00
Adrien Raffin-Caboisse 9cedbbafd4 chore(all): update some files for linter 2022-02-17 09:32:51 +01:00
Adrien Raffin-Caboisse aceaba60f1 docs(changelog): bump changelog 2022-02-17 09:30:09 +01:00
Adrien Raffin-Caboisse 7b5ba9f781 docs(acl): add configuration example to explain acls 2022-02-17 09:30:09 +01:00
Adrien Raffin de59946447 feat(acls): rewrite functions to be testable
Rewrite some function to get rid of the dependency on Headscale object. This allows us
to write succinct test that are more easy to review and implement.

The improvements of the tests allowed to write the removal of the tagged hosts
from the namespace as specified here: https://tailscale.com/kb/1068/acl-tags/
2022-02-17 09:30:09 +01:00
Adrien Raffin 97eac3b938 feat(acl): update frequently the aclRules
This call should be done quite at each modification of a server resources like RequestTags.
When a server changes it's tag we should rebuild the ACL rules.

When a server is added to headscale we also should update the ACLRules.
2022-02-17 09:30:08 +01:00
Adrien Raffin fb45138fc1 feat(acls): check acl owners and add bunch of tests 2022-02-17 09:30:08 +01:00
Adrien Raffin e9949b4c70 feat(acls): simplify updating rules 2022-02-17 09:30:08 +01:00
Adrien Raffin e482dfeed4 feat(machine): add ACLFilter if ACL's are enabled.
This commit change the default behaviour and remove the notion of namespaces between the hosts. It allows all namespaces to be only filtered by the ACLs. This behavior is closer to tailsnet.
2022-02-17 09:30:05 +01:00
Jamie Greeff 9b7d657cbe Return all peers instead of peers in same namespace 2022-02-17 09:27:59 +01:00
Adrien Raffin-Caboisse 55d746d3f5 docs(acls-proposal): wording comment
A hidden thing was implied in this document is that each person should have his own namespace.
Hidden information in spicification isn't good.
Thank's @kradalby for pointing it out.
2022-02-16 09:16:25 +01:00
Kristoffer Dalby 73497382b7 Merge pull request #306 from kradalby/apiwork
Introduce API keys and enable remote control API
2022-02-15 22:23:32 +00:00
Adrien Raffin-Caboisse c364c2a382 chore(acl-proposals): apply prettier 2022-02-15 09:53:22 +01:00
Adrien Raffin-Caboisse e540679dbd docs(acl-proposals): integrate comments 2022-02-15 09:52:05 +01:00
Adrien Raffin-Caboisse 86b329d8bf chore(docs): create proposals directory 2022-02-15 09:27:33 +01:00
Kristoffer Dalby b2b2954545 Merge branch 'main' into apiwork 2022-02-14 22:29:20 +00:00
Kristoffer Dalby a3360b082f Merge pull request #321 from ohdearaugustin/topic/specific-go-version 2022-02-14 22:03:17 +00:00
Kristoffer Dalby b721502147 Merge branch 'main' into topic/specific-go-version 2022-02-14 20:51:33 +00:00
Kristoffer Dalby 1869bff4ba Merge pull request #316 from kradalby/kv-worker-cleanup 2022-02-14 20:51:00 +00:00
ohdearaugustin 0b9dd19ec7 Dockerfiles: update go version to 1.17.7 2022-02-14 21:32:20 +01:00
ohdearaugustin b2889bc355 github/workflows: set specific go version 2022-02-14 21:31:49 +01:00
Kristoffer Dalby 28c824acaf Merge branch 'main' into apiwork 2022-02-14 16:17:34 +00:00
Kristoffer Dalby 57f1da6dca Merge branch 'main' into kv-worker-cleanup 2022-02-14 11:35:15 +00:00
Kristoffer Dalby c9640b2f3e Merge pull request #317 from kradalby/sponsor 2022-02-14 11:34:56 +00:00
Kristoffer Dalby 546b1e8a05 Merge branch 'main' into kv-worker-cleanup 2022-02-14 10:17:03 +00:00
Kristoffer Dalby 3b54a68f5c Merge branch 'main' into sponsor 2022-02-14 10:16:58 +00:00
Kristoffer Dalby 1b1aac18d2 Merge pull request #315 from kradalby/windows-client-docs2 2022-02-14 10:16:25 +00:00
Kristoffer Dalby f30ee3d2df Add note about support in readme 2022-02-13 11:07:45 +00:00
Kristoffer Dalby 9f80349471 Add sponsorship button
This commit adds a sponsor/funding section to headscale.

@juanfont and I have discussed this and this arrangement is agreed upon
and hopefully this can bring us to a place in the future were even more
features and prioritization can be put upon the project.
2022-02-13 11:02:31 +00:00
Kristoffer Dalby 14b23544e4 Add note about running grpc behind a proxy and combining ports 2022-02-13 09:48:33 +00:00
Kristoffer Dalby 4e54796384 Allow gRPC server to run insecure 2022-02-13 09:08:46 +00:00
Kristoffer Dalby c3b68adfed Fix lint 2022-02-13 08:46:35 +00:00
Kristoffer Dalby 0018a78d5a Add insecure option
Add option to not _validate_ if the certificate served from headscale is
trusted.
2022-02-13 08:41:49 +00:00
Kristoffer Dalby 50f0270543 Merge branch 'main' into windows-client-docs2 2022-02-12 22:35:23 +00:00
Kristoffer Dalby bb80b679bc Remove RequestMapUpdates function 2022-02-12 21:04:00 +00:00
Kristoffer Dalby 6fa0903a8e Update changelog 2022-02-12 20:50:17 +00:00
Kristoffer Dalby 2bc8051ae5 Remove kv-namespace-worker
This commit removes the namespace kv worker and related code, now that
we talk over gRPC to the server, and not directly to the DB, we should
not need this anymore.
2022-02-12 20:46:05 +00:00
Kristoffer Dalby 4841e16386 Add remote control doc 2022-02-12 20:39:42 +00:00
Kristoffer Dalby d79ccfc05a Add comment on why grpc is on its own port, replace deprecated 2022-02-12 19:50:12 +00:00
Kristoffer Dalby ead8b68a03 Fix lint 2022-02-12 19:42:55 +00:00
Kristoffer Dalby 3bb4c28c9a Merge branch 'main' into apiwork 2022-02-12 19:39:30 +00:00
Kristoffer Dalby 2fbcc38f8f Emph trusted cert 2022-02-12 19:36:43 +00:00
Kristoffer Dalby 315ff9daf0 Remove insecure, only allow valid certs 2022-02-12 19:35:55 +00:00
Kristoffer Dalby 4078e75b50 Correct log message 2022-02-12 19:30:25 +00:00
Kristoffer Dalby 58bfea4e64 Update examples and docs 2022-02-12 19:08:59 +00:00
Kristoffer Dalby e18078d7f8 Rename j 2022-02-12 19:08:41 +00:00
Kristoffer Dalby c73b57e7dc Use undeprecated method for insecure 2022-02-12 19:08:33 +00:00
Kristoffer Dalby 531298fa59 Fix import 2022-02-12 17:13:51 +00:00
Kristoffer Dalby 30a2ccd975 Add tls certs as creds for grpc 2022-02-12 17:05:30 +00:00
Kristoffer Dalby 59e48993f2 Change the http listener 2022-02-12 16:33:18 +00:00
Kristoffer Dalby bfc6f6e0eb Split grpc and http 2022-02-12 16:15:26 +00:00
Kristoffer Dalby 811d3d510c Add grpc_listen_addr config option 2022-02-12 16:14:33 +00:00
Kristoffer Dalby 2aba37d2ef Try to support plaintext http2 after termination 2022-02-12 14:42:23 +00:00
Kristoffer Dalby 8853ccd5b4 Terminate tls immediatly, mux after 2022-02-12 13:25:27 +00:00
Kristoffer Dalby c794f32f58 Merge pull request #312 from hdhoang/patch-1 2022-02-12 12:27:57 +00:00
Kristoffer Dalby dd8bae8c61 Add link from the docs readme 2022-02-11 18:39:41 +00:00
Kristoffer Dalby 1b47ddd583 Improve the windows client docs as per discord recommendations 2022-02-11 18:36:53 +00:00
Hoàng Đức Hiếu 20991d6883 Merge branch 'main' into patch-1 2022-02-11 17:56:46 +07:00
Kristoffer Dalby 96f09e3f30 Merge pull request #313 from kradalby/windows-client-docs 2022-02-11 09:34:11 +00:00
Kristoffer Dalby 8f40696f35 Merge branch 'main' into windows-client-docs 2022-02-11 09:32:49 +00:00
Kristoffer Dalby c1845477ef Merge pull request #314 from kradalby/tailscale-204 2022-02-11 09:32:24 +00:00
Kristoffer Dalby 1d40de3095 Update changelog 2022-02-11 08:45:02 +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 d9aaa0bdfc Add docs on how to set up Windows clients 2022-02-11 08:26:22 +00:00
Hoàng Đức Hiếu 66ff34c2dd apply changelog 2022-02-11 13:49:09 +07:00
Hoàng Đức Hiếu 150652e939 poll: fix swapped machine<->namespace labels 2022-02-11 13:46:36 +07:00
Adrien Raffin-Caboisse 7bdd7748e4 fix(acl): add missing internal namespace communications 2022-02-10 12:03:03 +01:00
Adrien Raffin-Caboisse 0426212348 docs(acls): add example use case 2022-02-10 10:42:26 +01:00
Adrien Raffin-Caboisse 85cf443ac6 docs(acls): Issues with ACL and proposition 2022-02-08 16:59:35 +01:00
Justin Angel 1b2fff4337 Merge branch 'main' into configurable-mtls 2022-02-02 11:54:49 -05:00
Kristoffer Dalby 8c79165b0d Merge pull request #305 from lachy-2849/main 2022-02-02 08:09:06 +00:00
lachy-2849 7b607b3fe8 Forgot to run Prettier 2022-02-01 19:32:13 -05:00
lachy-2849 41fbe47cdf Note when running as another user in systemd
Headscale commands fail when running them as the current user instead of the user defined in the systemd file. This note provides 2 methods of how to correctly run the headscale commands.
2022-02-01 14:23:18 -05:00
Justin Angel af25aa75d9 Merge branch 'configurable-mtls' of github.com:arch4ngel/headscale into configurable-mtls 2022-01-31 10:27:57 -05:00
Justin Angel da5250ea32 linting again 2022-01-31 10:27:43 -05:00
Kristoffer Dalby 168b1bd579 Merge branch 'main' into configurable-mtls 2022-01-31 12:28:00 +00:00
Justin Angel 9de5c7f8b8 updating default 2022-01-31 07:22:17 -05:00
Justin Angel 52db80ab0d Merge branch 'configurable-mtls' of github.com:arch4ngel/headscale into configurable-mtls 2022-01-31 07:19:14 -05:00
Justin Angel 0c3fd16113 refining and adding tests 2022-01-31 07:18:50 -05:00
Kristoffer Dalby e05c5e0b93 Merge pull request #303 from kradalby/migrate_ipaddresses 2022-01-31 08:57:22 +00:00
Justin Angel 310e7b15c7 making alternatives constants 2022-01-30 10:46:57 -05:00
Kristoffer Dalby 9e3318ca27 Simplify postgres uuid-ossp stirng 2022-01-30 14:53:40 +00:00
Kristoffer Dalby e9adfcd678 Migrate ip_address field to ip_addresses
The automatic migration did not pick up this change and it breaks
current setups as it only adds a new field which is empty.

This means that clients who dont request a new IP will not have any IP
at all.
2022-01-30 14:18:24 +00:00
Justin Angel d44b2a7c01 adding default for tls_client_auth_mode 2022-01-30 07:26:28 -05:00
Kristoffer Dalby 5b5ecd52e1 Merge pull request #208 from enoperm/ipv6
Support for IPv6 prefixes in namespaces
2022-01-30 10:46:20 +00:00
Kristoffer Dalby eddd62eee0 Merge branch 'main' into ipv6 2022-01-30 10:09:52 +00:00
Kristoffer Dalby 38c27f6bf8 Merge pull request #300 from stensonb/patch-2
Typo
2022-01-30 10:09:35 +00:00
Kristoffer Dalby 90fb9aa4ed Merge branch 'main' into ipv6 2022-01-30 10:08:44 +00:00
Kristoffer Dalby 3af1253a65 Merge branch 'main' into patch-2 2022-01-30 10:08:28 +00:00
Kristoffer Dalby eb1ce64b7c Merge pull request #301 from kradalby/goreleaser
Set goreleaser to only care about Go 1.17
2022-01-30 10:08:04 +00:00
Kristoffer Dalby 2c9ed63021 Merge branch 'main' into goreleaser 2022-01-30 10:07:35 +00:00
Kristoffer Dalby 4c779d306b Merge pull request #302 from kradalby/build-avoidance
Set up build avoidance
2022-01-30 10:07:30 +00:00
Kristoffer Dalby 0862f60ff0 Put depth in the correct place 2022-01-30 09:54:26 +00:00
Kristoffer Dalby 991175f2aa Add depth and avoidance for build 2022-01-30 09:49:15 +00:00
Kristoffer Dalby 1815040d98 Set up build build avoidance
This commit configures the CI to run specific parts of the CI when
relevant changes has been made.

This should help us not have to deal with the integration tests when we
do doc/admin changes.
2022-01-30 09:43:48 +00:00
Kristoffer Dalby 71ab4c9b2c Fix type according to config schema 2022-01-30 08:59:25 +00:00
Kristoffer Dalby e0c22a414b Remove wrong comment 2022-01-30 08:56:28 +00:00
Kristoffer Dalby 4e63bba4fe Only compat go 1.17 in go mod tidy 2022-01-30 08:55:41 +00:00
Kristoffer Dalby 445c04baf7 Fix lint 2022-01-30 08:35:10 +00:00
Kristoffer Dalby ad4e3a89e0 Format changelog 2022-01-30 08:25:49 +00:00
Kristoffer Dalby 6f6018bad5 Merge branch 'main' into ipv6 2022-01-30 08:21:11 +00:00
Bryan Stenson ccd41b9a13 Typo 2022-01-29 22:34:51 -08:00
Juan Font d8ce440309 Merge pull request #299 from kradalby/0124prep
Tag 0.12.4 in CHANGELOG
2022-01-30 01:13:10 +01:00
Kristoffer Dalby 0609c97459 Merge branch 'main' into configurable-mtls 2022-01-29 20:15:58 +00:00
Kristoffer Dalby 2f576b2fb1 Tag 0.12.4 in CHANGELOG 2022-01-29 20:04:56 +00:00
Kristoffer Dalby 853a5288f1 Merge pull request #292 from kradalby/socket-permission
Make Unix socket permissions configurable
2022-01-29 19:55:11 +00:00
Kristoffer Dalby cd0df1e46f Merge branch 'main' into socket-permission 2022-01-29 19:30:49 +00:00
Juan Font b195c87418 Merge pull request #290 from kradalby/generate-privkey
Add generate private-key command
2022-01-29 20:24:52 +01:00
Justin Angel c98a559b4d linting/formatting 2022-01-29 14:15:33 -05:00
Justin Angel 5935b13b67 refining 2022-01-29 13:35:08 -05:00
Justin Angel 9e619fc020 Making client authentication mode configurable 2022-01-29 12:59:31 -05:00
Csaba Sarkadi 45bcf39894 fixup! fixup! cmd/headscale/cli/utils: merge ip_prefix with ip_prefixes in config 2022-01-29 16:52:27 +01:00
Csaba Sarkadi 0a1db89d33 fixup! cmd/headscale/cli/utils: merge ip_prefix with ip_prefixes in config 2022-01-29 16:27:36 +01:00
Kristoffer Dalby dbfb9e16e0 Merge branch 'main' into socket-permission 2022-01-29 15:26:19 +00:00
Kristoffer Dalby 8aa2606853 Merge branch 'main' into generate-privkey 2022-01-29 15:26:15 +00:00
Kristoffer Dalby a238a8b33a Merge pull request #291 from kradalby/tailscale-203
Upgrade to latest tailscale
2022-01-29 15:26:06 +00:00
Csaba Sarkadi 74f26d3685 fixup! CHANGELOG: document breaking configuration change regarding multiple prefixes 2022-01-29 16:08:02 +01:00
Csaba Sarkadi e66f8b0eeb cmd/headscale/cli/utils: merge ip_prefix with ip_prefixes in config 2022-01-29 16:04:15 +01:00
Kristoffer Dalby e7b69dbf91 Merge branch 'main' into generate-privkey 2022-01-29 14:35:24 +00:00
Kristoffer Dalby 13f23d2e7e Merge branch 'main' into socket-permission 2022-01-29 14:34:36 +00:00
Csaba Sarkadi 7a86321252 CHANGELOG: document breaking configuration change regarding multiple prefixes 2022-01-29 15:33:54 +01:00
Kristoffer Dalby 7aace7eb6b Update CHANGELOG.md 2022-01-29 14:33:12 +00:00
Kristoffer Dalby 7a6be36f46 Merge branch 'main' into tailscale-203 2022-01-29 14:32:04 +00:00
Kristoffer Dalby bb27c80bad Update CHANGELOG.md 2022-01-29 14:31:42 +00:00
Csaba Sarkadi c0c3b7d511 Merge remote-tracking branch 'origin/main' into ipv6 2022-01-29 15:27:49 +01:00
Csaba Sarkadi 6220836050 utils: extract GetIPPrefixEndpoints from anonymous function 2022-01-29 15:26:28 +01:00
Kristoffer Dalby b122d06f12 Merge pull request #278 from enoperm/pollnetmap-update-only 2022-01-29 13:46:08 +00:00
Kristoffer Dalby 6f9ed958ca Merge branch 'main' into pollnetmap-update-only 2022-01-29 13:12:09 +00:00
Kristoffer Dalby 39ce59fcb1 Merge branch 'main' into generate-privkey 2022-01-29 13:11:26 +00:00
Kristoffer Dalby 052fccdc98 Merge pull request #289 from juanfont/whitespace 2022-01-29 13:09:16 +00:00
Csaba Sarkadi 17411b65f3 fixup! fixup! update CHANGELOG
prettier changes
2022-01-29 13:48:14 +01:00
Csaba Sarkadi bf7ee78324 config-example: add configuration for a dual-stack tailnet 2022-01-28 22:13:45 +01:00
Csaba Sarkadi fbe5054a67 fixup! update CHANGELOG 2022-01-28 22:00:13 +01:00
Csaba Sarkadi 761147ea3b update CHANGELOG 2022-01-28 21:59:08 +01:00
Csaba Sarkadi 25ccf5ef18 PollNetMapStream: do not create any rows during long-poll operation 2022-01-28 21:59:08 +01:00
Kristoffer Dalby b4f8961e44 Make Unix socket permissions configurable 2022-01-28 18:58:22 +00:00
Kristoffer Dalby 726ccc8c1f Upgrade to latest tailscale 2022-01-28 18:15:41 +00:00
Kristoffer Dalby 126e694f26 Add generate private-key command
This commit adds a command to generate a private key for headscale.

Mostly useful for systems were you drive the deployment from another
machine and use a secret management system.
2022-01-28 18:08:52 +00:00
Kristoffer Dalby ab45cd37f8 Only golint new problems 2022-01-28 17:40:39 +00:00
Kristoffer Dalby f59071ff1c Trim whitespace from privateKey before parsing 2022-01-28 17:23:01 +00:00
Kristoffer Dalby 537cd35cb2 Try to add the grpc cert correctly 2022-01-25 22:22:15 +00:00
Kristoffer Dalby 56b6528e3b Run prettier 2022-01-25 22:11:15 +00:00
Kristoffer Dalby bae7ba46de Update changelog 2022-01-25 22:11:15 +00:00
Kristoffer Dalby fa197cc183 Add docs for remote access 2022-01-25 22:11:15 +00:00
Kristoffer Dalby 00c69ce50c Enable remote gRPC and HTTP API
This commit enables the existing gRPC and HTTP API from remote locations
as long as the user can provide a valid API key. This allows users to
control their headscale with the CLI from a workstation. 🎉
2022-01-25 22:11:15 +00:00
Kristoffer Dalby a6e22387fd Formatting of machine.go 2022-01-25 22:11:15 +00:00
Kristoffer Dalby a730f007d8 Formatting of DNS files 2022-01-25 22:11:15 +00:00
Kristoffer Dalby 3393363a67 Add safe random hash generators 2022-01-25 22:11:15 +00:00
Kristoffer Dalby 8218ef96ef Formatting of integration tests 2022-01-25 22:11:15 +00:00
Kristoffer Dalby e8e573de62 Add apikeys command integration test 2022-01-25 22:11:15 +00:00
Kristoffer Dalby 05db1b7109 Formatting and improving logs for config loading 2022-01-25 22:11:15 +00:00
Kristoffer Dalby 6e14fdf0d3 More reusable stuff in cli 2022-01-25 22:11:15 +00:00
Kristoffer Dalby 1fd57a3375 Add apikeys command to create, list and expire 2022-01-25 22:11:15 +00:00
Kristoffer Dalby b4259fcd79 Add helper function for colouring expiries 2022-01-25 22:11:15 +00:00
Kristoffer Dalby f9137f3bb0 Create helper functions around gRPC interface 2022-01-25 22:11:15 +00:00
Kristoffer Dalby b1a9b1ada1 Generate code from proto 2022-01-25 22:11:15 +00:00
Kristoffer Dalby b8e9024845 Add proto model for api key 2022-01-25 22:11:15 +00:00
Kristoffer Dalby 70d82ea184 Add migration for new data model 2022-01-25 22:11:05 +00:00
Kristoffer Dalby 9dc20580c7 Add api key data model and helpers
This commits introduces a new data model for holding api keys for the
API. The keys are stored in the database with a prefix and a hash and
bcrypt with 10 passes is used to store the hash and it is "one way
safe".

Api keys have an expiry logic similar to pre auth keys.

A key cannot be retrieved after it has created, only verified.
2022-01-25 22:11:05 +00:00
Kristoffer Dalby 4d60aeae18 Merge pull request #282 from ryanfowler/main 2022-01-23 21:23:50 +00:00
Ryan Fowler 67d1dd984f Fix missing return in PollNetMapHandler 2022-01-21 21:48:58 -08:00
Juan Font b02f8dd45d Merge pull request #274 from majst01/reduce-binary-size
Strip binary, update to go-1.17.6
2022-01-20 11:38:52 +01:00
Kristoffer Dalby 3837f1714a Merge branch 'main' into reduce-binary-size 2022-01-17 08:47:19 +00:00
Kristoffer Dalby ed5498ef86 Merge pull request #276 from jimt/patch-1 2022-01-17 08:46:42 +00:00
Csaba Sarkadi e2f8c69e2e integration-test: use tailscale ip to test dual-stack MagicDNS 2022-01-16 14:18:22 +01:00
Csaba Sarkadi beb3e9abc2 integration-test: taildrop test refactor 2022-01-16 14:18:22 +01:00
Csaba Sarkadi 78039f4cea integration-test: use TUN devices, enable IPv6 addresses on local interfaces in containers 2022-01-16 14:18:22 +01:00
Csaba Sarkadi ed39b91f71 Dockerfiles: specify origin registry explicitly 2022-01-16 14:18:22 +01:00
Csaba Sarkadi 8f632e9062 machine: isOutdated: handle machines without LastSuccefulUpdate set 2022-01-16 14:18:22 +01:00
Csaba Sarkadi a32175f791 PollNetMapHandler: refactor with chan lifetimes in mind
* Resolves an issue where sometimes attempted sends on a closed channel
  happened by ensuring the channels remain open for the entire goroutine.
* May be of help with regards to issue #203
2022-01-16 14:18:22 +01:00
Csaba Sarkadi d35fb8bba0 integration-test: add IPv6 prefix to configuration 2022-01-16 14:18:22 +01:00
Csaba Sarkadi 115d0cbe85 dns: IPv6 roots generation 2022-01-16 14:18:22 +01:00
Csaba Sarkadi 1a6e5d8770 Add support for multiple IP prefixes 2022-01-16 14:18:22 +01:00
Csaba Sarkadi 3a3aecb774 Regenerate files based on ProtoBuf schema. 2022-01-16 14:17:51 +01:00
Csaba Sarkadi 8b40343277 Add multiple IP prefixes support to ProtoBuf schema 2022-01-16 14:17:27 +01:00
Csaba Sarkadi 7ec8346179 Do not assume IPv4 during Tailscale node construction 2022-01-15 16:06:34 +01:00
Csaba Sarkadi 46cdce00af Do not assume IPv4 during address generation 2022-01-15 16:06:34 +01:00
Jim Tittsler 86f3f26a18 Fix typos 2022-01-15 16:44:36 +09:00
Stefan Majer febbb6006f use most recent go 1.17 for tests 2022-01-14 12:59:53 +01:00
Stefan Majer 1d68509463 Strip binary, update to go-1.17.6 2022-01-14 09:19:16 +01:00
Kristoffer Dalby b6d0c4f2aa Merge pull request #273 from juanfont/tailscale-1-20
Add new tailscale version to integration test
2022-01-13 22:21:27 +00:00
Kristoffer Dalby 2c057c2d89 Update integration_test.go 2022-01-13 19:16:12 +00:00
Juan Font cf7effda1b Merge pull request #272 from juanfont/cl-0.12.3
Prepare CHANGELOG for 0.12.3
2022-01-13 17:02:37 +01:00
Juan Font Alonso 19effe7034 Updated changelog for 0.12.3 2022-01-13 12:42:56 +01:00
Juan Font 41053482b3 Merge pull request #271 from juanfont/minor-security-fixes
Minor security updates in go.mod
2022-01-12 22:13:28 +01:00
Juan Font e463283a58 Merge branch 'main' into minor-security-fixes 2022-01-12 17:10:15 +01:00
Juan Font 99814b468b Merge pull request #270 from artemklevtsov/docker-alpine
Add docker alpine image
2022-01-12 17:10:05 +01:00
Juan Font Alonso 163ecb2a6b go.sum updated 2022-01-12 15:22:16 +01:00
Juan Font Alonso 4660b265d9 Minor security updates in go.mod 2022-01-12 15:17:55 +01:00
Artem Klevtsov 1b6bad0b63 Add docker alpine image 2022-01-12 19:29:59 +07:00
Juan Font 26623d794b Merge pull request #268 from juanfont/prepare-0.12.2
Prepare CHANGELOG for 0.12.2
2022-01-11 16:49:51 +01:00
Juan Font Alonso e9cc60e49c Updated changelog for 0.12.2 2022-01-11 15:45:13 +01:00
Juan Font be2a28dd61 Merge pull request #267 from piec/patch-1
Fix example config link
2022-01-11 15:39:55 +01:00
Pierre Carru cec236ce24 Fix example config link
Everything is in the title :p
2022-01-10 14:44:11 +01:00
Kristoffer Dalby 45d331da99 Merge pull request #263 from JJGadgets/patch-1 2022-01-06 10:40:04 +00:00
JJGadgets 897fa558b0 prettier: Docker docs 2022-01-06 17:25:07 +08:00
JJGadgets d971cf1295 Improve Docker docs
- Fix URLs referring to files in this repository
- Better explain that we are creating the headscale directory and running the commands on the host Docker node
- Place instructions to download example config file to use as config file, as recommended steps.
2022-01-06 14:10:28 +08:00
Kristoffer Dalby 42bed58329 Merge pull request #262 from kradalby/improve-docs
Rewrite main documentation
2022-01-04 16:26:27 +00:00
Kristoffer Dalby d9f52efe70 Fix typo 2022-01-02 23:17:48 +00:00
Kristoffer Dalby 25b5eb8d7f Update tests to aline with new config example 2022-01-02 23:17:42 +00:00
Kristoffer Dalby 81c60939c9 Add vertical line for breathing 2022-01-02 19:55:38 +00:00
Kristoffer Dalby 4edc96d14d Make strongly strong 2022-01-02 19:54:37 +00:00
Kristoffer Dalby 6b7c74133d Use markdown numbering so github gets it 2022-01-02 19:53:49 +00:00
Kristoffer Dalby 8da029bd14 Add missing links 2022-01-02 19:48:57 +00:00
Kristoffer Dalby 1d01103b67 Link to example config from docs 2022-01-02 19:43:06 +00:00
Kristoffer Dalby 5df100539c Remove outdated configuration page in favour of config-example 2022-01-02 19:42:35 +00:00
Kristoffer Dalby 11c86acbe3 update case in readme 2022-01-02 19:39:51 +00:00
Kristoffer Dalby 86f36f9a43 Lowercase markdown docs 2022-01-02 19:39:03 +00:00
Kristoffer Dalby 271cb71754 Add more explaination and less redunancy with docs 2022-01-02 19:38:04 +00:00
Kristoffer Dalby 80d196cbfd Remove DNS file, it will be merged into example configuration 2022-01-02 19:37:48 +00:00
Kristoffer Dalby 3ce3ccb559 Reorder tls docs 2022-01-02 19:36:50 +00:00
Kristoffer Dalby a11c6fd8b9 Fix formatting error in container doc 2022-01-02 20:08:18 +01:00
Kristoffer Dalby a75c5a4cff Add eradme to examples 2022-01-02 20:08:04 +01:00
Kristoffer Dalby 8d504c35bf Move kubernetes to kustomize, since thats what it is 2022-01-02 20:06:32 +01:00
Kristoffer Dalby 8a07a63b1c Write disclaimer in kubernetes example 2022-01-02 20:06:21 +01:00
Kristoffer Dalby 74fd5de43d Move kubernetes example under docs 2022-01-02 20:04:35 +01:00
Kristoffer Dalby f9e6722635 Rewrite main documentation
This commit starts restructuring the documentation and updating it to be
compliant with 0.12.x+ releases.

The main change is that the documentation has been rewritten for the
ground up, and hopefully simplified.

The documentation has been split into an official documentation for
running headscale as a binary under Linux with SystemD and a "community"
provided documentation for Docker.

This should make the two documents a lot easier to read and follow than
the mishmash document we had.
2022-01-02 19:11:36 +01:00
Juan Font 0bd4250a53 Merge pull request #261 from juanfont/kradalby-patch-2
Add note about outdated docs until we fix them
2021-12-29 10:53:15 +01:00
Kristoffer Dalby 4b44aa2180 Add note about outdated docs until we fix them 2021-12-28 10:16:20 +01:00
Kristoffer Dalby f78984f2ef Merge pull request #258 from ohdearaugustin/fix-docker-release
Fix docker release
2021-12-27 22:09:16 +01:00
ohdearaugustin 3de311b7f4 Fix docker release 2021-12-27 21:24:57 +01:00
Juan Font 5192841016 Merge pull request #256 from juanfont/prepare-0.12.1-cl
Prepare CHANGELOG for 0.12.1
2021-12-24 23:40:33 +01:00
Juan Font 07384fd2bb Leave the TDB 2021-12-24 16:46:04 +01:00
Juan Font a795e7c0c9 Minor correction on the purpose of Headscale 2021-12-24 16:40:18 +01:00
Juan Font ebfbd4a37d Update changelog for 0.12.1 2021-12-24 16:39:22 +01:00
Juan Font fb933b7d41 Merge pull request #255 from Wakeful-Cloud/main
Template Fixes
2021-12-24 16:12:33 +01:00
wakeful-cloud 1c7cb98042 Template Fixes 2021-12-22 19:43:53 -07:00
Kristoffer Dalby fb634cdfc2 Merge pull request #242 from kradalby/changelog 2021-12-07 14:16:34 +00:00
Kristoffer Dalby f60f62792a Merge branch 'main' into changelog 2021-12-07 13:21:17 +00:00
Kristoffer Dalby 418fde2731 Merge pull request #243 from dragetd/feature/github_templates 2021-12-07 13:20:54 +00:00
Kristoffer Dalby 53108207be Merge branch 'main' into feature/github_templates 2021-12-07 11:07:10 +00:00
Kristoffer Dalby 3fb3db6f20 Merge pull request #248 from negbie/main 2021-12-07 11:07:03 +00:00
Eugen Biegler 5a504fa711 Better error description
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2021-12-07 11:44:09 +01:00
Eugen Biegler b4cce22415 Better error description
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2021-12-07 11:44:00 +01:00
Kristoffer Dalby 54c2306637 Merge branch 'main' into main 2021-12-07 10:39:08 +00:00
Juan Font bc8f5f484d Merge branch 'main' into feature/github_templates 2021-12-07 11:21:50 +01:00
Juan Font d00780b574 Merge pull request #250 from juanfont/use-1.17-for-release
Use go1.17 in goreleaser as required my go mod
2021-12-07 11:21:37 +01:00
Eugen 686384ebb7 Merge branch 'main' of https://github.com/negbie/headscale into main 2021-12-07 08:49:08 +01:00
Eugen 3a85c4d367 Better error description 2021-12-07 08:46:55 +01:00
Juan Font 1b007d2208 Use go1.17 in goreleaser as required my go mod 2021-12-06 23:19:08 +01:00
Kristoffer Dalby 5a7f669505 Update .github/ISSUE_TEMPLATE/config.yml 2021-12-05 09:37:11 +00:00
Michael Ko. Gajda 0c13d9da15 Fix format with prettier 2021-12-04 18:51:09 +01:00
Kristoffer Dalby 58ec26ee89 Merge branch 'main' into changelog 2021-12-04 12:16:01 +00:00
Kristoffer Dalby 969bcf17c4 Merge branch 'main' into feature/github_templates 2021-12-04 10:55:43 +00:00
Kristoffer Dalby 04d81a0e5c Merge branch 'main' into main 2021-12-02 08:31:48 +00:00
Eugen a6e99525ac Add log_level to config, more ACL debug log 2021-12-01 20:02:00 +01:00
Eugen 7e95b3501d Ignoe derp.yaml, don't panic in Serve() 2021-12-01 19:32:47 +01:00
Kristoffer Dalby ab52acba4b Merge pull request #247 from negbie/main 2021-12-01 16:18:46 +00:00
Eugen 07a437c707 Add private_key_path to example config 2021-12-01 14:34:08 +01:00
Kristoffer Dalby d56fb1aaa1 Merge pull request #245 from Bpazy/patch-1 2021-12-01 11:53:25 +00:00
ZiYuan c046ffbceb fix typo
Remove redundant quotation: `ephemeral_node_inactivity_timeout": "30m"` => `ephemeral_node_inactivity_timeout: "30m"`
2021-12-01 14:50:08 +08:00
Kristoffer Dalby 3435d95c80 Clarify and formatting 2021-11-30 09:17:21 +00:00
Kristoffer Dalby acaab7a3de Add Open ID connect to changelog 2021-11-30 09:16:09 +00:00
Juan Font 74ba452025 Merge branch 'main' into feature/github_templates 2021-11-29 21:28:43 +01:00
Juan Font 500be2de58 Merge branch 'main' into changelog 2021-11-29 21:25:31 +01:00
Juan Font 5bc0398aaf Merge pull request #241 from juanfont/add-goreleaser-prerelease
Enable marking releases as prerelease
2021-11-29 21:24:01 +01:00
Michael Ko. Gajda 78eba97bf9 Add GitHub templates 2021-11-29 20:53:04 +01:00
Kristoffer Dalby 6350d528a7 Change changelog format 2021-11-29 19:45:31 +00:00
Kristoffer Dalby 42eb6b9e01 format 2021-11-29 17:34:41 +00:00
Kristoffer Dalby 2e2fb68715 Remove unreleased 2021-11-29 17:32:05 +00:00
Kristoffer Dalby 6fc6355d66 Add initial CHANGELOG 2021-11-29 17:31:19 +00:00
Michael Ko. Gajda 48fc93bbdc Add simple overview README for docs 2021-11-29 14:36:47 +01:00
Juan Font 3e941ef959 Enable marking releases as prerelease 2021-11-28 22:00:22 +00:00
Kristoffer Dalby 1dc008133c Merge pull request #229 from juanfont/kradalby-patch-2 2021-11-28 21:46:37 +00:00
Kristoffer Dalby 2d2ae62176 Merge branch 'kradalby-patch-2' of github.com:juanfont/headscale into kradalby-patch-2 2021-11-28 11:00:43 +00:00
Kristoffer Dalby 8e9a94613c Remove outdate integration test private key 2021-11-28 11:00:22 +00:00
Kristoffer Dalby 8932133ae7 Merge branch 'main' into kradalby-patch-2 2021-11-28 09:28:32 +00:00
Kristoffer Dalby 5b8587037d Remove non-existing field from oidc test 2021-11-28 09:25:27 +00:00
Kristoffer Dalby e167be6d64 Remove generate private key step from docs 2021-11-28 09:18:24 +00:00
Kristoffer Dalby 34f4109fbd Add back privatekey, but automatically generate it if it does not exist 2021-11-28 09:17:18 +00:00
Kristoffer Dalby fa813bc0d7 Merge pull request #239 from cure/debug-make-sure-machine-key-is-correct-length
The `create-node` subcommand under `debug` needs a 64 character key.
2021-11-28 08:38:54 +00:00
Kristoffer Dalby 32006f3a20 Use go 1.17 2021-11-28 08:26:36 +00:00
Kristoffer Dalby ff8c961dbb Make sure comparison of nodekey is on the same format 2021-11-28 08:23:45 +00:00
Kristoffer Dalby e9d5214d1c Disable tests which is broken due to split version 2021-11-27 21:04:19 +00:00
Kristoffer Dalby 6295b0bd84 Go mod tidy 2021-11-27 20:34:46 +00:00
Kristoffer Dalby 550f4016dc Merge branch 'kradalby-patch-2' of github.com:juanfont/headscale into kradalby-patch-2 2021-11-27 20:32:08 +00:00
Kristoffer Dalby 2ae882d801 Update go version 2021-11-27 20:31:33 +00:00
Kristoffer Dalby ef81845deb Merge branch 'main' into kradalby-patch-2 2021-11-27 20:30:27 +00:00
Kristoffer Dalby d96b681c83 Fix node cli integration test 2021-11-27 20:25:37 +00:00
Kristoffer Dalby 59aeaa8476 Ensure we always have the key prefix when needed 2021-11-27 20:25:12 +00:00
Ward Vandewege cb2ea300ad Fix linter errors. 2021-11-27 13:59:39 -05:00
Kristoffer Dalby c38f00fab8 Unmarshal keys in the non-deprecated way 2021-11-26 23:50:42 +00:00
Kristoffer Dalby 0012c76170 Make it easier to run cli integration tests 2021-11-26 23:34:11 +00:00
Kristoffer Dalby cfd53bc4aa Factor wgkey to types/key
This commit converts all the uses of wgkey to the new key interfaces.

It now has specific  machine, node and discovery keys and we now should
use them correctly.

Please note the new logic which strips a key prefix (in utils.go) that
is now standard inside tailscale.

In theory we could put it in the database, but to preserve backwards
compatibility and not spend a lot of resources on accounting for both,
we just strip them.
2021-11-26 23:30:42 +00:00
Kristoffer Dalby 07418140a2 Remove config loading of private key path 2021-11-26 23:29:41 +00:00
Kristoffer Dalby c63c259d31 Switch wgkey for types/key
We dont seem to need the wireguard key anymore, we generate a key on
startup based on the new library and the users fetch it from /key.

Clean up app.go and update docs
2021-11-26 23:28:06 +00:00
Kristoffer Dalby 50b47adaa3 Upgrade tailscale to 1.18 2021-11-26 23:27:09 +00:00
Ward Vandewege b6ae60cc44 The create-node subcommand under debug needs a 64 character key. 2021-11-26 14:49:51 -05:00
Ward Vandewege d944aa6e79 Merge pull request #237 from cure/preauthkeys-fix-default-expiration
Fix default preauthkey expiration
2021-11-26 11:09:43 -05:00
Kristoffer Dalby 06f05d6cc2 Merge branch 'main' into preauthkeys-fix-default-expiration 2021-11-26 15:46:00 +00:00
Kristoffer Dalby 0819c6515a Merge pull request #238 from juanfont/kradalby-patch-3 2021-11-26 15:45:38 +00:00
Ward Vandewege c7f3e0632b When creating a preauthkey, the default expiration was passed through as
a nil value, instead of the default value (1h). This resulted in the
preauthkey being created with expiration key '0001-01-01 00:00:00',
which meant the key would not work, because it was already expired.

This commit applies the default expiration time (1h) when a preauthkey
is created without a specific expiration. It also updates an integration
test to make sure this bug does not reoccur.
2021-11-26 10:04:26 -05:00
Kristoffer Dalby 58fd6c4ba5 Revert postgres constant value
changes "postgresql" to "postgres"
2021-11-26 07:13:00 +00:00
Kristoffer Dalby aab4a6043a Merge branch 'main' into kradalby-patch-2 2021-11-25 08:38:59 +00:00
Kristoffer Dalby a52a4d45c0 Merge pull request #236 from restanrm/fix-derp-example-config
fix(derp-example): change regionid in node
2021-11-25 08:37:45 +00:00
Juan Font 45bc3f7a09 Merge branch 'main' into fix-derp-example-config 2021-11-24 18:57:31 +01:00
Kristoffer Dalby 5620858549 Merge pull request #227 from kradalby/expired-issue 2021-11-24 17:49:33 +00:00
Adrien Raffin-Caboisse f2e273b8a2 fix(derp-example): change regionid in nodes
Using a wrong regionid value lead to non working DERP custom server. No checks are performed for this kind of errors making it difficult to find.
2021-11-24 15:54:22 +01:00
Kristoffer Dalby cec1e86b58 Add missing request arguemnt 2021-11-24 12:16:56 +00:00
Kristoffer Dalby dcbf289470 Rename idKey to machineKey to keep consistency 2021-11-24 12:15:55 +00:00
Kristoffer Dalby fdd64d98c8 Add missing iff to handle expired preauthkey machines 2021-11-24 12:15:32 +00:00
Kristoffer Dalby 9968992be0 Fix prettier 2021-11-24 10:47:20 +00:00
Kristoffer Dalby f50f9ac894 Merge branch 'expired-issue' of github.com:kradalby/headscale into expired-issue 2021-11-24 10:13:49 +00:00
Kristoffer Dalby 2eca344f0e Fix gocritic 2021-11-24 10:13:41 +00:00
Kristoffer Dalby 349264830b Use .1 2021-11-23 11:27:44 +00:00
Kristoffer Dalby 0b5c29022b Merge branch 'main' into expired-issue 2021-11-22 20:13:33 +00:00
Kristoffer Dalby 1f1c45a2c0 Fix cli_test 2021-11-22 19:59:44 +00:00
Kristoffer Dalby 68dc2a70db Update neighbours if node is expired or refreshed
In addition, only pass the map of registered and not expired nodes to
clients.
2021-11-22 19:51:16 +00:00
Kristoffer Dalby caf1b1cabc Fix typo 2021-11-22 19:35:24 +00:00
Kristoffer Dalby 021c464148 Add cache for requested expiry times
This commit adds a sentral cache to keep track of clients whom has
requested an expiry time, but were we need to keep hold of it until the
second request comes in.
2021-11-22 19:32:52 +00:00
Kristoffer Dalby e600ead3e9 Make sure nodes can reauthenticate
This commit fixes an issue where nodes were not able to reauthenticate.
2021-11-22 19:32:11 +00:00
Kristoffer Dalby 200c10e48c Add missing return in oidc.go 2021-11-22 17:22:47 +00:00
Kristoffer Dalby e8faff4fe2 Use uint64 straight instead of converting 2021-11-22 17:22:22 +00:00
Kristoffer Dalby 5cbd4513a4 Simplify register function if 2021-11-22 17:21:56 +00:00
Kristoffer Dalby a477c808c7 Merge pull request #230 from lion24/patch-1 2021-11-22 09:47:37 +00:00
Kristoffer Dalby 74044f62f4 Remove anouther potential error leak 2021-11-21 21:54:19 +00:00
Kristoffer Dalby fcd4d94927 Clean up logging and error handling in oidc
We should never expose errors via web, it gives attackers a lot of info
(Insert OWASP guide).

Also handle error that didnt separate not found gorm issue and other
errors.
2021-11-21 21:51:39 +00:00
Kristoffer Dalby fac33e46e1 Add long description for expire 2021-11-21 21:35:36 +00:00
Kristoffer Dalby b152e53b13 Use correct type for nodes command 2021-11-21 21:34:03 +00:00
Kristoffer Dalby 1687e3b03f Removed unused parameter 2021-11-21 21:29:27 +00:00
Kristoffer Dalby c2393685f1 Remove expiry update in expiry, we dont want to extend it just because they _try_ to connect 2021-11-21 21:14:40 +00:00
Kristoffer Dalby fd5f42c2e6 Move handle expired machine to the end of registration 2021-11-21 21:14:13 +00:00
Kristoffer Dalby bda2d9c3b0 Remove unused param 2021-11-21 14:00:48 +00:00
Kristoffer Dalby c4ecc4db91 Simplify control flow in RegistrationHandler
This commits tries to dismantle the complicated "if and or" in the
RegistrationHandler by factoring out the "is Registrated" into a root
if.

This, together with some new comments, should hopefully make it a bit
easier to follow what is happening in all the different cases that needs
to be handled when a Node contacts the registration endpoint.
2021-11-21 13:59:24 +00:00
Kristoffer Dalby 8ccc51ae57 Remove special case for authkey
We no longer have weird expire behaviour, so we dont need this case
2021-11-21 13:45:19 +00:00
Kristoffer Dalby a2b9f3bede Add expire (logout) machine command 2021-11-21 13:40:44 +00:00
Kristoffer Dalby bd1d1b1a3b Implement ExpireMachine rpc 2021-11-21 13:40:19 +00:00
Kristoffer Dalby f1c05f8010 Add ExpireMachine spec to rpc 2021-11-21 13:40:04 +00:00
Kristoffer Dalby f85a77edb5 Remove println statement 2021-11-21 09:48:59 +00:00
Kristoffer Dalby 1c7aff5dd9 Add expired column to machine list command 2021-11-21 09:44:38 +00:00
lion24 e91f72fe4c Running.md: fix missing backslash (\)
* This would cause otherwise the command to abort after the first statement of the docker command ;)
2021-11-20 23:31:49 +01:00
Kristoffer Dalby 5a2cae5081 Add new Tailscale version to integration tests 2021-11-19 09:16:11 +00:00
Kristoffer Dalby 6a9dd2029e Remove expiry logic, this needs to be redone 2021-11-19 09:02:49 +00:00
Kristoffer Dalby 9aac1fb255 Remove expiry logic, this needs to be redone 2021-11-19 09:02:29 +00:00
Kristoffer Dalby 106b1e7e8d Create constants for other reg methods 2021-11-18 17:51:54 +00:00
Kristoffer Dalby 836986aa59 Merge pull request #225 from fdelucchijr/patch-1 2021-11-18 10:13:07 +00:00
Kristoffer Dalby 58d1255357 Remove unneeded returns 2021-11-18 08:51:33 +00:00
Kristoffer Dalby 981f712660 Remove unused param 2021-11-18 08:51:21 +00:00
Kristoffer Dalby 50dcb8bb75 Use valid handler for registered authkey machines 2021-11-18 08:50:53 +00:00
Kristoffer Dalby a8a8f01429 Make "authKey" a constant 2021-11-18 08:49:55 +00:00
Kristoffer Dalby 35c3fe9608 Move registration workflow into functions 2021-11-17 22:39:41 +00:00
Fernando De Lucchi f74b9f5fe2 Styling and prettier 2021-11-17 16:25:37 -05:00
Fernando De Lucchi de42fe3b04 Merge branch 'main' into patch-1 2021-11-16 19:10:42 -05:00
Kristoffer Dalby 49f835d8cf Merge pull request #214 from ItalyPaleAle/docker-distroless 2021-11-16 07:34:08 +00:00
ItalyPaleAle 7bc2f41b33 Run prettier 💄 2021-11-15 15:37:40 -08:00
Alessandro (Ale) Segala a10388b709 Merge branch 'main' into docker-distroless 2021-11-15 15:19:06 -08:00
Kristoffer Dalby bd7b5e97cb Merge branch 'main' into patch-1 2021-11-15 23:00:45 +00:00
Kristoffer Dalby 4b525a3967 Merge pull request #223 from kradalby/golanglint 2021-11-15 22:36:02 +00:00
Kristoffer Dalby d6739386a0 Get rid of dynamic errors 2021-11-15 19:18:14 +00:00
Kristoffer Dalby 25b790d025 Add and fix forcetypeassert 2021-11-15 18:42:44 +00:00
Kristoffer Dalby db8be91d8b Add and fix forbidigo 2021-11-15 18:36:02 +00:00
Kristoffer Dalby c4d4c9c4e4 Add and fix gosec 2021-11-15 18:31:52 +00:00
Kristoffer Dalby 715542ac1c Add and fix stylecheck (golint replacement) 2021-11-15 17:24:24 +00:00
Kristoffer Dalby 0c005a6b01 Add and fix errname 2021-11-15 16:33:16 +00:00
Kristoffer Dalby 0c45f8d252 Add and fix errorlint 2021-11-15 16:26:41 +00:00
Kristoffer Dalby 2dde1242cf Fix formatting 2021-11-15 16:16:35 +00:00
Kristoffer Dalby 78cfba0a31 Add exceptions to var name length 2021-11-15 16:16:16 +00:00
Kristoffer Dalby 8ae682b412 Fix var name length in tests 2021-11-15 16:16:04 +00:00
Kristoffer Dalby 333be80f9c Fix rest of var name in main code 2021-11-15 16:15:50 +00:00
Alessandro (Ale) Segala 2efefca737 Merge pull request #1 from ohdearaugustin/docker-workflows
Docker workflows
2021-11-14 13:33:13 -08:00
ohdearaugustin c6bc9fffe9 workflows/release: fix docker debug tags 2021-11-14 22:24:27 +01:00
ohdearaugustin 8454c1b52c workflows/release: add docker debug 2021-11-14 21:15:33 +01:00
Kristoffer Dalby 471c0b4993 Initial work eliminating one/two letter variables 2021-11-14 20:32:03 +01:00
Kristoffer Dalby 53ed749f45 Start work on making gocritic pass 2021-11-14 18:44:37 +01:00
Kristoffer Dalby ba084b9987 Lint fix integration tests 2021-11-14 18:35:49 +01:00
Kristoffer Dalby 85f28a3f4a Remove all instances of undefined numbers (gonmd) 2021-11-14 18:31:51 +01:00
Kristoffer Dalby 796072a5a4 Add and fix ifshort 2021-11-14 18:09:22 +01:00
Kristoffer Dalby 9390348a65 Add and fix goconst 2021-11-14 18:06:25 +01:00
Kristoffer Dalby c9c16c7fb8 Remove unused params or returns 2021-11-14 18:03:21 +01:00
Kristoffer Dalby 19cd7a4eac Add and fix exhaustive 2021-11-14 17:52:55 +01:00
Kristoffer Dalby 0315f55fcd Add and fix nilnil 2021-11-14 17:51:34 +01:00
Kristoffer Dalby 668e958d3e Add and fix unconvert 2021-11-14 17:49:54 +01:00
Kristoffer Dalby 4ace54c4e1 Move wsl, might not be feasible 2021-11-14 16:49:54 +01:00
Kristoffer Dalby 89eb13c6cb Add and fix nlreturn (new line return) 2021-11-14 16:46:09 +01:00
Kristoffer Dalby d0ef850035 Add and fix noctx linter 2021-11-14 16:37:43 +01:00
Kristoffer Dalby 2f8e9f272c Merge branch 'main' into docker-distroless 2021-11-14 14:35:44 +01:00
Fernando De Lucchi 1af4a3b958 Merge branch 'main' into patch-1 2021-11-14 04:16:00 -05:00
Kristoffer Dalby 1969802c6b Fix golanglint 2021-11-14 08:32:58 +00:00
Kristoffer Dalby 052883aa55 Fix merge conflict 2021-11-14 08:30:48 +00:00
Kristoffer Dalby d2918edc14 Merge pull request #224 from cure/namespace-deletion-fixes
Improvements for namespace deletion
2021-11-14 09:27:58 +01:00
Kristoffer Dalby f3da299457 Format readme 2021-11-14 08:09:33 +00:00
Kristoffer Dalby e8726b1e22 Add readme note about codestyle 2021-11-14 08:08:03 +00:00
Fernando De Lucchi b897a26f42 arm64 docker image build in release process 2021-11-13 21:08:59 -05:00
Alessandro (Ale) Segala 5ec7158b5d Merge branch 'main' into docker-distroless 2021-11-13 14:16:53 -08:00
Alessandro (Ale) Segala 7d77acd88e Docs for debug container 2021-11-13 22:16:37 +00:00
Alessandro (Ale) Segala c0f16603c5 Copy headscale binary in /bin in the container
This way, we don't need to alter the PATH
2021-11-13 22:10:58 +00:00
Ward Vandewege 34dba0ade8 Fix missing error check. 2021-11-13 15:24:32 -05:00
Ward Vandewege acf7e462ad Improvements for namespace deletion: add a confirmation prompt, and make
sure to also delete any associated preauthkeys.
2021-11-13 14:01:05 -05:00
Kristoffer Dalby f94b0b54d8 Remove lint install, update go 2021-11-13 09:39:20 +00:00
Kristoffer Dalby 806f0d3e6c Format lint 2021-11-13 09:20:59 +00:00
Kristoffer Dalby b653572272 Make format shuld format, not lint 2021-11-13 09:20:51 +00:00
Kristoffer Dalby fa0922d5bb define proto dir for buf 2021-11-13 09:18:00 +00:00
Kristoffer Dalby 95b9f03fb3 update buf setup 2021-11-13 09:13:17 +00:00
Kristoffer Dalby 24e0c944b1 Align with update golangci-lint 2021-11-13 09:11:03 +00:00
Kristoffer Dalby 148437f716 Setup more linters and goals for golangci 2021-11-13 08:53:34 +00:00
Kristoffer Dalby 3ddd9962ce Add format make entry 2021-11-13 08:39:20 +00:00
Kristoffer Dalby 2634215f12 golangci-lint --fix 2021-11-13 08:39:04 +00:00
Kristoffer Dalby dae34ca8c5 Proto format 2021-11-13 08:36:56 +00:00
Kristoffer Dalby 03b7ec62ca Go format with shorter lines 2021-11-13 08:36:45 +00:00
Kristoffer Dalby edfcdc466c Update lint ci file with prettier and proto 2021-11-13 08:13:38 +00:00
Kristoffer Dalby 6b3114ad6f Run prettier 2021-11-13 08:11:55 +00:00
Kristoffer Dalby ba65092926 Merge pull request #212 from kradalby/cli-grpc
Rework the CLI to use gRPC
2021-11-12 14:39:39 +00:00
Alessandro (Ale) Segala f44138c944 Added debug container 2021-11-12 02:20:46 +00:00
Alessandro (Ale) Segala c290ce4b91 Revert "Fixed integration tests"
This reverts commit 67953bfe2f.
2021-11-09 16:24:10 +00:00
Alessandro (Ale) Segala 3b34c7b89a Removed / from docker commands in docs
Essentially reverts 6076656373
2021-11-09 16:23:36 +00:00
Alessandro (Ale) Segala 83e72ec57d Allow running headscale without leading / 2021-11-09 16:20:58 +00:00
Kristoffer Dalby 49893305b4 Only turn on response log in grpc in trace mode 2021-11-08 22:06:25 +00:00
Kristoffer Dalby 0803c407a9 Fix Reusable typo, add tests for Augustines scenario 2021-11-08 20:49:03 +00:00
Kristoffer Dalby 6371135459 Try to address issue raised by cure 2021-11-08 20:48:20 +00:00
Kristoffer Dalby 43af11c46a Fix typo in generated code 2021-11-08 20:47:40 +00:00
Kristoffer Dalby b210858dc5 Remove unused dep 2021-11-08 18:28:06 +00:00
Kristoffer Dalby e1f45f9d07 Remove unused dep 2021-11-08 18:27:57 +00:00
Kristoffer Dalby dce6b8d72e Add test case and fix nil pointer in preauthkeys command without expiration 2021-11-08 08:02:01 +00:00
Alessandro (Ale) Segala 67953bfe2f Fixed integration tests 2021-11-07 19:09:51 +00:00
Alessandro (Ale) Segala 6076656373 Updated docs 2021-11-07 18:57:37 +00:00
Kristoffer Dalby 9a26fa7989 Ensure logging is off for integration test commands 2021-11-07 10:40:05 +00:00
Kristoffer Dalby d47b83f80b Unwrap grpc errors to make nicer user facing errors 2021-11-07 10:15:32 +00:00
Kristoffer Dalby b11acad1c9 Fix typo 2021-11-07 09:57:39 +00:00
Kristoffer Dalby b15efb5201 Ensure unix socket is removed before we startup 2021-11-07 09:55:32 +00:00
Kristoffer Dalby 2dfd42f80c Attempt to dry up CLI client, add proepr config
This commit is trying to DRY up the initiation of the gRPC client in
each command:

It renames the function to CLI instead of GRPC as it actually set up a
CLI client, not a generic grpc client

It also moves the configuration of address, timeout (which is now
consistent) and api to use Viper, allowing users to set it via env vars
and configuration file
2021-11-07 09:41:14 +00:00
Kristoffer Dalby ce3f79a3bf Add yaml to output help 2021-11-07 08:58:45 +00:00
Kristoffer Dalby a249d3fe39 Fix color for current namespace in nodes command 2021-11-07 08:58:03 +00:00
Alessandro (Ale) Segala a6d487de00 Using debian11-based distroless image 2021-11-06 23:19:56 +00:00
Alessandro (Ale) Segala 3720da6386 Using distroless base image for Docker 2021-11-06 23:18:13 +00:00
Kristoffer Dalby 26718e8308 Revert gorm upgrade 2021-11-06 20:23:04 +00:00
Kristoffer Dalby f5a196088a Merge branch 'main' into cli-grpc 2021-11-06 20:12:19 +00:00
Kristoffer Dalby 74f0d08f50 Merge pull request #199 from rcursaru/patch-1
update Running.md
2021-11-06 20:05:27 +00:00
Kristoffer Dalby 046681f4ef Merge branch 'main' into patch-1 2021-11-06 19:46:06 +00:00
Kristoffer Dalby 29531a5e90 Merge branch 'main' into cli-grpc 2021-11-06 19:29:00 +00:00
Ward Vandewege 137a9d6333 Merge pull request #213 from aberoham/patch-1
Typo in golang URL
2021-11-06 14:23:17 -04:00
Abraham Ingersoll 8115f50d03 Typo in golang URL 2021-11-06 07:43:41 +00:00
Kristoffer Dalby b75e8ae2bd Merge branch 'main' into patch-1 2021-11-05 18:27:55 +00:00
Kristoffer Dalby 3ad2350c79 Fix new version of hujson 2021-11-05 07:24:00 +00:00
Kristoffer Dalby 204f99dd51 Add CLI integration tests
This PR adds a new part to the integration test suite which spins up a
new headscale and runs through a scenario of test cases for each
command.

The intent is to check that all commands work as intended and produce
the expected output.

I think they have been pretty well covered, but would appreciate
additional test cases if I have missed some.

Please note: headscale is set up, and teared down for _each_ "test
function" in this file, this means that its more suitable for specific
cases.
2021-11-04 22:45:15 +00:00
Kristoffer Dalby 8df41b069f Formatting 2021-11-04 22:45:08 +00:00
Kristoffer Dalby be4256b1d0 Convert routes command to use gRPC 2021-11-04 22:44:59 +00:00
Kristoffer Dalby 77a973878c Convert preauthkeys command to use gRPC 2021-11-04 22:44:49 +00:00
Kristoffer Dalby 7b0d2dfb4a Convert nodes command to use gRPC 2021-11-04 22:44:35 +00:00
Kristoffer Dalby 79871d2463 Make namespace command use gRPC
This commit is a first in a series of commits migrating the command
interfaces to use the new gRPC client.

As a part of this commit, they have been streamlined and each command
_should_ be a bit more similar and use consistent output.

By using the new output function, we now make sure its always json
(errors and everything) if the user asks for JSON.
2021-11-04 22:42:21 +00:00
Kristoffer Dalby dce82f4323 Use new json wrapper for version command 2021-11-04 22:41:55 +00:00
Kristoffer Dalby 9e9049307e Simplify loglevel parser, turn off logs when machine output is set 2021-11-04 22:32:13 +00:00
Kristoffer Dalby cd34a5d6f3 Expand json output to support yaml, make more generic 2021-11-04 22:31:47 +00:00
Kristoffer Dalby 319237910b Resolve new dependencies 2021-11-04 22:28:35 +00:00
Kristoffer Dalby 3eed356d70 Implement rpc calls with new helper functions, implementing the proto spec 2021-11-04 22:19:27 +00:00
Kristoffer Dalby 706ff59d70 Clean pointer list in app.go, add grpc logging and simplify naming 2021-11-04 22:18:55 +00:00
Kristoffer Dalby c2eb3f4d36 Use long command in example and remove pointerlist 2021-11-04 22:18:06 +00:00
Kristoffer Dalby 9acc3e0e73 Add a set of ip prefix convert helpers 2021-11-04 22:17:44 +00:00
Kristoffer Dalby 94dbaa6822 Clean up the return of "pointer list"
This commit is getting rid of a bunch of returned list pointers.
2021-11-04 22:16:56 +00:00
Kristoffer Dalby 5526ccc696 Namespaces are no longer a pointer 2021-11-04 22:15:46 +00:00
Kristoffer Dalby 95690e614e Simplify and streamline namespace functions for new cli/rpc/api 2021-11-04 22:15:17 +00:00
Kristoffer Dalby 77f5f8bd1c Simplify and streamline preauth commands for new cli/rpc/api 2021-11-04 22:14:39 +00:00
Kristoffer Dalby 787814ea89 Consolidate machine related lookups
This commit moves the routes lookup functions to be subcommands of
Machine, making them a lot simpler and more specific/composable.

It also moves the register command from cli.go into machine, so we can
clear out the extra file.

Finally a toProto function has been added to convert between the machine
database model and the proto/rpc model.
2021-11-04 22:11:38 +00:00
Kristoffer Dalby 67adea5cab Move common integration test commands into common file 2021-11-04 22:10:57 +00:00
Kristoffer Dalby 4226da3d6b Add "debug" command
This commit adds a debug command tree, intended to host commands used
for debugging and testing.

It adds a create node/machine command which will be used later to create
machines that can be used to test the registration command.
2021-11-04 22:08:45 +00:00
Kristoffer Dalby 5270361989 Add generated files from protobuf 2021-11-04 22:07:59 +00:00
Kristoffer Dalby a6aa6a4f7b Add proto rpc interface for cli
This commit adds proto rpc definitions for the communication needed for
the CLI interface.
This will allow us to move the rest of the CLI interface over to gRPC
and in the future allow remote access
2021-11-04 22:02:10 +00:00
Kristoffer Dalby 1c530be66c Merge pull request #206 from kradalby/initial-api-cli-work 2021-11-04 14:09:06 +00:00
Kristoffer Dalby 7c774bc547 Remove flag that cant be trapped 2021-11-02 21:49:19 +00:00
Kristoffer Dalby 9954a3c599 Add handling for closing the socket 2021-11-02 21:46:15 +00:00
Kristoffer Dalby b91c115ade Remove "auth skip" for socket traffic 2021-10-31 19:57:42 +00:00
Kristoffer Dalby 53df9afc2a Fix step naming error 2021-10-31 19:54:38 +00:00
Kristoffer Dalby 8db45a4e75 Setup a seperate, non-tls, no auth, socket grpc 2021-10-31 19:52:34 +00:00
Kristoffer Dalby 1c9b1ea91a Add todo 2021-10-31 16:34:20 +00:00
Kristoffer Dalby 12f2a7cee0 Move context per cure's suggestion 2021-10-31 16:26:51 +00:00
Kristoffer Dalby 3f30bf1e33 Ensure we set up TLS for http 2021-10-31 16:19:38 +00:00
Kristoffer Dalby f968b0abdf Merge branch 'main' into initial-api-cli-work 2021-10-31 12:17:47 +00:00
Kristoffer Dalby 16ccbf4cdb Merge pull request #207 from juanfont/update-contributors 2021-10-31 12:17:31 +00:00
Kristoffer Dalby d803fe6123 Merge branch 'main' into update-contributors 2021-10-31 09:58:17 +00:00
Kristoffer Dalby ca15a53fad Add timeout to integration test for execCommand to fail faster 2021-10-31 09:58:01 +00:00
Kristoffer Dalby 264e5964f6 Resolve merge conflict 2021-10-31 09:40:43 +00:00
github-actions[bot] 223c611820 docs(README): update contributors 2021-10-31 09:34:07 +00:00
Kristoffer Dalby fbdfa55629 Merge pull request #126 from unreality/main
Initial work on OIDC (SSO) integration
2021-10-31 09:33:35 +00:00
unreality 73d22cdf54 Merge pull request #2 from kradalby/oidc-1
Fix conflict, prepare for merge
2021-10-31 07:04:04 +08:00
Kristoffer Dalby bac81176b2 Remove lint from generated testcode 2021-10-30 15:39:05 +00:00
Kristoffer Dalby cd2914dbc9 Make note about oidc being experimental 2021-10-30 15:35:58 +00:00
Kristoffer Dalby cbf3f5d640 Resolve merge conflict 2021-10-30 15:33:01 +00:00
Kristoffer Dalby 018e42acad Merge branch 'main' into initial-api-cli-work 2021-10-30 15:31:34 +01:00
Kristoffer Dalby 482a31b66b Setup swagger and swagger UI properly 2021-10-30 14:29:53 +00:00
Kristoffer Dalby 2b340e8fa4 Rename protofile 2021-10-30 14:29:41 +00:00
Kristoffer Dalby 434fac52b7 Fix lint error 2021-10-30 14:29:03 +00:00
Kristoffer Dalby 6aacada852 Switch from gRPC localhost to socket
This commit changes the way CLI and grpc-gateway communicates with the
gRPC backend to socket, instead of localhost. Unauthenticated access now
goes on the socket, while the network interface will require API key (in
the future).
2021-10-30 14:08:16 +00:00
Ward Vandewege 7301d7eb67 Merge pull request #200 from cure/cli-improvements
Cli improvements -- nodes subcommand
2021-10-29 17:36:54 -04:00
Ward Vandewege b2d2d5653e Merge branch 'main' into cli-improvements 2021-10-29 17:20:05 -04:00
Kristoffer Dalby 72fd2a2780 Fix lint error 2021-10-29 17:36:11 +00:00
Kristoffer Dalby 9ef031f0f8 Port create, delete and list of namespace to grpc 2021-10-29 17:16:54 +00:00
Kristoffer Dalby 81b8610dff Add helper function to setup grpc client for cli 2021-10-29 17:15:52 +00:00
Kristoffer Dalby eefd82a574 Move config loading out of the headscale app setup 2021-10-29 17:09:06 +00:00
Kristoffer Dalby 002b5c1dad Add grpc token auth struct 2021-10-29 17:08:21 +00:00
Kristoffer Dalby 68dab0fe7b Move localhost check to utils 2021-10-29 17:04:58 +00:00
Kristoffer Dalby 6d10be8fff Change order of print/nil check in integration test 2021-10-29 16:49:44 +00:00
Kristoffer Dalby a23d82e33a Setup API and prepare for API keys
This commit sets up the API and gRPC endpoints and adds authentication
to them. Currently there is no actual authentication implemented but it
has been prepared for API keys.

In addition, there is a allow put in place for gRPC traffic over
localhost. This has two purposes:

1. grpc-gateway, which is the base of the API, connects to the gRPC
   service over localhost.
2. We do not want to break current "on server" behaviour which allows
   users to use the cli on the server without any fuzz
2021-10-29 16:45:06 +00:00
Kristoffer Dalby c7fa9b6e4a Setup create, delete and list namespace over grpc 2021-10-29 16:44:32 +00:00
Kristoffer Dalby 07bbeafa3b Fix lint errors, add initial namespace rpc 2021-10-29 16:43:10 +00:00
Kristoffer Dalby 06700c1dc4 Setup proto linting 2021-10-29 16:42:56 +00:00
Raal Goff 2d252da221 suggested documentation and comments 2021-10-29 21:35:07 +08:00
Kristoffer Dalby 2c071a8a2d Merge pull request #204 from kradalby/api-playground 2021-10-28 20:17:20 +01:00
Ward Vandewege f9187bdfc4 Switch to named arguments for all nodes subcommands. Update docs
accordingly. Fix integration test failure.
2021-10-28 09:31:15 -04:00
Ward Vandewege 25c67cf2aa Update integration_test.go
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2021-10-28 08:40:30 -04:00
Ward Vandewege b00a2729e3 Update cmd/headscale/cli/nodes.go
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2021-10-28 08:39:42 -04:00
Ward Vandewege 6c01b86e4c Update cmd/headscale/cli/nodes.go
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2021-10-28 08:39:27 -04:00
Ward Vandewege d086cf4691 Move the namespace argument back to a flag for the share and unshare
commands.
2021-10-27 17:51:42 -04:00
Kristoffer Dalby 5054ed41ac Make ci lint fix if it can 2021-10-27 07:10:32 +00:00
Kristoffer Dalby e91174e83f Add gen explicitly to skip list 2021-10-27 07:08:24 +00:00
Kristoffer Dalby c9bd25d05c Remove golint from github actions 2021-10-27 07:07:44 +00:00
Kristoffer Dalby f779372154 Add golangcilint config 2021-10-27 07:07:19 +00:00
Kristoffer Dalby acd9ebbdf8 Let lint ignore grpcv1.go as it is placeholder 2021-10-27 07:06:39 +00:00
Kristoffer Dalby 6369cea10e Remove golint, its deprecated
This commit removed `golint`, its deprecated:
https://github.com/golang/lint

and golangci-lint has overlapping features.
2021-10-27 06:58:16 +00:00
Kristoffer Dalby 2d92719095 Dont try to generate code on every make build 2021-10-27 06:48:30 +00:00
Kristoffer Dalby d4265779ef Check in generated code
This does not have to be reviewed, here is some reasoning:

Go (and go mod) is designed for having code available and we need to
check in the generated code to make sure it is "go gettable". If we dont
we give ourselves a headache trying to setup all the ci, tests etc to
install and generate the code before it runs.

Because the code isnt there, the plugins needed to generate the code
fail to install...

I didnt find any good documentation for this, but there is this github
comment:
https://github.com/golang/go/issues/34514#issuecomment-535406759
2021-10-27 06:44:04 +00:00
Kristoffer Dalby 8f2ef6a57d Prepare for checking in generated code 2021-10-27 06:40:39 +00:00
Kristoffer Dalby 6e764942a2 Add grpc step to dockerfile 2021-10-26 21:35:18 +00:00
Kristoffer Dalby 11d987549f Ignore generated files for docker 2021-10-26 21:34:51 +00:00
Kristoffer Dalby b8c89cd63c Add readme and makefile entry about code generation 2021-10-26 20:53:10 +00:00
Kristoffer Dalby 2f045b20fb Refactor tls and wire up grpc, grpc gateway/api
This commit moves the TLS configuration into a seperate function.

It also wires up the gRPC interface and prepares handing the API
endpoints to the grpc gateway.
2021-10-26 20:42:56 +00:00
Kristoffer Dalby caa4d33cbd Add an initial grpcv1 service (implementing the proto generated service) 2021-10-26 20:42:20 +00:00
Kristoffer Dalby a9da7c8fd9 Update go.mod 2021-10-26 20:41:35 +00:00
Kristoffer Dalby b096a2e7e5 Create an initial gRPC service
This commit adds protobuf files and tooling surrounding generating APIs
and datatypes.
2021-10-26 20:37:37 +00:00
Ward Vandewege f9ece0087d Make the cli help a little more explicit for the nodes subcommand. 2021-10-26 08:50:25 -04:00
Kristoffer Dalby c76d3b53d9 Merge branch 'main' into cli-improvements 2021-10-25 22:11:02 +01:00
Kristoffer Dalby e8277595f5 Merge pull request #202 from juanfont/kradalby-patch-1
Add note about main containing unreleased  changes
2021-10-25 20:14:36 +01:00
Kristoffer Dalby 4d3b638a3d Add note about main containing unreleased changes
#201
2021-10-25 19:38:11 +01:00
Ward Vandewege 1d9954d8e9 Fix integration test. 2021-10-24 20:11:47 -04:00
Ward Vandewege dd7557850e cli changes for the nodes subcommand:
* when listing nodes, a namespace is now optional, when it is not
  provided, all nodes are shown
* when deleting, and sharing a node, remove the `namespace` flag, it was
  superfluous and unused
* when unsharing a node, specify the namespace as an argument not a
  flag, making the UX the same as for sharing.

Also refactor the share/unshare code to reuse the shared bits.
2021-10-24 17:50:28 -04:00
Ward Vandewege c8e1afb14b When attempting to unshare a node from the primary namespace, return
errorMachineNotShared, not errorSameNamespace. Add test for same.
2021-10-24 17:50:21 -04:00
Kristoffer Dalby 6d162eeff9 Merge pull request #197 from kradalby/config-simplification 2021-10-24 22:27:18 +01:00
Kristoffer Dalby 746d4037da Fix config and tests 2021-10-24 21:30:51 +01:00
Kristoffer Dalby 1237e02f7c Merge branch 'config-simplification' of github.com:kradalby/headscale into config-simplification 2021-10-24 21:21:08 +01:00
Kristoffer Dalby 7da3d4ba50 Resolve merge conflict 2021-10-24 21:21:01 +01:00
Remus CURSARU c22b93734e update Running.md
clarify setup steps; use a single directory to hold all configuration for docker container
2021-10-24 14:09:07 +02:00
Kristoffer Dalby 8853315dcc Update config-example.yaml
Co-authored-by: Juan Font <juanfontalonso@gmail.com>
2021-10-23 10:40:15 +01:00
Kristoffer Dalby 5aaffaaecb Merge pull request #196 from kradalby/derp-improvements
Add ability to fetch DERP from url and file
2021-10-23 09:20:27 +01:00
Kristoffer Dalby 389a8d47a3 Merge branch 'main' into derp-improvements 2021-10-22 23:58:48 +01:00
Kristoffer Dalby a355769416 Update derp-example.yaml
Co-authored-by: Juan Font <juanfontalonso@gmail.com>
2021-10-22 23:58:27 +01:00
Juan Font 1a8c9216d6 Merge pull request #194 from juanfont/update-contributors
docs(README): update contributors
2021-10-23 00:11:22 +02:00
Juan Font 81316ef644 Merge branch 'main' into update-contributors 2021-10-22 21:28:27 +02:00
Kristoffer Dalby 4d4d0de356 Start adding comments to config 2021-10-22 18:27:11 +01:00
Kristoffer Dalby b85adbc40a Remove the need for multiple config files
This commit removes the almost a 100% redundant tests (two fields were
checked differently) and makes a single example configuration for users.
2021-10-22 18:14:29 +01:00
Kristoffer Dalby aefbd66317 Remove derpmap volume from integration tests 2021-10-22 16:57:51 +00:00
Kristoffer Dalby d875cca69d move integration to yaml, add new derp configuration 2021-10-22 16:57:01 +00:00
Kristoffer Dalby 0e902fe949 Add certificates to docker image so we can get derpmap from tailscale 2021-10-22 16:56:23 +00:00
Kristoffer Dalby 582eb57a09 Use the new derp map 2021-10-22 16:56:00 +00:00
Kristoffer Dalby 177f1eca06 Add helper functions for building derp maps from urls and file 2021-10-22 16:55:35 +00:00
Kristoffer Dalby 57f46ded83 Split derp into its own config struct 2021-10-22 16:55:14 +00:00
Kristoffer Dalby aa245c2d06 Remove derp.yaml, add selfhosted example
This PR will promote fetching the derpmap directly from tailscale, so we
will remove our example, as it might easily get outdated.

Add a derp-example that shows how a user can also add their own derp
server.
2021-10-22 16:52:39 +00:00
Kristoffer Dalby e836db1ead Add config.yaml to gitignore 2021-10-22 16:51:19 +00:00
github-actions[bot] 5420347d24 docs(README): update contributors 2021-10-22 06:58:20 +00:00
Kristoffer Dalby 9e2637d65f Merge pull request #192 from derelm/patch-2 2021-10-22 07:57:48 +01:00
Juan Font c6046597ed Merge branch 'main' into update-contributors 2021-10-22 00:01:18 +02:00
Juan Font a46c8fe914 Merge branch 'main' into patch-2 2021-10-21 23:56:10 +02:00
Juan Font f822816cdb Merge pull request #193 from juanfont/fix-again-contributors
Another fix for the contributors section in README
2021-10-21 23:55:41 +02:00
Juan Font Alonso f3bf9b4bbb Contributors again fixed 2021-10-21 23:54:20 +02:00
Juan Font 9f02899261 Merge branch 'main' into patch-2 2021-10-21 23:41:52 +02:00
github-actions[bot] 75f3e1fb03 docs(README): update contributors 2021-10-21 21:38:02 +00:00
Juan Font 9fbfa7c1f5 Merge pull request #191 from juanfont/fix-contributors
Fix contributors
2021-10-21 23:32:43 +02:00
Juan Font Alonso d5aef85bf2 Fix contributors 2021-10-21 23:21:38 +02:00
derelm 88b32e4b18 fix typo 2021-10-21 23:07:35 +02:00
Juan Font Alonso e425e3ffd3 Fix contributors 2021-10-21 22:53:30 +02:00
Juan Font 355483fd86 Merge pull request #184 from juanfont/doc-reorg-v1
Move documentation away from README and use YAML everywhere
2021-10-21 22:38:59 +02:00
Juan Font Alonso 672d8474b9 PRettier on the yamls 2021-10-21 21:18:50 +02:00
Juan Font Alonso 73e4d38670 Merge branch 'doc-reorg-v1' of https://github.com/juanfont/headscale into doc-reorg-v1 2021-10-21 21:01:57 +02:00
Juan Font Alonso 561c15bbe8 Prettier 2021-10-21 21:01:52 +02:00
Juan Font Alonso b93aa723cb Run contributors on merge to master 2021-10-21 20:58:30 +02:00
Juan Font Alonso 636943c715 Improved docker cmd 2021-10-21 20:57:18 +02:00
Juan Font 0a6a67da85 Merge branch 'main' into doc-reorg-v1 2021-10-21 20:55:48 +02:00
Juan Font Alonso e9ffd366dd Improvements here and there 2021-10-21 20:54:41 +02:00
Juan Font Alonso 4be0b3f556 Mention disable check updates in the doc 2021-10-21 20:54:29 +02:00
Juan Font Alonso a0bfad6d6e Headscale is not capitalized 2021-10-21 20:48:29 +02:00
Juan Font Alonso bb1f17f5af Added glossary 2021-10-21 20:46:19 +02:00
Juan Font 95bc2ee241 Merge pull request #190 from juanfont/fix-arm64
Fix arm64 (now for good)
2021-10-21 20:40:17 +02:00
Juan Font Alonso 16a90e799c Contributors should be working 2021-10-21 20:36:26 +02:00
Juan Font Alonso 4c2f84b211 Add contributors Action 2021-10-21 20:33:58 +02:00
Juan Font Alonso b799635fbb Merge branch 'fix-arm64' of https://github.com/juanfont/headscale into fix-arm64 2021-10-21 19:56:51 +02:00
Juan Font Alonso bc145952d4 Finally fix arm64 build 2021-10-21 19:56:36 +02:00
Kristoffer Dalby 2c5701917d Merge branch 'main' into doc-reorg-v1 2021-10-21 18:46:29 +01:00
Juan Font ed7b840fea Merge pull request #188 from juanfont/fix-arm64
Fixed ARM64 compiler name
2021-10-21 19:10:14 +02:00
Kristoffer Dalby 23372e29cd Merge branch 'main' into fix-arm64 2021-10-21 17:03:46 +01:00
Juan Font Alonso fb569b0483 Fixed ARM64 compiler name 2021-10-21 17:47:10 +02:00
Juan Font e2b5638ca0 Merge pull request #187 from juanfont/fix-arm64
Use CGO_ENABLED=1 when building arm64
2021-10-21 00:00:47 +02:00
Juan Font Alonso 8f5a1dce3e Merge branch 'doc-reorg-v1' of https://github.com/juanfont/headscale into doc-reorg-v1 2021-10-20 23:34:27 +02:00
Juan Font Alonso 6b0f5da113 Separate config examples for sqlite and postgres for the time being 2021-10-20 23:27:59 +02:00
Juan Font Alonso 5159b6d085 Trying to fix arm64 2021-10-20 23:10:59 +02:00
Juan Font 03d97c3872 Merge pull request #183 from juanfont/split-dns
Add support for Split DNS (Restricted Nameservers)
2021-10-20 10:53:52 +02:00
Juan Font 41c5a0ddf5 Apply suggestions from code review
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2021-10-20 09:35:56 +02:00
Juan Font 19165a40d2 Merge branch 'main' into split-dns 2021-10-20 00:19:34 +02:00
Juan Font d1ebcb59f1 Merge branch 'main' into doc-reorg-v1 2021-10-20 00:19:21 +02:00
Juan Font Alonso 31344128a0 Switch json for yaml in README 2021-10-20 00:17:47 +02:00
Juan Font Alonso 86ecc2a234 Switch to YAML config 2021-10-20 00:17:08 +02:00
Juan Font Alonso d1e8ac7ba5 Moved TLS config to another file 2021-10-20 00:07:05 +02:00
Juan Font Alonso efe208fef5 Merge branch 'doc-reorg-v1' of https://github.com/juanfont/headscale into doc-reorg-v1 2021-10-19 23:54:32 +02:00
Juan Font Alonso 7b40e99aec Added notes on SQLite 2021-10-19 23:45:20 +02:00
Juan Font 06706aab9a Update docs/Running.md
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2021-10-19 23:41:08 +02:00
Juan Font 0318af5a33 Apply suggestions from code review
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2021-10-19 23:22:56 +02:00
Juan Font Alonso 995dcfc6ae Reference doc/ 2021-10-19 21:02:45 +02:00
Juan Font Alonso 2236cc8bf7 Improve wording here and there 2021-10-19 21:01:36 +02:00
Juan Font Alonso 7bb354117b Move README documentation to doc/ 2021-10-19 20:59:33 +02:00
Juan Font Alonso 18b00b5d8d Add support for Split DNS (implements #179) 2021-10-19 20:51:43 +02:00
Kristoffer Dalby dbe193ad17 Fix up leftovers from kradalby PR 2021-10-19 18:25:59 +01:00
Kristoffer Dalby e7424222db Merge branch 'main' into main 2021-10-19 17:47:09 +01:00
Juan Font d2a162e3ee Merge pull request #178 from cure/refactor-sharing-tests
Apply some DRY to the sharing tests.
2021-10-19 18:45:37 +02:00
Kristoffer Dalby da14750396 Merge branch 'main' into main 2021-10-19 15:26:18 +01:00
unreality 8fe72dcb74 Merge pull request #1 from kradalby/namespace-mappings
Implement namespace mappings
2021-10-19 09:33:54 +08:00
Ward Vandewege d35f5fe498 Apply some DRY to the sharing tests. 2021-10-18 17:52:38 -04:00
Kristoffer Dalby 677bd9b657 Implement namespace matching 2021-10-18 19:27:52 +00:00
Kristoffer Dalby a347d276bd Fix broken machine test 2021-10-18 19:26:43 +00:00
Juan Font 9e1253ada1 Merge pull request #177 from cure/cli-unshare-node
Cli unshare node
2021-10-18 12:51:53 +02:00
Juan Font 244e79f575 Merge branch 'main' into cli-unshare-node 2021-10-18 12:34:13 +02:00
Juan Font b4e6a32b4b Merge pull request #176 from cure/fix-sharing-check
Bugfix: the check to see if a node was already shared into a namespace
2021-10-18 12:34:04 +02:00
Juan Font 023cd8f4cd Merge branch 'main' into fix-sharing-check 2021-10-18 12:20:43 +02:00
Juan Font 10d24e64cd Merge pull request #174 from juanfont/fix-magic-dns-base-domain
Fix MagicDNS base domain
2021-10-18 12:16:07 +02:00
Juan Font Alonso 37e191a75d Solved merge 2021-10-17 23:59:44 +02:00
Juan Font Alonso 01a5fe3c51 Added tests, solved some bugs, and code reorg 2021-10-17 23:58:09 +02:00
Ward Vandewege 9e3339b4f1 Add cli support for unsharing a node from a namespace. 2021-10-17 16:29:46 -04:00
Ward Vandewege b06e34f144 Bugfix: the check to see if a node was already shared into a namespace
was incorrect.
2021-10-17 15:53:39 -04:00
Kristoffer Dalby 710616f118 Merge branch 'main' into main 2021-10-17 13:26:37 +01:00
Kristoffer Dalby ddf042cab1 Merge branch 'main' into fix-magic-dns-base-domain 2021-10-17 13:23:21 +01:00
Juan Font Alonso 687e8d12be Do not use the full application for getMapResponseDNSConfig 2021-10-17 12:10:03 +02:00
Juan Font Alonso 01f755ecf9 Send UserProfile info for the peers' namespaces 2021-10-17 12:07:01 +02:00
Juan Font Alonso 8094e6fdef Preload the Namespace from SharedMachines 2021-10-17 11:59:08 +02:00
Juan Font Alonso 061efa1822 Do not include BaseDomain as full route in DNSConfig + code reorg 2021-10-17 11:57:53 +02:00
Juan Font 9a7472218e Merge pull request #172 from cure/rename-namespaces
Rename namespaces
2021-10-17 00:30:36 +02:00
Ward Vandewege 7dcf4a5147 Add support for renaming namespaces. 2021-10-16 11:20:06 -04:00
Ward Vandewege 306a80cf57 Bugfix: when namespace destruction causes a database error, return the
error, not nil.
2021-10-16 11:14:37 -04:00
Raal Goff d0cd5af419 fix incorrect merge 2021-10-16 22:34:11 +08:00
unreality afbfc1d370 Merge branch 'main' into main 2021-10-16 22:31:37 +08:00
Juan Font a9a1a8fb3c Merge pull request #171 from juanfont/force-flag
Added --force flag on node delete
2021-10-16 14:21:35 +02:00
Juan Font 85ddc0db33 Merge branch 'main' into force-flag 2021-10-16 14:09:59 +02:00
Juan Font fddc2aa8fa Merge pull request #150 from juanfont/fix-shared-nodes
Fix shared nodes
2021-10-16 14:09:23 +02:00
Juan Font Alonso be3a379d10 Added --force flag on node delete (fixes #164) 2021-10-16 12:30:52 +02:00
Juan Font Alonso d0daff180e Added TODO in waiting 2021-10-16 11:36:16 +02:00
Juan Font Alonso be36480a64 Reverted back values in integration tests 2021-10-16 11:06:33 +02:00
Juan Font 9f52a64a6a Merge branch 'main' into fix-shared-nodes 2021-10-16 10:22:42 +02:00
Juan Font 52511af8e4 Merge pull request #169 from juanfont/arm64-binaries
Generate arm64 binaries in goreleaser
2021-10-16 10:22:24 +02:00
Juan Font ddb6bd795c Merge branch 'main' into arm64-binaries 2021-10-16 10:10:54 +02:00
Juan Font 271660a284 Merge pull request #167 from juanfont/authkey-namespace-preload
Preload AuthKey Namespace on list nodes
2021-10-16 10:10:42 +02:00
Juan Font 0b0f7db534 Merge branch 'main' into authkey-namespace-preload 2021-10-16 09:59:34 +02:00
Juan Font 5a7b377f6f Merge pull request #166 from juanfont/complete-expire-command
Improve help message to expire key
2021-10-16 09:59:15 +02:00
Juan Font 654d2b9910 Merge branch 'main' into complete-expire-command 2021-10-16 09:41:14 +02:00
Juan Font 829a8c4381 Merge pull request #165 from juanfont/expire-json
Show JSON on error when expiring key
2021-10-16 09:40:48 +02:00
Raal Goff 0603e29c46 add login details to RegisterResponse so GUI clients show login display name 2021-10-15 23:09:55 +08:00
Juan Font Alonso 5807562b56 Add arm64 binaries 2021-10-15 17:00:04 +02:00
Juan Font Alonso 985c6e7cc9 Preload AuthKey Namespace on list nodes (fixes #163) 2021-10-15 00:04:04 +02:00
Juan Font Alonso 0d13e16fed Improve help message to expire key (fixes #161) 2021-10-14 23:58:15 +02:00
Juan Font Alonso 91d135e069 Show JSON when error on expire key (fixes #162) 2021-10-14 23:54:07 +02:00
Juan Font Alonso 3e1e07e8c1 Fixed integration tests for shared nodes 2021-10-14 22:37:44 +02:00
Juan Font 6c4c761408 Merge branch 'main' into fix-shared-nodes 2021-10-13 23:54:30 +02:00
Juan Font abfb1791f1 Merge pull request #159 from juanfont/better-pak-management
Add field AlreadyUsed to AuthKeys
2021-10-13 23:45:10 +02:00
Juan Font Alonso 7ce8c4c649 Fixed merge 2021-10-13 23:28:47 +02:00
Juan Font Alonso 2ddca366f2 Merge branch 'main' of https://github.com/juanfont/headscale into main 2021-10-13 23:23:12 +02:00
Juan Font Alonso 9a6ac6e3e6 Reword errSingleUseAuthKeyHasBeenUsed 2021-10-13 23:23:07 +02:00
Juan Font cc3e8705bd Merge branch 'main' into better-pak-management 2021-10-13 23:04:00 +02:00
Juan Font 809a5b84e7 Merge pull request #156 from juanfont/disable-version-check-on-json
Disable version checker when using JSON output
2021-10-13 23:00:51 +02:00
Juan Font 06ae2a6c50 Merge branch 'main' into better-pak-management 2021-10-13 23:00:38 +02:00
Juan Font 93517aa6f8 Apply suggestions from code review
Renamed AlreadyUsed to Used

Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2021-10-13 22:51:55 +02:00
Juan Font 5f0f3705c0 Merge branch 'main' into disable-version-check-on-json 2021-10-13 22:44:18 +02:00
Juan Font 70ae18c3a8 Merge pull request #155 from juanfont/fix-json-delete-node
Add JSON output when deleting node
2021-10-13 22:44:00 +02:00
Juan Font Alonso 6aa763a1ae Expanded unit tests to better cover sharing nodes 2021-10-13 20:56:32 +02:00
Juan Font Alonso ebfb8c8c5e Fix tests, as IDs of Machines where wrongly starting in 0 2021-10-13 20:48:50 +02:00
Juan Font Alonso 30788e1a70 Add AlreadyUsed field to Auth Keys (fixes #157 and #158) 2021-10-13 18:13:26 +02:00
Juan Font Alonso 27947c6746 This commit disables the version checker when JSON output (#153) 2021-10-13 00:18:55 +02:00
Juan Font Alonso 6924b7bf4c Output json when deleting node (fixes #152) 2021-10-12 23:48:08 +02:00
Juan Font Alonso fa8cd96108 Get peers from namespaces where shared nodes are shared to
This is rather shameful. Shared nodes should have never worked without this.
2021-10-12 17:20:14 +02:00
Juan Font dd1e425d02 Merge pull request #147 from juanfont/fix-delete-shared-nodes
Fix error 500 when deleting a shared node
2021-10-11 18:19:36 +02:00
Juan Font Alonso 7f2027d7f2 Added unit tests 2021-10-10 23:55:18 +02:00
Juan Font Alonso 48f5a9a18c Fix error 500 when deleting shared node (fixes #133) 2021-10-10 23:55:03 +02:00
Raal Goff 8843188b84 add notes to README.md about OIDC 2021-10-10 22:52:30 +08:00
Kristoffer Dalby 087c461762 Merge pull request #145 from juanfont/discord
Remove gitter for discord
2021-10-10 12:24:50 +01:00
Juan Font d579c1718c Merge branch 'main' into discord 2021-10-10 13:05:33 +02:00
Juan Font 4c5f667504 Merge pull request #129 from juanfont/magic-dns-support
Add support for MagicDNS
2021-10-10 13:05:16 +02:00
Kristoffer Dalby 4c4c95198b Remove gitter for discord 2021-10-10 12:00:45 +01:00
Juan Font Alonso 5ce1526a06 Do not return a pointer 2021-10-10 12:43:41 +02:00
Juan Font Alonso d70c3d6189 Added more comments, plus renamed vars with better names 2021-10-10 12:34:55 +02:00
Raal Goff 74e6c1479e updates from code review 2021-10-10 17:22:42 +08:00
Juan Font Alonso 9a0c9768ad Merge branch 'magic-dns-support' of https://github.com/juanfont/headscale into magic-dns-support 2021-10-10 00:40:35 +02:00
Juan Font Alonso 6884798404 Added some comments 2021-10-10 00:40:25 +02:00
Juan Font c4487b73c4 Merge branch 'main' into magic-dns-support 2021-10-09 12:24:07 +02:00
Juan Font Alonso 32c3f09eb4 Fixed conflict 2021-10-09 12:23:05 +02:00
Juan Font Alonso d4dc133e20 Added unit tests 2021-10-09 12:22:21 +02:00
Juan Font Alonso fc5153af3e Generate MagicDNS search domains for any tailnet range 2021-10-09 12:22:13 +02:00
Kristoffer Dalby 2997f4d251 Merge branch 'main' into main 2021-10-08 22:21:41 +01:00
Raal Goff e407d423d4 updates from code review 2021-10-08 17:43:52 +08:00
unreality 35795c79c3 Handle trailing slash on uris
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2021-10-08 15:26:31 +08:00
Kristoffer Dalby fd8d888ddb Merge pull request #142 from kradalby/loopy-loop 2021-10-07 16:08:33 +01:00
Kristoffer Dalby 06f56411dd Update machine.go 2021-10-07 15:45:45 +01:00
Kristoffer Dalby e4f197b709 Merge branch 'main' into loopy-loop 2021-10-07 15:38:17 +01:00
Kristoffer Dalby 13406175c1 Merge pull request #144 from zekker6/main 2021-10-07 14:22:35 +01:00
Zakhar Bessarab 20117c51a2 Add CI builds with artifacts for PRs and main 2021-10-07 11:50:47 +03:00
Kristoffer Dalby f0c54490ed Allow multiple namespaces to be checked for state at the same time 2021-10-06 22:06:07 +00:00
Kristoffer Dalby 95f726fb31 Fix logic 2021-10-06 19:56:14 +00:00
Kristoffer Dalby ba391bc2ed Account for updates in shared namespaces 2021-10-06 19:32:15 +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
Kristoffer Dalby c582c8d206 Update metrics for new code 2021-10-05 21:59:15 +00:00
Juan Font 1a0f6f6e39 Added note on TODO 2021-10-05 19:01:56 +02:00
Juan Font 6981543db6 Only search domain from current namespace in MapResponse 2021-10-05 19:00:40 +02:00
Kristoffer Dalby 722084fbd3 Comment out aggressive logging 2021-10-05 16:51:42 +00:00
Kristoffer Dalby a01a0d1039 Remove unstable update channel, replace with state updates 2021-10-05 16:24:46 +00:00
Kristoffer Dalby 8abc7575cd Tear out all the complicated update logic
There is some weird behaviour that seem to storm the update channel. And
our solution with a central map of update channels isnt particularly
elegant.

For now, replace all the complicated stuff with a simple channel that
checks roughly every 10s if the node is up to date. Only generate and
update if there has been changes.
2021-10-05 16:17:18 +00:00
Juan Font c9a411e341 Preload namespace 2021-10-05 17:47:21 +02:00
Juan Font Alonso b02a9f9769 Go mod updates 2021-10-04 23:50:26 +02:00
Juan Font Alonso a0fa652449 MagicDNS changes merged back 2021-10-04 23:49:16 +02:00
Juan Font Alonso 2eef535b4b Merged main 2021-10-04 23:43:42 +02:00
Juan Font Alonso 61870a275f WIP preparation for merge 2021-10-04 22:51:05 +02:00
Juan Font Alonso 088e8248d3 Improved doc 2021-10-04 22:50:33 +02:00
Juan Font Alonso da4a9dadd5 Warn users when MagicDNS is set with no DNS servers 2021-10-04 22:16:53 +02:00
Juan Font 02bc7314f4 Update dns.go
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2021-10-04 21:47:09 +02:00
Kristoffer Dalby 6fb8d67825 Merge pull request #136 from kradalby/db-cleaning
Code, pointer, variable cleanups. And metrics!
2021-10-04 20:44:54 +01:00
Juan Font Alonso 1a41a9f2c7 Updated readme 2021-10-04 20:27:45 +02:00
Juan Font 040a18e6f8 Merge branch 'main' into magic-dns-support 2021-10-04 19:45:12 +02:00
Juan Font Alonso ec911981c2 Do not allow magicdns if not nameservers set up 2021-10-04 19:43:58 +02:00
Kristoffer Dalby f6a7564ec8 Add more test cases to prove that peers and shared peers work properly 2021-10-04 17:40:21 +00:00
Kristoffer Dalby 2eb57e6288 Clean up pointer usage consistency.
This tries to make the same functions emit and consume the same type of
data all over the application.

If a function transform data, it should emit new data, not a pointer.
2021-10-04 17:39:01 +00:00
Kristoffer Dalby 94ba5181fc Resolve merge conflict 2021-10-04 16:38:52 +00: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
Juan Font Alonso ef0f7c0c09 Integration tests for MagicDNS working 2021-10-04 18:04:08 +02:00
Juan Font Alonso e60ceefea9 Fixing nil issue 2021-10-04 18:03:44 +02:00
Kristoffer Dalby ed6b5bc279 Merge pull request #141 from ptman/patch-1 2021-10-04 15:40:29 +01:00
Kristoffer Dalby d3ef39a58f Correctly use the internal docker dns and port for headscale joining 2021-10-04 14:39:52 +00:00
Kristoffer Dalby 07e32be5ce Remove host port, we only need internal ports 2021-10-04 14:39:28 +00:00
Paul Tötterman ed0b31d072 Update README.md
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2021-10-04 17:23:38 +03:00
Paul Tötterman fcc6991d62 Update README.md
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2021-10-04 17:23:31 +03:00
Kristoffer Dalby c09428acca Revert "Remove docker network, it wasnt used, comment out portmapping to host"
This reverts commit 2090a13dcd.
2021-10-04 14:09:21 +00:00
Kristoffer Dalby 931ef9482b Add checks to see if we can fetch the ip from map, remove possible null assignment 2021-10-04 14:17:05 +01:00
Kristoffer Dalby 772541afab add comment about poor error handling when headscale isnt becoming available 2021-10-04 14:16:37 +01:00
Kristoffer Dalby 2090a13dcd Remove docker network, it wasnt used, comment out portmapping to host 2021-10-04 14:15:20 +01:00
Kristoffer Dalby 31b4f03f96 Set integration logging to trace 2021-10-04 14:14:28 +01:00
Kristoffer Dalby 7793012409 Add error if peer api is empty 2021-10-04 14:14:12 +01:00
Paul Tötterman 566c2bc1fb Document client OS support in a table 2021-10-04 14:58:36 +03:00
Juan Font 99efeb98f8 Merge pull request #139 from cure/fix-goreleaser-version
Make sure that goreleaser uses the appropriate version string when
2021-10-04 00:17:13 +02:00
Juan Font 836ee74e57 Merge branch 'main' into fix-goreleaser-version 2021-10-04 00:01:58 +02:00
Juan Font 06689ed726 Merge pull request #140 from qbit/buypass
Add the ability to specify the directory URL used for ACME.
2021-10-04 00:01:29 +02:00
Aaron Bieber 817cc1e567 these are not files! 2021-10-03 14:02:44 -06:00
Aaron Bieber 8fa0fe65ba Add the ability to specify registration ACME email and ACME URL. 2021-10-03 12:26:38 -06:00
Ward Vandewege 1d81333685 Make sure that goreleaser uses the appropriate version string when
building the headscale executable.
2021-10-03 14:00:08 -04:00
Kristoffer Dalby 1bddf1147b Resolve merge conflict 2021-10-03 11:01:13 +01:00
Kristoffer Dalby 63fa475913 Merge pull request #134 from kradalby/loop-97 2021-10-02 23:13:41 +01:00
Kristoffer Dalby d637a9c302 Change ping count 2021-10-02 22:56:48 +01:00
Kristoffer Dalby 3c3189caa6 Move toNode, add type helpers, split peers and shared
This commit moves toNode to the bottom of the file, and adds a helper
function for lists of Machines to be converted.

It also adds string helpers for Machines and lists of machines.

Lastly it splits getPeers into getDirectPeers, which exist in the same
namespace, and getShared, which is nodes shared with the namespace.

getPeers is kept as a function putting together the two lists for
convenience.
2021-10-02 22:03:34 +01:00
Kristoffer Dalby 0d4a006536 Consitently use Machine pointers
This commit rewrites a bunch of the code to always use *Machine instead
of a mix of both, and a mix of tailcfg.Node and Machine.

Now we use *Machine, and if tailcfg.Node is needed, it is converted just
before needed.
2021-10-02 22:00:09 +01:00
Kristoffer Dalby 0475eb6ef7 Move DB call of pollmap to Machine inside a function 2021-10-02 21:58:28 +01:00
Kristoffer Dalby 0d1b60ad63 Merge branch 'loop-97' of github.com:kradalby/headscale into loop-97 2021-10-02 18:39:18 +01:00
Kristoffer Dalby 78a0f3ca37 Up ping timeout 2021-10-02 18:39:09 +01:00
Kristoffer Dalby 2c83eac36f Merge branch 'main' into loop-97 2021-10-02 18:37:21 +01:00
Kristoffer Dalby 42913e2c37 Merge pull request #135 from cure/fix-README-typos
Fix a few typos in the tailscale command line arguments.
2021-10-02 17:46:25 +01:00
Kristoffer Dalby 54daa0da23 Fix spelling error 2021-10-02 17:35:39 +01:00
Ward Vandewege 0435089eba Fix a few typos in the tailscale command line arguments. 2021-10-02 10:44:52 -04:00
Kristoffer Dalby 39abc4e973 Clarify error messages for nodes that are not connected
If a node does not have an update channel, it is probably not connected,
clarify the log messages and make sure we dont print that it was updated
successfully (continue, not return)
2021-10-02 15:38:53 +01:00
Kristoffer Dalby cefe2d5bcc Improve and clarify log entry 2021-10-02 15:30:41 +01:00
Kristoffer Dalby ed728f57e0 Remove WriteTimeout from HTTP
Golangs built in HTTP server does not allow different HTTP timeout for
different types of handlers, so we cannot have a write timeout as we
attempt to do long polling (my bad).

See linked article.

Also removed redundant server declaration
2021-10-02 15:29:27 +01:00
Kristoffer Dalby 6ffea2225d Attempt to close failed streams
If we have a failed write toward any of our connections, attempt to
close the connection by returning "false" as in unsuccessful stream
2021-10-02 15:28:19 +01:00
Juan Font Alonso 64185cc2bc Fixed go mod 2021-10-02 15:18:05 +02:00
Juan Font 990ff153c0 Merge branch 'main' into magic-dns-support 2021-10-02 15:16:51 +02:00
Juan Font Alonso 47dcc940c0 Fixed issue in tests 2021-10-02 14:49:14 +02:00
Juan Font Alonso 8d60ae2c7e Tidy gomod 2021-10-02 13:03:41 +02:00
Juan Font Alonso 19492650d4 Fixed error on assign 2021-10-02 13:03:08 +02:00
Juan Font Alonso 36ae14bccf Send search domains 2021-10-02 12:13:19 +02:00
Juan Font Alonso 45e71ecba0 Generated MagicDNS search domains (only in 100.64.0.0/10) 2021-10-02 12:13:05 +02:00
Juan Font Alonso e432e98413 Send hostname in toNode 2021-10-02 12:12:22 +02:00
Juan Font Alonso 656237e167 Propagate dns config vales across Headscale 2021-10-02 11:20:42 +02:00
Juan Font Alonso 5dbf6b5127 Extended DNS config unit tests 2021-10-02 11:14:18 +02:00
Juan Font Alonso c9e4da3ff5 Improving documentation for DNS config 2021-10-02 11:11:18 +02:00
Juan Font cfd4781eb4 Merge pull request #131 from Extrality/main
fix some typos in README
2021-10-01 21:36:55 +02:00
Arthur Woimbée 986725519f fix some typos in README 2021-10-01 15:59:54 +02:00
Kristoffer Dalby 0393ab524c Merge branch 'main' into main 2021-09-28 11:20:31 +01:00
Juan Font Alonso 3f3cfedffa Add support for MagicDNS 2021-09-28 00:22:29 +02:00
Juan Font e9ea698130 Merge pull request #128 from juanfont/version-checker
Added version checker on Headscale startup
2021-09-27 23:28:16 +02:00
Juan Font Alonso a6adcdafa9 Added switch to disable the update checks 2021-09-27 17:24:34 +02:00
Juan Font Alonso 7c37086dd6 Handle lack of internet 2021-09-27 17:12:31 +02: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 0bbf343348 Merge pull request #113 from kradalby/apple-mobileconfig
Apple macOS profile support
2021-09-26 21:34:11 +01:00
Kristoffer Dalby 8248b71153 Merge branch 'main' into main 2021-09-26 21:15:00 +01:00
Kristoffer Dalby 9811809f6a Resolve conflict 2021-09-26 20:51:07 +01:00
Kristoffer Dalby 237a14858a Add apple endpoint to readme 2021-09-26 20:47:39 +01:00
Kristoffer Dalby 59c3d4bcfe Comment out iOS from /apple for now 2021-09-26 20:41:48 +01:00
Juan Font 7612cc84d2 Merge pull request #122 from juanfont/taildrop-support
Add support for Taildrop (file sharing)
2021-09-26 20:40:26 +02:00
Kristoffer Dalby 4aa91bc420 Merge branch 'main' into taildrop-support 2021-09-26 19:29:00 +01:00
Juan Font Alonso c801a8c553 Improve comments on taildrop tests 2021-09-26 20:23:15 +02:00
Juan Font Alonso 5626f598ce Do several attempts to send the file 2021-09-26 18:59:23 +02:00
Juan Font Alonso 7d0da8b578 Added retries 2021-09-26 17:38:51 +02:00
Juan Font Alonso eb87fc9215 Fixed getAPIURLs method 2021-09-26 15:17:27 +02:00
Raal Goff b22a9781a2 fix linter errors, error out if jwt does not contain a key id 2021-09-26 21:12:36 +08:00
Juan Font Alonso ada40960bd Removed unnecesary prints 2021-09-26 14:33:01 +02:00
Juan Font Alonso 83ead36fce Integration tests working for taildrop 2021-09-26 14:22:11 +02:00
Juan Font 05a5f21c3d Use curl to uploaded the file 2021-09-26 12:22:59 +02:00
Raal Goff e7a2501fe8 initial work on OIDC (SSO) integration 2021-09-26 16:53:05 +08:00
Juan Font a36328dbfc Added integration tests 2021-09-25 13:12:44 +02:00
Juan Font cab5641d95 Update readme 2021-09-24 09:50:01 +02:00
Juan Font b83894abd6 Add support for taildrop (#118) 2021-09-24 09:49:29 +02:00
Kristoffer Dalby 8e588ae146 Add a more comprehensive macOS explaination 2021-09-23 20:22:07 +01:00
Juan Font 83815f567d Merge pull request #109 from juanfont/tailscale-1.14
Update to Tailscale 1.14
2021-09-23 16:44:51 +02:00
Kristoffer Dalby 7db91c68be Merge pull request #121 from juanfont/main
New integration test for tailscale 1.14
2021-09-23 14:51:26 +01:00
Juan Font 109115c13b Merge pull request #120 from t56k/main
Fix namespace instructions in README.md
2021-09-23 09:55:57 +02:00
t56k 11e0402396 create a db file first 2021-09-23 17:14:04 +12:00
t56k fd94105483 fix namespace instructions in README.md 2021-09-23 16:32:15 +12:00
Juan Font 96e8142540 Merge pull request #114 from kradalby/integration-tests-improvement
Improve integration tests
2021-09-22 14:51:47 +02:00
Kristoffer Dalby 9615138202 Remove non working default 2021-09-21 11:10:26 +01:00
Juan Font 9900b215cc Merge pull request #115 from ohdearaugustin/topic/fix-docu
Topic/fix docu
2021-09-21 09:19:09 +02:00
Kristoffer Dalby d5ea224e11 Merge pull request #116 from ohdearaugustin/topic/docker-release-tag 2021-09-20 23:34:44 +01:00
Kristoffer Dalby 024d6ee7c3 Initial work on shared node integration test
This commit adds initial integration tests for shared nodes, it adds
them and verifies that they are shared.

It does not yet manage to ping the shared node because it does not seem
to establish the connection.
2021-09-20 23:21:25 +01:00
ohdearaugustin f653b00258 workflows/release: add docker full version tag 2021-09-21 00:10:00 +02:00
ohdearaugustin ff1ee4ca64 Fix README whitespace 2021-09-21 00:02:54 +02:00
ohdearaugustin 830aa250e1 Fix README formating 2021-09-21 00:01:18 +02:00
ohdearaugustin f0bbc3c7d8 Fix docker docu 2021-09-20 23:53:52 +02:00
Kristoffer Dalby 994b4eef17 Use JSON output and proper datamodel for tailscale status
This commit uses tailscale --json to check status, and unmarshal it into
the proper ipn Status.
2021-09-20 22:53:34 +01:00
Kristoffer Dalby f905812afa Test two namespaces
This expands the tests to verify two namespaces instead of only one.

It verifies some of the isolation, and is prework for shared nodes
testing
2021-09-20 20:18:28 +01:00
Kristoffer Dalby d68d201722 Add version support to integration support
This commit adds a list of tailscale versions to use in the integration
test. An equal distribution of versions will be used across the clients.
2021-09-20 19:23:18 +01:00
Juan Font da209e89a7 Update README.md
Fixed typo (causing #110)
2021-09-20 18:42:04 +02:00
Juan Font 7940dbc78b Merge pull request #111 from woudsma/main
fix typo
2021-09-20 18:37:52 +02:00
Juan Font 4d22b4252f Merge pull request #108 from ohdearaugustin/topic/docker-image-version
Dockerfile: add golang tag
2021-09-20 18:37:22 +02:00
Kristoffer Dalby b3efd1e47b Handle errors 2021-09-20 07:54:18 +01:00
Kristoffer Dalby 2d39d6602c Merge remote-tracking branch 'upstream/main' into apple-mobileconfig 2021-09-19 18:00:40 +01:00
Kristoffer Dalby dfcab2b6d5 Wire up new handlers 2021-09-19 17:56:29 +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
Kristoffer Dalby bf26e37e0e Merge pull request #112 from fkr/main 2021-09-19 11:19:35 +01:00
Felix Kronlage-Dammers e154e7a0fb fix typo, it is 'relayed' not 'relied' 2021-09-19 12:07:17 +02:00
Tjerk Woudsma b28ebb5d20 fix typo 2021-09-18 12:34:04 +02: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 8f1f48b7d0 Update README.md
Remove Google registry for the time being
2021-09-13 23:11:15 +02:00
Juan Font 536e8b71bf Removed wrong syntax in actions 2021-09-13 22:59:33 +02:00
Juan Font acc43c39af Increased linter timeout in makefile 2021-09-13 22:58:35 +02:00
Juan Font eae1b6a3de More timeout in linting 2021-09-13 22:51:58 +02:00
Juan Font 31cc61478f More timeout in linting 2021-09-13 22:47:38 +02:00
Juan Font 3095c1e150 Trying to correct Actions issues 2021-09-13 22:45:31 +02:00
Juan Font e1d5da5bd9 Merge pull request #107 from qbit/no_color_trace
Remove trace lines about NO_COLOR.
2021-09-13 22:38:37 +02:00
Juan Font 5f818b7349 Merge pull request #89 from ohdearaugustin/topic/docker-release
Topic/docker release
2021-09-13 22:37:33 +02:00
ohdearaugustin 0aac79f8fa Dockerfile: add golang tag 2021-09-13 20:03:03 +02:00
ohdearaugustin 1e93347a26 Merge branch 'main' into topic/docker-release 2021-09-12 18:18:34 +02:00
ohdearaugustin 18867a4c84 update docu 2021-09-12 18:08:43 +02:00
ohdearaugustin 3b97c7bdec gitignore: add jetbrains 2021-09-12 18:08:43 +02:00
Aaron Bieber 203e6bc6b2 Remove trace lines about NO_COLOR. 2021-09-12 07:30:35 -06:00
Juan Font e27753e46e Merge pull request #103 from juanfont/shared-nodes
Add support for sharing nodes across namespaces
2021-09-11 23:31:37 +02:00
Juan Font 11fbef4bf0 Added extra timeout 2021-09-11 23:21:45 +02:00
Juan Font c4e6ad1ec7 Fixed some typos 2021-09-10 00:52:08 +02:00
Juan Font 263a3f1983 Merge branch 'main' into shared-nodes 2021-09-10 00:49:50 +02:00
Juan Font 8acaea0fbe Increased timeout 2021-09-10 00:44:27 +02:00
Juan Font bd6adfaec6 Changes a few more variables 2021-09-10 00:37:01 +02:00
Juan Font 4b4a5a4b93 Update sharing.go
Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2021-09-10 00:32:42 +02:00
Juan Font b098d84557 Apply suggestions from code review
Changed more variable names

Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2021-09-10 00:32:06 +02:00
Juan Font b937f9b762 Update machine.go
Added comment on toNode
2021-09-10 00:30:02 +02:00
Juan Font 55f3e07bd4 Apply suggestions from code review
Removed one letter variables

Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2021-09-10 00:26:46 +02:00
Juan Font 2780623076 Renamed SharedNode to SharedMachine 2021-09-06 14:43:43 +02:00
Juan Font 75a342f96e Renamed files 2021-09-06 14:40:37 +02:00
Juan Font 729cd54401 Renamed sharing function 2021-09-06 14:39:52 +02:00
Juan Font a023f51971 Merge pull request #101 from SilverBut/main
fix: check last seen time without possible null pointer
2021-09-03 10:35:49 +02:00
Juan Font 5076eb9215 Merge pull request #102 from SilverBut/patch-1
docs: add notes on how to build own DERP server
2021-09-03 10:24:32 +02:00
Juan Font 7edd0cd14c Added add node cli 2021-09-03 10:23:45 +02:00
Juan Font 7ce4738d8a Preload namespace so the name can be shown 2021-09-03 10:23:26 +02:00
Juan Font 7287e0259c Minor linting issues 2021-09-02 17:08:39 +02:00
Juan Font d86de68b40 Show namespace in node list table 2021-09-02 17:06:47 +02:00
Juan Font 4ba107a765 README updated 2021-09-02 17:00:46 +02:00
Juan Font 187b016d09 Added helper function to get list of shared nodes 2021-09-02 16:59:50 +02:00
Juan Font 7010f5afad Added unit tests on sharing nodes 2021-09-02 16:59:12 +02:00
Juan Font 48b73fa12f Implement node sharing functionality 2021-09-02 16:59:03 +02:00
Juan Font 1ecd0d7ca4 Added DB SharedNode model to support sharing nodes 2021-09-02 16:57:26 +02:00
Silver Bullet 6faaae0c5f docs: add notes on how to build own DERP server
The official doc is hidden under a bunch of issues. Add a doc link here and hope it could be helpful.
2021-09-02 06:08:12 +08:00
Silver Bullet e4ef65be76 fix: check last seen time without possible null pointer 2021-09-02 05:44:42 +08:00
Juan Font 39c661d408 Merge pull request #99 from juanfont/explicit-ubuntu-version
Use explicit version in Dockerfile
2021-08-26 21:18:16 +02:00
Juan Font 91a48d6a43 Update Dockerfile
Use explicit version in Dockerfile (addresses #95)
2021-08-26 10:23:45 +02:00
Kristoffer Dalby 123f0fa185 Merge pull request #98 from kradalby/initial-dns-server-exit-node 2021-08-25 22:58:25 +01:00
Kristoffer Dalby ba3dffecbf Update readme 2021-08-25 19:05:10 +01:00
Kristoffer Dalby 8735e5675c Add a test for the getdnsconfig function 2021-08-25 19:03:04 +01:00
Kristoffer Dalby 3f5e06a0f8 Dont add the portnumber to the ip 2021-08-25 18:43:13 +01:00
Juan Font ba40a40b73 Merge pull request #96 from qbit/version_fix
Fix setting of version
2021-08-25 12:34:34 +02:00
Kristoffer Dalby b3732e7fb9 Add nameserver as resolver aswell 2021-08-25 07:04:48 +01:00
Aaron Bieber 104776ee84 fix setting of version 2021-08-24 07:49:15 -06:00
Kristoffer Dalby 01e781e546 Pass DNSConfig to nodes in MapResponse 2021-08-24 07:11:45 +01:00
Kristoffer Dalby e77c16b55a Add DNSConfig to example and setup test 2021-08-24 07:10:09 +01:00
Kristoffer Dalby 987bbee1db Add DNSConfig field to configuration 2021-08-24 07:09:47 +01:00
Juan Font 74d2fe1baa Merge pull request #84 from kradalby/integration-tests-ci
Improve logic to keep nodes up to date with the network state
2021-08-23 09:42:07 +02:00
Kristoffer Dalby 98e63d5561 Merge pull request #94 from kradalby/split-lint-test
Split lint and test CI files
2021-08-23 07:46:11 +01:00
Kristoffer Dalby 059f13fc9d Add missing comment for stream function 2021-08-23 07:38:14 +01:00
Kristoffer Dalby ebd27b46af Add comment to updatemachine 2021-08-23 07:35:44 +01:00
Juan Font ca8d814918 Merge pull request #92 from kradalby/enhance-route-command
Enhance route command with ptables and multiple routes
2021-08-22 12:48:30 +02:00
Kristoffer Dalby 0aeeaac361 Always load machine object from DB before save/modify
We are currently holding Machine objects in memory for a long time,
while waiting for stream/longpoll, this might make us end up with stale
objects, that we just call save on, potentially overwriting stuff in
the database.

A typical scenario would be someone changing something from the CLI,
e.g. enabling routes, which in turn is overwritten again by the stale
object in the longpolling function.

The code has been left with TODO's and a discussion is available in #93.
2021-08-21 16:52:19 +01:00
Kristoffer Dalby 28ed8a5742 Actually rename lint 2021-08-21 15:42:23 +01:00
Kristoffer Dalby f749be1490 Split lint and test CI files
This commit splits the lint and test steps into two different jobs in
github actions.

Consider this a suggestion, the idea is that when we look at PRs we will
see explicitly which one of the two types of checks fails without having
to open Github actions.
2021-08-21 15:40:27 +01:00
Kristoffer Dalby 693bce1b10 Update test machine name properly 2021-08-21 15:35:26 +01:00
Kristoffer Dalby 4f97e077db Add --all flag to routes enable command to enable all advertised routes 2021-08-21 15:04:30 +01:00
Kristoffer Dalby c883e79884 Enhance route command with ptables and multiple routes
This commit rewrites the `routes list` command to use ptables to present
a slightly nicer list, including a new field if the route is enabled or
not (which is quite useful).

In addition, it reworks the enable command to support enabling multiple
routes (not only one route as per removed TODO). This allows users to
actually take advantage of exit-nodes and subnet relays.
2021-08-21 14:49:46 +01:00
ohdearaugustin a613501ff2 Update .github/workflows/release.yml
Fix typo

Co-authored-by: Kristoffer Dalby <kradalby@kradalby.no>
2021-08-21 11:17:21 +02:00
Kristoffer Dalby a054e2514a Keep tailscale count at 25 in integration tests 2021-08-21 09:26:18 +01:00
Kristoffer Dalby c49fe26da7 Code clean up, loglevel debug for integration tests 2021-08-21 09:15:16 +01:00
ohdearaugustin 75afdc6306 github/workflows: remove version tag 2021-08-20 20:10:34 +02:00
ohdearaugustin f02beaf075 github/workflows: add checkout 2021-08-20 19:45:01 +02:00
ohdearaugustin 8bcc7e88f0 github/workflows: add dispatch 2021-08-20 19:37:15 +02:00
ohdearaugustin 0adbd720bf github/workflows: add docker release 2021-08-20 19:15:20 +02:00
Kristoffer Dalby d93a7f2e02 Make Info default log level 2021-08-20 17:15:07 +01:00
Kristoffer Dalby 88d7ac04bf Account for racecondition in deleting/closing update channel
This commit tries to address the possible raceondition  that can happen
if a client closes its connection after we have fetched it from the
syncmap before sending the message.

To try to avoid introducing new dead lock conditions, all messages sent
to updateChannel has been moved into a function, which handles the
locking (instead of calling it all over the place)

The same lock is used around the delete/close function.
2021-08-20 16:52:34 +01:00
Kristoffer Dalby 1f422af1c8 Save headscale logs if jobs fail 2021-08-20 16:50:55 +01:00
Kristoffer Dalby 53168d54d8 Make http timeout 30s instead of 10s 2021-08-19 22:29:03 +01:00
Kristoffer Dalby b0ec945dbb Make lastStateChange namespaced 2021-08-19 18:19:26 +01:00
Kristoffer Dalby 48ef6e5a6f Rename keepAlive function, as it now does more things 2021-08-19 18:06:57 +01:00
Kristoffer Dalby 8d1adaaef3 Move isOutdated logic to updateChan consumation 2021-08-19 18:05:33 +01:00
Kristoffer Dalby dd8c0d1e9e Move most "poll" functionality to poll.go
This function migrates more poll functions (including keepalive) to
poll.go to keep it somehow in the same file.

In addition it makes changes to improve the stability and ensure nodes
get the appropriate updates from the headscale control and are not left
in an inconsistent state.

Two new additions is:

omitpeers=true will now trigger an update if the clients are not already up
to date

keepalive has been extended with a timer that will check every 120s if
all nodes are up to date.
2021-08-18 23:24:22 +01:00
Kristoffer Dalby 57b79aa852 Set timeout, add lastupdate field
This commit makes two reasonably major changes:

Set a default timeout for the go HTTP server (which gin uses), which
allows us to actually have broken long poll sessions fail so we can have
the client re-establish them.
The current 10s number is chosen randomly and we need more testing to
ensure that the feature work as intended.

The second is adding a last updated field to keep track of the last time
we had an update that needs to be propagated to all of our
clients/nodes. This will be used to keep track of our machines and if
they are up to date or need us to push an update.
2021-08-18 23:21:11 +01:00
Kristoffer Dalby 2f883410d2 Add lastUpdate field to machine, function issue message on update channel
This commit adds a new field to machine, lastSuccessfulUpdate which
tracks when we last was able to send a proper mapupdate to the node. The
purpose of this is to be able to compare to a "global" last updated time
and determine if we need to send an update map request to a node.

In addition it allows us to create a scheduled check to see if all known
nodes are up to date.

Also, add a helper function to send a message to the update channel of a
machine.
2021-08-18 23:17:38 +01:00
Kristoffer Dalby 6fa61380b2 Up client count, make arguments more explicit and clean up unused assignments 2021-08-18 23:17:09 +01: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 d739ac830f Merge pull request #87 from juanfont/fix-route-notify
Send notifications when enabling a route
2021-08-16 09:25:31 +02:00
Juan Font 26024fedc7 Merge branch 'main' into fix-route-notify 2021-08-16 00:29:38 +02:00
Juan Font a376b697c0 Send notifications when enabling a route 2021-08-16 00:17:26 +02:00
Juan Font bc2574680d Linting 2021-08-15 23:35:03 +02:00
Juan Font f194b41435 Better table in preauthkeys 2021-08-15 23:29:55 +02:00
Juan Font 350f7da55d Better table in namespaces 2021-08-15 23:20:38 +02:00
Juan Font 36f5f78f46 pterm dependency 2021-08-15 23:10:50 +02:00
Juan Font 55fe5b0b41 Use pterm table in node list 2021-08-15 23:10:39 +02:00
Kristoffer Dalby 7d1a5c00a0 Try with longer timeout 2021-08-13 16:56:28 +01:00
Kristoffer Dalby 036061664e initial integration test file 2021-08-13 16:12:01 +01:00
Kristoffer Dalby 5b1b40ce93 Merge pull request #83 from kradalby/more-integration-tests
Improve reliability of PollMapHandler, more integration tests
2021-08-13 16:05:32 +01:00
Kristoffer Dalby a8d9fdce3c Uncomment ping test 2021-08-13 11:01:23 +01:00
Kristoffer Dalby 700382cba4 Split stream part of pollhandlermap into its own func 2021-08-13 10:33:50 +01:00
Kristoffer Dalby 9698abbfd5 Resolve merge conflict 2021-08-13 10:33:19 +01:00
Juan Font 5bfcf5c917 Merge pull request #82 from juanfont/really-expire-ephemeral
Also notify peers when deleting ephemerals
2021-08-12 22:05:53 +02:00
Juan Font 8eb7d47072 Fixed linting 2021-08-12 21:57:20 +02:00
Juan Font ab61c87701 Also notify peers when deleting ephemerals 2021-08-12 21:53:37 +02:00
Juan Font c1e6157847 Expire ephemeral is internal 2021-08-12 21:45:40 +02:00
Juan Font 4c849539fc Expire the ephemeral nodes in the Serve method 2021-08-12 21:44:12 +02:00
Juan Font 9c2a630055 Merge pull request #81 from kradalby/integration-tests
Add Integration tests
2021-08-12 11:15:45 +02:00
Kristoffer Dalby 0e1ddf9715 Set longer timeout for integration tests 2021-08-12 07:36:38 +01:00
Kristoffer Dalby 54da1a4155 Commit the correct integration etc files 2021-08-12 07:05:26 +01:00
Kristoffer Dalby 7141e2ed70 Fix hostname passed to join command 2021-08-11 17:12:39 +01:00
Kristoffer Dalby c9e5048015 Merge remote-tracking branch 'upstream/main' into integration-tests 2021-08-08 17:57:28 +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 f973aef80c Add Dockerfile to build tailscale docker image for integration tests 2021-08-08 17:43:06 +01:00
Kristoffer Dalby a43bb1bb40 Improve Dockerfile
This commit makes several changes to the dockerfile:

- Add go.mod and go.sum in a seperate stage, subsequently calling `go
  mod download` to make it cache dependencies and speed up builds
- Use ubuntu:latest (28MB larger) instead of scratch, makes the image a
  lot easier to debug (e.g. it has a shell and a package manager)
- Change ENTRYPOINT to CMD, this makes the behaviour of the image
  slightly different from a CLI perspective, but makes interacting with
  the image from code, docker-compose and kubernetes easier.
2021-08-08 17:39:39 +01:00
Kristoffer Dalby d86123195c Add a dockerignore file to speed up builds and make cachine better 2021-08-08 17:38:44 +01:00
Kristoffer Dalby 91ffd10192 Remove "Keys: " from create auth key output
This is based on the premis that "the user know what command they
executed" and therefor know that the output is the key.

This makes the command a lot more useful in scripts.
2021-08-08 17:37:23 +01:00
Kristoffer Dalby 642c7824a7 Add trace log for machine failing to parce ip in toNode 2021-08-08 17:37:04 +01:00
Kristoffer Dalby 149279f3d5 Add health endpoint
Allow us to tell when the server is up and running and can answer
requests
2021-08-08 17:36:25 +01:00
Juan Font 275214920f Merge pull request #80 from juanfont/delete-pak
Add CLI command to mark preauthkeys as expired
2021-08-08 10:52:18 +02:00
Juan Font 0124899759 fixed linting x 2 2021-08-08 00:14:10 +02:00
Juan Font 033136cb9a fixed linting 2021-08-08 00:13:44 +02:00
Juan Font 05e08e0ac7 Added cmd to expire preauth keys (requested in #78) 2021-08-08 00:10:30 +02:00
Juan Font 226cb89d97 Added func to expire PAKs 2021-08-07 23:57:52 +02:00
Juan Font 3007c0ec4f Merge pull request #79 from felixonmars/patch-1
Correct a typo in routes.go
2021-08-07 20:02:16 +02:00
Felix Yan 3fa1ac9c79 Correct a typo in routes.go 2021-08-08 01:52:01 +08:00
Juan Font bb2ccfddd9 Merge pull request #77 from kradalby/deadlierlocks
Remove more deadlocks
2021-08-07 01:05:01 +02:00
Kristoffer Dalby 99fd126219 Remove unused mutex 2021-08-06 21:11:38 +01:00
Kristoffer Dalby 15b8c8f4c5 Remove lock from keepAlive 2021-08-06 20:08:51 +01:00
Kristoffer Dalby 4243885246 Rewrite old lock error msg 2021-08-06 20:03:25 +01:00
Kristoffer Dalby 5bc5c5dc1b Remove forgotten lock 2021-08-06 20:02:47 +01:00
Juan Font db4f49901e Merge pull request #76 from kradalby/no-color-logs
Try to detect color support, make color configurable
2021-08-06 08:40:54 +02: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
Juan Font 8a614dabc0 Headscale is from no-juan 2021-08-06 00:23:07 +02:00
Juan Font c95cf15731 Fixed log message 2021-08-06 00:21:34 +02:00
Juan Font e7ce902f9d Merge pull request #75 from kradalby/syncmap
Fix deadlock issue
2021-08-06 00:19:34 +02:00
Juan Font d421c7b665 Merge pull request #74 from kradalby/deadlock-logging
Switch to a structured logger
2021-08-06 00:18:40 +02:00
Kristoffer Dalby 1abc68ccf4 Removes locks causing deadlock
This commit removes most of the locks in the PollingMap handler as there
was combinations that caused deadlocks. Instead of doing a plain map and
doing the locking ourselves, we use sync.Map which handles it for us.
2021-08-05 22:14:37 +01:00
Kristoffer Dalby 575b15e5fa Add more trace logging 2021-08-05 21:47:06 +01:00
Kristoffer Dalby a8c8a358d0 Make log keys lowercase 2021-08-05 20:57:47 +01:00
Kristoffer Dalby cd2ca137c0 Make log_level user configurable 2021-08-05 19:19:25 +01:00
Kristoffer Dalby 0660867a16 Correct url 2021-08-05 18:58:15 +01:00
Kristoffer Dalby b1200140b8 Convert cli/utils.go 2021-08-05 18:26:49 +01:00
Kristoffer Dalby d10b57b317 Convert namespaces.go 2021-08-05 18:23:02 +01:00
Kristoffer Dalby 42bf566fff Convert acls.go 2021-08-05 18:18:18 +01:00
Kristoffer Dalby 0bb2fabc6c Convert missing from api.go 2021-08-05 18:16:21 +01:00
Kristoffer Dalby ee704f8ef3 Initial port to zerologger 2021-08-05 18:11:26 +01:00
Juan Font 4aad3b7933 Improved README.md on ip_prefix 2021-08-03 20:38:23 +02:00
Juan Font 6091373b53 Merge pull request #63 from juanfont/use-kv-for-updates
Added communication between Serve and CLI using KV table
2021-08-03 20:30:33 +02:00
Juan Font 3879120967 Merge pull request #72 from kradalby/ip-pool
Make IP Prefix configurable and available ip deterministic
2021-08-03 20:27:42 +02:00
Kristoffer Dalby 465669f650 Merge pull request #1 from kradalby/ip-pool-test
Fix empty ip issue and remove network/broadcast addresses
2021-08-03 10:12:09 +01:00
Kristoffer Dalby ea615e3a26 Do not issue "network" or "broadcast" addresses (0 or 255) 2021-08-03 10:06:42 +01:00
Kristoffer Dalby d3349aa4d1 Add test to ensure we can deal with empty ips from database 2021-08-03 09:26:28 +01:00
Kristoffer Dalby 73207decfd Check that IP is set before parsing
Machine is saved to db before it is assigned an ip, so we might have
empty ip fields coming back.
2021-08-03 07:42:11 +01:00
Kristoffer Dalby eda6e560c3 debug logging 2021-08-02 22:51:50 +01:00
Kristoffer Dalby 95de823b72 Add test to ensure we can read back ips 2021-08-02 22:39:18 +01:00
Kristoffer Dalby 9f85efffd5 Update readme 2021-08-02 22:06:15 +01:00
Kristoffer Dalby b5841c8a8b Rework getAvailableIp
This commit reworks getAvailableIp with a "simpler" version that will
look for the first available IP address in our IP Prefix.

There is a couple of ideas behind this:

* Make the host IPs reasonably predictable and in within similar
  subnets, which should simplify ACLs for subnets
* The code is not random, but deterministic so we can have tests
* The code is a bit more understandable (no bit shift magic)
2021-08-02 21:57:45 +01:00
Kristoffer Dalby 309f868a21 Make IP prefix configurable
This commit makes the IP prefix used to generate addresses configurable
to users. This can be useful if you would like to use a smaller range or
if your current setup is overlapping with the current range.

The current range is left as a default
2021-08-02 20:06:26 +01:00
Juan Font 6c903d4a2f Fixed missing nodes cmd 2021-07-31 23:14:24 +02:00
Juan Font c3aa9a5d4c Merge pull request #69 from juanfont/change-default-port
Use 8080 as default port in the example config
2021-07-31 11:47:15 +02:00
Juan Font Alonso 4fb55e1684 Use 8080 as default port, like in the Kubernetes yamls 2021-07-30 17:07:19 +02:00
Juan Font Alonso 91bfb481c1 Fix identation 2021-07-30 16:42:26 +02:00
Juan Font 201ba109c3 Merge pull request #62 from ohdearaugustin/topic/refactor-config
Topic/refactor config
2021-07-30 16:40:38 +02:00
Juan Font d3f965d493 Merge pull request #66 from juanfont/remove-old-docker
Remove old docker code
2021-07-28 13:43:58 +02:00
Juan Font f832d7325b Merge pull request #67 from kradalby/patch-1
Fix typo in example
2021-07-27 19:58:15 +02:00
Kristoffer Dalby b1d1bd32c3 Fix typo in example
The example command is missing the `s` in `preauthkeys`
2021-07-27 18:37:43 +01:00
Juan Font Alonso df6d4de6fd Remove old docker code 2021-07-27 17:05:22 +02:00
Juan Font Alonso 461a893ee4 Added log message when sending updates 2021-07-25 20:47:51 +02:00
Juan Font Alonso 97f7c90092 Added communication between Serve and CLI using KV table (helps in #52) 2021-07-25 17:59:48 +02:00
ohdearaugustin ea3043cdcb cmd: Add error check for Persistent Flags 2021-07-25 16:26:15 +02:00
ohdearaugustin 04dffcc4ae Refactor cli commands 2021-07-25 15:14:09 +02:00
ohdearaugustin 3a07360b6e Add root cmd 2021-07-25 15:10:34 +02:00
ohdearaugustin b97d6f71b1 Refactor version cmd 2021-07-25 15:09:53 +02:00
ohdearaugustin 4915902e04 Refactor server cmd 2021-07-25 15:09:33 +02:00
ohdearaugustin d87a4c87cc Refactor routes cmd 2021-07-25 15:08:40 +02:00
ohdearaugustin e56755fd67 Refactor preauthkeys cmd 2021-07-25 15:07:27 +02:00
ohdearaugustin 2862c2034b Refactor nodes cmd 2021-07-25 15:04:06 +02:00
ohdearaugustin 53185eaa9e Refactor namespaces cmd 2021-07-25 15:03:45 +02:00
Juan Font b83ecc3e6e Merge pull request #61 from ohdearaugustin/topic/refactor-cli-versionCmd
Refactor cmdVersion to cli package
2021-07-25 12:00:06 +02:00
Juan Font 04fdd94201 Merge pull request #60 from cure/tls-more-readme-changes
Add some more detail to the README about the different Let's Encrypt
2021-07-25 11:38:31 +02:00
ohdearaugustin 48ec51d166 Refactor cmdVersion to cli package 2021-07-25 02:02:05 +02:00
Ward Vandewege 3260362436 Add some more detail to the README about the different Let's Encrypt
validation methods.
2021-07-24 09:20:38 -04:00
Ward Vandewege 5f60671d12 Merge pull request #59 from qbit/tls_letsencrypt_listen
Add a 'tls_letsencrypt_listen' config option
2021-07-24 09:03:04 -04:00
Aaron Bieber 69d77f6e9d Add a 'tls_letsencrypt_listen' config option
Currently the default (and non-configurable) Let's Encrypt listener will
bind to all IPs. This isn't ideal if we want to run headscale on a specific
IP only.

This also allows for one to set the listener to something other than
port 80. This is useful for OSs like OpenBSD which only allow root to
bind the lower port ranges (and don't have `setcap`) as we can now run
`headscale` as a non-privileged user while still using the baked in ACME
magic. Obviously this configuration would also require a reverse proxy
or firewall rule to redirect traffic. I attempted to outline that in the
README change.
2021-07-23 16:12:01 -06:00
Juan Font 1af9c11bdd Merge pull request #54 from juanfont/delete-nodes
Implement node deletion
2021-07-19 16:18:09 +02:00
Juan Font Alonso 57c115e60a Fix linting error: 2021-07-17 11:17:42 +02:00
Juan Font Alonso 96b4d2f391 Mark the machine as unregistered before soft delete 2021-07-17 11:12:24 +02:00
Juan Font Alonso 0f649aae8b Ask for confirmation before deleting 2021-07-17 11:09:42 +02:00
Juan Font f491db232b Merge pull request #55 from cure/letsencrypt-more-flexible-config
Turn the combination of TLS-ALPN-01 and listen_addr on a port other than
2021-07-17 11:01:08 +02:00
Ward Vandewege 9a24340bd4 Turn the combination of TLS-ALPN-01 and listen_addr on a port other than
443 into a warning, not an error, refs #53.
2021-07-16 22:02:05 -04:00
Juan Font Alonso 39b756cf55 Fixed linting 2021-07-17 00:29:14 +02:00
Juan Font Alonso 9ca2ae7fc5 Implemented delete nodes (#52) 2021-07-17 00:23:12 +02:00
Juan Font Alonso f3139d26c8 Added methods to delete nodes 2021-07-17 00:14:22 +02:00
Juan Font 6f20a1fc68 Merge pull request #51 from tianon/typo
Fix minor typo
2021-07-16 18:04:46 +02:00
Tianon Gravi 243b961cbe Fix minor typo
> Error: unknown command "namespace" for "headscale"
2021-07-16 15:07:13 +00:00
Juan Font Alonso 5748744134 Use ubuntu 18.04 as build env 2021-07-12 17:04:28 +02:00
Juan Font 31556e1ac0 Merge pull request #48 from juanfont/better-profile-info
Improving namespace/user support
2021-07-11 16:44:16 +02:00
Juan Font Alonso 0159649d0a Send the namespace name as user to the clients 2021-07-11 16:39:19 +02:00
Juan Font Alonso cf9d920e4a Minor typo 2021-07-11 15:10:37 +02:00
Juan Font Alonso 7d46dfe012 Only load ACLs if a path is present 2021-07-11 15:10:11 +02:00
Juan Font Alonso eabb1ce881 Fix minor typo on the register webpage 2021-07-11 15:05:32 +02:00
Juan Font Alonso db20985b06 Show N/A in reusable when key is ephemeral 2021-07-11 13:14:25 +02:00
Juan Font Alonso 29b80e3ca1 Fix debug mode enabled by default in db 2021-07-11 13:13:36 +02:00
Juan Font Alonso a16a763283 Update README.md with info on ACLs 2021-07-11 13:04:33 +02:00
Juan Font ad7f03c9dd Merge pull request #47 from juanfont/handle-ephemeral-reconnect
Added HTTP responses on map errors
2021-07-11 11:41:23 +02:00
Juan Font Alonso bff3d2d613 Added HTTP responses on errors 2021-07-11 11:37:17 +02:00
Juan Font f66c283756 Merge pull request #46 from Teteros/update-derp-servers
Update DERP server definitions
2021-07-10 23:29:54 +02:00
Teteros ad454d95b9 Update DERP server definitions 2021-07-10 09:00:35 +01:00
Juan Font e67a98b758 Merge pull request #44 from juanfont/acls
Add support for Policy ACLs
2021-07-07 16:19:45 +02:00
Juan Font Alonso ecf258f995 Use gorm connection pool 2021-07-04 21:56:13 +02:00
Juan Font Alonso d4b27fd54b Merge branch 'main' into acls 2021-07-04 21:54:55 +02:00
Juan Font 90e9ad9a0e Merge pull request #45 from juanfont/reuse-gorm-connection
Use gorm connection pool
2021-07-04 21:51:43 +02:00
Juan Font Alonso ff9d99b9ea Use gorm connection pool 2021-07-04 21:40:46 +02:00
Juan Font 7590dee1f2 Removed unnecessary prints 2021-07-04 13:47:59 +02:00
Juan Font 315bc6b677 Added acl path key in example config 2021-07-04 13:41:38 +02:00
Juan Font a1b8f77b1b Fixed tests 2021-07-04 13:40:45 +02:00
Juan Font 19443669bf Fixed linting issues 2021-07-04 13:33:00 +02:00
Juan Font d446e8a2fb More stuff in go.sum 2021-07-04 13:24:27 +02:00
Juan Font 202d6b506f Load ACL policy on headscale startup 2021-07-04 13:24:05 +02:00
Juan Font 401e6aec32 And more tests 2021-07-04 13:23:31 +02:00
Juan Font bd86975d10 Added missing go.mod 2021-07-04 13:10:15 +02:00
Juan Font d0e970f21d Added more unit tests 2021-07-04 13:01:41 +02:00
Juan Font 07e95393b3 Rule generation kinda working, missing tests 2021-07-04 12:35:18 +02:00
Juan Font 136aab9dc8 Work in progress in rule generation 2021-07-03 17:31:32 +02:00
Juan Font bbd6a67c46 Added more acl test hujsons 2021-07-03 17:31:08 +02:00
Juan Font 31ea67bcaf Minor addenda to README.md 2021-07-03 16:10:22 +02:00
Juan Font 5644dadaf9 Added dependency on hujson 2021-07-03 12:02:46 +02:00
Juan Font 874aa4277d Minor changes in the README.md 2021-07-03 12:01:19 +02:00
Juan Font b161a92e58 Initial work on ACLs 2021-07-03 11:55:32 +02:00
Juan Font 95fee5aa6f Merge pull request #43 from juanfont/use-plurals-for-cmds
Change all commands to plural words
2021-06-29 23:38:03 +02:00
Juan Font Alonso f5b8a3f710 Make all commands a plural word 2021-06-28 20:04:05 +02:00
Juan Font ba87ade9c5 Merge pull request #42 from juanfont/tailscale-1.8.x
Update Headscale to Tailscale 1.10
2021-06-26 18:36:46 +02:00
Juan Font Alonso aa27709e60 Update code to Tailscale 1.10 2021-06-25 18:57:08 +02:00
Juan Font Alonso 736182f651 Update dependencies, including Tailscale 1.10.x 2021-06-25 18:56:49 +02:00
Juan Font c4aa9d8aed Merge pull request #41 from juanfont/gorm2
Migrate to GORM 2.0
2021-06-25 10:00:13 +02:00
Juan Font Alonso d8e0b16512 Do not apply the FK migrations on startup 2021-06-24 23:05:26 +02:00
Juan Font Alonso d67be9ef58 go.mod updates 2021-06-24 15:49:27 +02:00
Juan Font Alonso 69ba750b38 Update Headscale to depend on gorm v2 2021-06-24 15:44:19 +02:00
Juan Font df0d214faf Merge pull request #38 from cmars/k8s
Add k8s deployment, standalone app Dockerfile.
2021-06-21 21:18:41 +02:00
Juan Font 73186eeb2f Merge pull request #40 from cmars/upstream-fix-nodes-nil-lastseen
Fix nil dereference in nodes list command.
2021-06-20 11:12:10 +02:00
Casey Marshall fdcd3bb574 Fix nil dereference in nodes list command.
Fixes a nil pointer dereference observed when listing nodes that have
not yet connected.

```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xb931a4]

goroutine 1 [running]:
github.com/juanfont/headscale/cmd/headscale/cli.glob..func8(0x13c93e0, 0xc0004c4220, 0x0, 0x2)
	/go/src/headscale/cmd/headscale/cli/nodes.go:74 +0x364
github.com/spf13/cobra.(*Command).execute(0x13c93e0, 0xc0004c41e0, 0x2, 0x2, 0x13c93e0, 0xc0004c41e0)
	/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:856 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0x13ca2e0, 0xc000497110, 0xe76416, 0x6)
	/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:960 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:897
main.main()
	/go/src/headscale/cmd/headscale/headscale.go:89 +0x805
command terminated with exit code 2
```
2021-06-19 18:20:27 -05:00
Casey Marshall c64d756ea7 Add k8s deployment, standalone app Dockerfile.
Tested with Rancher k3s. See k8s/README.md for site configuration and
deployment instructions.

Add cert-manager, tls, remote headscale script.
2021-06-18 12:45:21 -05:00
Juan Font a63fb6b007 Update README.me on how to clear tailscaled data (#37) 2021-06-17 14:22:38 +02:00
Juan Font Alonso 27e97cbd09 Use crosscompiling and enable CGO in goreleaser 2021-06-16 19:24:30 +02:00
Juan Font Alonso 39550e262c Improved readme 2021-06-16 19:05:30 +02:00
Juan Font cfef55447f Fix CI badge 2021-06-15 00:06:03 +02:00
Juan Font 9c276f33bd Change the README to include the new releases 2021-06-14 22:21:54 +02:00
Juan Font 6df90a922c Merge pull request #35 from juanfont/goreleaser
Use goreleaser to generate binary builds
2021-06-14 16:20:57 +02:00
Juan Font da8014074c Added missing goreleaser file 2021-06-14 09:17:23 +02:00
Juan Font 42e147e46f Keep make build, just as an extra test 2021-06-13 15:04:30 +02:00
Juan Font 61054638d1 Use goreleaser on new tags 2021-06-13 13:13:17 +02:00
Juan Font e085d733d5 Rename original CI pipeline to test 2021-06-13 13:12:48 +02:00
Juan Font 6e86b2af0c Merge pull request #34 from juanfont/fix-polling-race
Fix a race condition when a client closes the connection
2021-06-09 20:56:58 +02:00
Juan Font Alonso 5db7716be2 Reduce the mutex size when the client closes the connection 2021-06-09 20:55:25 +02:00
Juan Font Alonso cb1a81fe4c Close the update channel when the client actually closes the connection. Fixes #32. 2021-06-08 19:19:40 +02:00
Juan Font f2e1e42144 Merge pull request #33 from juanfont/fix-nodekey-change
Handle client sending new NodeKey
2021-06-07 09:11:12 +02:00
Juan Font Alonso aab0bfe2d5 Removed redundant statement 2021-06-05 12:21:49 +02:00
Juan Font Alonso 47b22f3950 Minor improvement on login 2021-06-05 12:19:48 +02:00
Juan Font Alonso d4c2870d7e Handle client sending new NodeKey (fixes #32) 2021-06-05 12:13:55 +02:00
Juan Font Alonso 0fcd92fcce Minor fix to help testing 2021-06-05 11:13:28 +02:00
Juan Font 094fde36d1 Merge pull request #31 from juanfont/improving-client-startup
Improving how headscale handles the client startup process
2021-05-30 00:05:40 +02:00
Juan Font Alonso 4be39f9b83 Improved log messages, and case That Should Never Happen 2021-05-26 21:39:57 +02:00
Juan Font Alonso 064e448d22 Improved tailnode start up handling 2021-05-24 21:59:03 +02:00
Juan Font d1be440c89 Merge pull request #30 from cure/bugfix-and-more-tests
a bunch of smaller fixes
2021-05-24 19:52:38 +02:00
Ward Vandewege d1c3faae5f Remove superfluous test support code. Fix bug in node list cli command.
Add tests.
2021-05-23 09:55:15 -04:00
Juan Font 6a3b171e99 Merge pull request #29 from cure/add-ephemeral-node-support
Add support for ephemeral nodes via a special type of pre-auth key.
2021-05-23 11:39:16 +02:00
Ward Vandewege 41f6740ddd Add support for ephemeral nodes via a special type of pre-auth key. Add
tests for that feature.

Other fixes: clean up a few typos in comments. Fix a bug that caused the
tests to run four times each. Be more consistent in the use of log
rather than fmt to print errors and notices.
2021-05-22 20:18:29 -04:00
Juan Font 1faed2764f Merge pull request #28 from juanfont/sqlite-support-plus-integration
Adding SQLite support
2021-05-18 23:49:04 +02:00
Juan Font Alonso 13b7b3ee8a Fix tests 2021-05-18 23:33:18 +02:00
Juan Font Alonso 5a42bace67 Use OS-independent paths for the abs method 2021-05-18 23:33:08 +02:00
Juan Font Alonso 460a23cf2b Check for abs/rel path in db_path 2021-05-19 01:28:47 +02:00
Juan Font Alonso b0adefc540 Remove trailing space 2021-05-19 01:20:28 +02:00
Juan Font Alonso 370fe3b192 Removed wrongly copypasted method 2021-05-16 16:47:48 +02:00
Juan Font Alonso 374a6eef7e Fixed panic when sending keep alives to a disconnected node 2021-05-15 18:12:22 +02:00
Juan Font Alonso 93a9284d84 Updated README with sqlite instructions 2021-05-15 14:38:20 +02:00
Juan Font Alonso 0b8d4a24ae minor update to gitignore 2021-05-15 14:36:56 +02:00
Juan Font Alonso da9a07ddf3 Added tests for the sqlite-based config 2021-05-15 14:36:13 +02:00
Juan Font Alonso 216c6d85b2 Added support for sqlite as database backend 2021-05-15 14:32:26 +02:00
Juan Font 619201ec9b Merge pull request #27 from juanfont/change-json-field
Remove dependency on Postgres' jsonb field
2021-05-15 11:59:07 +02:00
Juan Font Alonso ad4a61cc7b update in sum 2021-05-15 00:08:22 +02:00
Juan Font Alonso 84aba256bb Added some deps + updates 2021-05-15 00:06:17 +02:00
Juan Font Alonso e0d916bb5a Remove dependency on postgres' jsonb 2021-05-15 00:05:41 +02:00
Juan Font e7a626d3cc Merge pull request #26 from cure/more_tests
Add more tests
2021-05-13 09:07:53 +02:00
Ward Vandewege be83281f58 Fix build breakage due to https://github.com/golang/go/issues/44129.
The issue was that our build pipeline uses 'go get' call to install
golint, which changed the go.mod/go.sum files (not good, but I hadn't
noticed before). Due to Golang bug #44129, this caused breakage on the
dependencies of certain modules we use.

The fix was to switch to 'go install golang.org/x/lint/golint@latest'.
The addition of '@latest' puts 'go install' in module aware mode, which
no longer changes go.mod file in the current directory. This is better,
and it also avoids bug #44129.

This commit also has a change due to `go mod tidy`. Finally, I had to
add a longer timeout for the golangci-lint installation step in the
github actions workflow, since that seems to take a bit over a minute
now.  This step is usually cached on subsequent runs, so we hadn't seen
that failure before.
2021-05-12 09:06:46 -04:00
Ward Vandewege d2748f34aa Add more tests. 2021-05-11 20:55:36 -04:00
Juan Font 0f933c1a46 Merge pull request #24 from cure/add-destroy-namespace-command
Add a DestroyNamespace command and tests for the Namespace functions.
2021-05-09 18:33:28 +02:00
Ward Vandewege b20b664353 Add a DestroyNamespace command and tests for the Namespace functions. 2021-05-09 11:12:39 -04:00
Juan Font 3cf599be64 Merge pull request #22 from juanfont/json-output
Added JSON-formatted output to CLI
2021-05-08 19:55:19 +02:00
Juan Font Alonso 8ad366f977 Use JsonOutput in version too 2021-05-08 17:06:36 +02:00
Juan Font Alonso 9eaac71762 Trim trailing spaces 2021-05-08 16:56:27 +02:00
Juan Font Alonso 5cbd2d43a8 Update README to mention json output + some minor updates 2021-05-08 14:12:22 +02:00
Juan Font Alonso 8a207374c6 Add some return when enabling routing succeedes + some comments... 2021-05-08 13:59:18 +02:00
Juan Font Alonso abde7dddb7 More json output 2021-05-08 13:58:51 +02:00
Juan Font Alonso 3b34f715ce Adding support for JSON-formatted output 1/n 2021-05-08 13:28:22 +02:00
Juan Font Alonso 4b3b48441f Return the machine when registering 2021-05-08 13:27:53 +02:00
Juan Font Alonso 33bee1df05 Do not print stuff in the library 2021-05-08 13:27:40 +02:00
Juan Font 32da9c0415 Update README.md
Added CI badge
2021-05-07 13:54:15 +02:00
Juan Font Alonso 5faa6cf59a Update README (although do not advirtise preauth keys that much yet) 2021-05-06 23:58:26 +02:00
Juan Font 8ca940ad30 Merge pull request #21 from juanfont/working-preauth
Support for pre auth keys
2021-05-06 23:50:28 +02:00
Juan Font Alonso 13e086980a Removed logging 2021-05-06 23:49:55 +02:00
Juan Font Alonso 4183db840e Update README (although do not advirtise preauth keys that much yet) 2021-05-06 23:25:40 +02:00
Juan Font Alonso fc0c519206 Fill RegisterMethod field in Machine 2021-05-06 18:26:01 +02:00
Juan Font Alonso 9bac805d50 Removed spew 2021-05-06 01:03:43 +02:00
Juan Font Alonso 744c687d37 Fixed linting issues 2021-05-06 01:01:45 +02:00
Juan Font Alonso e17e10e0b7 Preauth keys kinda working 2021-05-06 00:59:26 +02:00
Juan Font Alonso 9ce8dc3fb6 Preload the namespace 2021-05-06 00:59:16 +02:00
Juan Font Alonso 3110dd1575 Added fields in Machine to store authkey + validation tests 2021-05-06 00:08:36 +02:00
Juan Font Alonso 486faa9656 WIP Working on authkeys + tests 2021-05-05 23:00:04 +02:00
Juan Font 03bb32083b Merge pull request #20 from cure/preauthkeys_improvements
Preauthkeys improvements
2021-05-03 22:56:18 +02:00
Juan Font 13f809be87 Merge pull request #19 from juanfont/node-cmd-improve
List nodes in namespace + register under node command
2021-05-02 23:04:46 +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
Juan Font Alonso 45e9001787 Register cmd under node 2021-05-01 20:05:10 +02:00
Juan Font Alonso c71c13366f Minor fix 2021-05-01 20:04:03 +02:00
Juan Font Alonso 404fee8361 Added list node functionality 2021-05-01 20:00:25 +02:00
Juan Font 8198d2f8ed Merge pull request #18 from cure/add-actions
Add a basic CI workflow with github actions
2021-04-30 10:45:11 +02:00
Juan Font Alonso 68c21faf64 Check persistnt flag errors 2021-04-30 09:55:39 +02:00
Juan Font 3532eafd8c Merge pull request #17 from juanfont/namespace-flag
Namespace is now a flag for all the commands
2021-04-30 09:55:17 +02:00
Juan Font Alonso 5648337e68 Removed trailing space 2021-04-30 09:53:44 +02:00
Ward Vandewege 491fb0adb3 Fix a few linter errors. 2021-04-29 21:14:50 -04:00
Ward Vandewege 283ca3b6f8 Add ci workflow. 2021-04-29 21:14:50 -04:00
Juan Font Alonso b83318bfb3 Namespace is now a flag for all the commands 2021-04-30 00:23:26 +02:00
Juan Font 51139afa50 Merge pull request #16 from juanfont/cmd-funcs-to-cli
Reorganise the CLI structure
2021-04-29 09:49:23 +02:00
Juan Font Alonso 7646bd8fd4 CLI stuff should be in the cmd/ path 2021-04-28 16:55:29 +02:00
Juan Font Alonso 77e5255fdd Move the CLI functiontionality to the CLI package 2021-04-28 16:15:45 +02:00
Juan Font 8f67bdba8c Merge pull request #15 from cure/add-first-tests
Add first tests
2021-04-27 23:53:27 +02:00
Ward Vandewege f5010fd75b Add test for our config validation rules. 2021-04-26 20:30:06 -04:00
Ward Vandewege 37601f6b4d Add a very simple test. 2021-04-26 19:22:28 -04:00
Juan Font 031c91a545 Merge pull request #13 from cure/add-Makefile
Add a Makefile with a few targets.
2021-04-25 22:40:34 +02:00
Ward Vandewege 6aedc1111b Add a Makefile with a few targets. The default is 'build'. The build
target calls the new version-at-commit.sh script which will
automatically populate the version variable inside the Headscale binary.

Once we start tagging releases on the git tree, that will come in handy.

The Makefile also has a 'test' target (does nothing yet, no tests yet)
and a 'dev' target, which runs linters, tests, and finally builds.
2021-04-25 10:31:52 -04:00
Juan Font 6fa84004b3 Merge pull request #11 from xpzouying/zy/fix-remove-dup-close-db
fix: remove db twice
2021-04-25 00:35:46 +02:00
Juan Font 1bc4294241 Merge pull request #10 from cure/linter-warnings
Linter warnings
2021-04-25 00:29:18 +02:00
Juan Font c07f192dc4 Merge pull request #12 from gitter-badger/gitter-badge
Add a Gitter chat badge to README.md
2021-04-25 00:16:44 +02:00
The Gitter Badger 8c218189b0 Add Gitter badge 2021-04-24 21:26:38 +00:00
zy 07a9f95aeb fix: remove db twice
* fix: remove db twice.
* better for new error, use errors.New.
* Error strings should not be capitalized or end with punctuation.
https://github.com/golang/go/wiki/CodeReviewComments#error-strings
2021-04-25 00:29:40 +08:00
Ward Vandewege f7c7b4873a Address a bunch of golangci-lint warnings. 2021-04-24 11:41:29 -04:00
Ward Vandewege f7b6c68d22 Address a bunch of golint warnings. 2021-04-24 11:26:50 -04:00
Juan Font d30b682a6e Merge pull request #9 from cure/add-tls-autocert
Add support for TLS to the web service.
2021-04-24 11:28:31 +02: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
Ward Vandewege 1b30874cf8 Check for errors from the Serve() function. 2021-04-23 17:18:14 -04:00
Ward Vandewege 252c68c50a Add HTTPS support for the web endpoint with manually configured
certificate/key files.
2021-04-23 17:18:00 -04:00
Ward Vandewege c5a3d0b01c In absPath, skip empty paths. 2021-04-23 16:42:27 -04:00
Juan Font 328f6ea455 Merge pull request #8 from cure/relative-paths-in-config
Handle relative paths in private_key_path and derp_map_path
2021-04-23 09:40:52 +02:00
Ward Vandewege 683b151f19 If the configuration file contains relative paths (e.g. in the values
for private_key_path or derp_map_path), interpret them as relative to
the directory where the config.json file was read from.
2021-04-22 21:10:50 -04:00
Juan Font Alonso 9c40e829ec Create preauthkeys kinda working (not usable yet) 2021-04-23 00:40:42 +02:00
Juan Font Alonso 176eea4a84 WIP on PreAuthKeys 2021-04-23 00:25:01 +02:00
Juan Font Alonso 2555220a57 Merge branch 'main' of https://github.com/juanfont/headscale into main 2021-04-22 23:58:18 +02:00
Juan Font Alonso 3743f08c1f Minor fix on already defer db close 2021-04-22 23:55:07 +02:00
Juan Font 481a9a01f6 Merge pull request #6 from cure/add-standard-config-locations
Add additional locations to look for the config.json file
2021-04-22 00:52:06 +02:00
Ward Vandewege a71387f9d2 Add additional locations to look for the config.json file:
/etc/headscale and $HOME/.headscale
2021-04-21 17:33:09 -04:00
Juan Font Alonso eac85a31ed Merge branch 'main' of https://github.com/juanfont/headscale into main 2021-04-08 23:58:00 +02:00
Juan Font Alonso c284f3eefa Bump mod 2021-04-08 23:57:47 +02:00
Juan Font Alonso 541d676b98 Minor code reorg 2021-04-08 23:57:31 +02:00
Juan Font bdccd85533 Minor readme fixes 2021-03-18 23:02:36 +00:00
Juan Font Alonso 977962736a Removed log message 2021-03-17 23:09:45 +01:00
Juan Font Alonso 06003974e5 Added project overview #5 2021-03-17 21:58:38 +01:00
Juan Font Alonso 1fad8e6e5b Added basic routes functionality 2021-03-14 11:38:42 +01:00
Juan Font Alonso db75cd39a7 Update in preparation of supporting exit nodes 2021-03-10 22:33:37 +01:00
Juan Font Alonso fc13f74851 Minor output fix & README improvements 2021-02-28 20:29:31 +01:00
Juan Font Alonso 2733a34033 Update readme with namespace info 2021-02-28 01:04:01 +01:00
Juan Font Alonso b7655b1f68 Initial multi-user support using namespaces 2021-02-28 00:58:09 +01:00
Juan Font Alonso 562e996996 Fixed crash when NetInfo is nil 2021-02-24 23:45:27 +01:00
Juan Font Alonso d0e54bd59e Renamed file 2021-02-24 23:45:08 +01:00
Juan Font Alonso 5da39f9176 Readme improved 2021-02-24 22:23:36 +01:00
Juan Font Alonso 6a397345aa Headscale is working (Fixed DERP address) 2021-02-24 00:32:34 +01:00
Juan Font Alonso 93c711d2d8 Minor thing 2021-02-24 00:31:58 +01:00
Juan Font Alonso 06fb7d4587 WIP: Client updates. Long polling rewritten 2021-02-23 21:07:52 +01:00
Juan Font Alonso ca6904fc95 Clean 2021-02-23 20:11:30 +01:00
Juan Font Alonso 2b1d92429a Added the name from the HostInfo hostname 2021-02-23 20:10:58 +01:00
Juan Font Alonso 90759688ca Send StableID 2021-02-22 23:27:33 +01:00
Juan Font Alonso a20fffc3e9 Peers is always returned sorted by Node.ID.
(https://github.com/awsong/headscale)
2021-02-22 00:53:37 +01:00
Juan Font Alonso 563f3c4017 Fixes here and there 2021-02-21 23:54:15 +01:00
Juan Font Alonso 1b7d99d483 Improving code... 2021-02-21 22:14:38 +01:00
Juan Font Alonso 5d3c80a192 Seed the random IP address generator 2021-02-21 22:11:27 +01:00
Juan Font Alonso 272eee79fd Added support for DiscoKey
(from https://github.com/awsong/headscale)
2021-02-21 21:34:28 +01:00
Juan Font Alonso acb645aa9d Check that peers are registered when fetching them
Fix from https://github.com/awsong/headscale
2021-02-21 21:03:25 +01:00
Juan Font Alonso b0b9e3a9af Removed frontend stuff 2021-02-21 20:42:46 +01:00
Juan Font Alonso 18156f2efd README improved 2021-02-21 20:42:32 +01:00
Juan Font Alonso 52257e32a3 Update readme 2021-02-21 01:34:16 +01:00
Juan Font Alonso 7d52842a4c Fixed gitignore 2021-02-21 01:31:50 +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 ff7db34b5e Fixed gitignore 2021-02-20 23:58:02 +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 6ca98473d4 Deleted more frontend stuff 2021-02-20 22:42:28 +01:00
Juan Font Alonso 1e1d577b83 Removed frontend stuff. We are not there yet... 2021-02-20 21:09:15 +01:00
Juan Font 92f33c15b7 Merge pull request #3 from juanfont/dependabot/npm_and_yarn/frontend/ini-1.3.8
Bump ini from 1.3.5 to 1.3.8 in /frontend
2020-12-15 16:44:52 +01:00
Juan Font 1c154acce8 Merge pull request #4 from ignoramous/patch-1
minor readme typo
2020-12-15 16:42:14 +01:00
ignoramous 253cd4fbdb minor readme typo 2020-12-15 20:57:06 +05:30
dependabot[bot] 2084b1fd0e Bump ini from 1.3.5 to 1.3.8 in /frontend
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.8)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-13 00:14:32 +00:00
Juan Font e67811f988 Merge pull request #2 from shaananc/master
Add Dockerfile
2020-08-17 16:42:24 +02:00
Shaanan Cohney eabb200655 added dockerfile 2020-07-27 22:07:23 +10:00
Juan Font Alonso 57b449bdae Bump frontend versions 2020-07-04 14:41:52 +02:00
Juan Font Alonso 1302e59a34 Added .air.conf for hot-reload support 2020-07-04 13:40:13 +02:00
Juan Font Alonso d37bb398dd Added React base app 2020-07-04 13:39:52 +02:00
Juan Font Alonso 1ddb4febe8 Embedding frontend via Pkger 2020-07-04 13:38:58 +02:00
Juan Font Alonso 8187085e39 Added missing cmd 2020-06-21 12:33:43 +02:00
Juan Font Alonso 7198c8bd77 Initial commit 2020-06-21 12:32:08 +02:00
Juan Font ecf9c9b3db Update README.md 2020-06-21 11:58:25 +02:00
Juan Font 8077923b68 Initial commit 2020-06-21 11:21:07 +02:00
2239 changed files with 36419 additions and 132797 deletions
+19
View File
@@ -0,0 +1,19 @@
// integration tests are not needed in docker
// ignoring it let us speed up the integration test
// development
integration_test.go
integration_test/
!integration_test/etc_embedded_derp/tls/server.crt
Dockerfile*
docker-compose*
.dockerignore
.goreleaser.yml
.git
.github
.gitignore
README.md
LICENSE
.vscode
*.sock
+1
View File
@@ -0,0 +1 @@
use flake
+10
View File
@@ -0,0 +1,10 @@
* @juanfont @kradalby
*.md @ohdearaugustin
*.yml @ohdearaugustin
*.yaml @ohdearaugustin
Dockerfile* @ohdearaugustin
.goreleaser.yaml @ohdearaugustin
/docs/ @ohdearaugustin
/.github/workflows/ @ohdearaugustin
/.github/renovate.json @ohdearaugustin
+2
View File
@@ -0,0 +1,2 @@
ko_fi: kradalby
github: [kradalby]
+30
View File
@@ -0,0 +1,30 @@
---
name: "Bug report"
about: "Create a bug report to help us improve"
title: ""
labels: ["bug"]
assignees: ""
---
<!-- Headscale is a multinational community across the globe. Our common language is English. Please consider raising the bug report in this language. -->
**Bug description**
<!-- A clear and concise description of what the bug is. Describe the expected bahavior
and how it is currently different. If you are unsure if it is a bug, consider discussing
it on our Discord server first. -->
**To Reproduce**
<!-- Steps to reproduce the behavior. -->
**Context info**
<!-- Please add relevant information about your system. For example:
- Version of headscale used
- Version of tailscale client
- OS (e.g. Linux, Mac, Cygwin, WSL, etc.) and version
- Kernel version
- The relevant config parameters you used
- Log output
-->
+11
View File
@@ -0,0 +1,11 @@
# Issues must have some content
blank_issues_enabled: false
# Contact links
contact_links:
- name: "headscale usage documentation"
url: "https://github.com/juanfont/headscale/blob/main/docs"
about: "Find documentation about how to configure and run headscale."
- name: "headscale Discord community"
url: "https://discord.gg/xGj2TuqyxY"
about: "Please ask and answer questions about usage of headscale here."
+17
View File
@@ -0,0 +1,17 @@
---
name: "Feature request"
about: "Suggest an idea for headscale"
title: ""
labels: ["enhancement"]
assignees: ""
---
<!-- Headscale is a multinational community across the globe. Our common language is English. Please consider raising the feature request in this language. -->
**Feature request**
<!-- A clear and precise description of what new or changed feature you want. -->
<!-- Please include the reason, why you would need the feature. E.g. what problem
does it solve? Or which workflow is currently frustrating and will be improved by
this? -->
+30
View File
@@ -0,0 +1,30 @@
---
name: "Other issue"
about: "Report a different issue"
title: ""
labels: ["bug"]
assignees: ""
---
<!-- Headscale is a multinational community across the globe. Our common language is English. Please consider raising the issue in this language. -->
<!-- If you have a question, please consider using our Discord for asking questions -->
**Issue description**
<!-- Please add your issue description. -->
**To Reproduce**
<!-- Steps to reproduce the behavior. -->
**Context info**
<!-- Please add relevant information about your system. For example:
- Version of headscale used
- Version of tailscale client
- OS (e.g. Linux, Mac, Cygwin, WSL, etc.) and version
- Kernel version
- The relevant config parameters you used
- Log output
-->
+10
View File
@@ -0,0 +1,10 @@
<!-- Please tick if the following things apply. You… -->
- [ ] read the [CONTRIBUTING guidelines](README.md#contributing)
- [ ] raised a GitHub issue or discussed it on the projects chat beforehand
- [ ] added unit tests
- [ ] added integration tests
- [ ] updated documentation if needed
- [ ] updated CHANGELOG.md
<!-- If applicable, please reference the issue using `Fixes #XXX` and add tests to cover your new code. -->
+38
View File
@@ -0,0 +1,38 @@
{
"baseBranches": ["main"],
"username": "renovate-release",
"gitAuthor": "Renovate Bot <bot@renovateapp.com>",
"branchPrefix": "renovateaction/",
"onboarding": false,
"extends": ["config:base", ":rebaseStalePrs"],
"ignorePresets": [":prHourlyLimit2"],
"enabledManagers": ["dockerfile", "gomod", "github-actions","regex" ],
"includeForks": true,
"repositories": ["juanfont/headscale"],
"platform": "github",
"packageRules": [
{
"matchDatasources": ["go"],
"groupName": "Go modules",
"groupSlug": "gomod",
"separateMajorMinor": false
},
{
"matchDatasources": ["docker"],
"groupName": "Dockerfiles",
"groupSlug": "dockerfiles"
}
],
"regexManagers": [
{
"fileMatch": [
".github/workflows/.*.yml$"
],
"matchStrings": [
"\\s*go-version:\\s*\"?(?<currentValue>.*?)\"?\\n"
],
"datasourceTemplate": "golang-version",
"depNameTemplate": "actions/go-version"
}
]
}
+42
View File
@@ -0,0 +1,42 @@
name: Build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v14.1
with:
files: |
*.nix
go.*
**/*.go
integration_test/
config-example.yaml
- uses: cachix/install-nix-action@v16
if: steps.changed-files.outputs.any_changed == 'true'
- name: Run build
if: steps.changed-files.outputs.any_changed == 'true'
run: nix build
- uses: actions/upload-artifact@v2
if: steps.changed-files.outputs.any_changed == 'true'
with:
name: headscale-linux
path: result/bin/headscale
+35
View File
@@ -0,0 +1,35 @@
name: Contributors
on:
push:
branches:
- main
workflow_dispatch:
jobs:
add-contributors:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Delete upstream contributor branch
# Allow continue on failure to account for when the
# upstream branch is deleted or does not exist.
continue-on-error: true
run: git push origin --delete update-contributors
- name: Create up-to-date contributors branch
run: git checkout -B update-contributors
- name: Push empty contributors branch
run: git push origin update-contributors
- name: Switch back to main
run: git checkout main
- uses: BobAnkh/add-contributors@v0.2.2
with:
CONTRIBUTOR: "## Contributors"
COLUMN_PER_ROW: "6"
ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}}
IMG_WIDTH: "100"
FONT_SIZE: "14"
PATH: "/README.md"
COMMIT_MESSAGE: "docs(README): update contributors"
AVATAR_SHAPE: "round"
BRANCH: "update-contributors"
PULL_REQUEST: "main"
+76
View File
@@ -0,0 +1,76 @@
---
name: CI
on: [push, pull_request]
jobs:
golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v14.1
with:
files: |
*.nix
go.*
**/*.go
integration_test/
config-example.yaml
- name: golangci-lint
if: steps.changed-files.outputs.any_changed == 'true'
uses: golangci/golangci-lint-action@v2
with:
version: v1.46.1
# Only block PRs on new problems.
# If this is not enabled, we will end up having PRs
# blocked because new linters has appared and other
# parts of the code is affected.
only-new-issues: true
prettier-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v14.1
with:
files: |
*.nix
**/*.md
**/*.yml
**/*.yaml
**/*.ts
**/*.js
**/*.sass
**/*.css
**/*.scss
**/*.html
- name: Prettify code
if: steps.changed-files.outputs.any_changed == 'true'
uses: creyD/prettier_action@v4.0
with:
prettier_options: >-
--check **/*.{ts,js,md,yaml,yml,sass,css,scss,html}
only_changed: false
dry: true
proto-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: bufbuild/buf-setup-action@v1.7.0
- uses: bufbuild/buf-lint-action@v1
with:
input: "proto"
+229
View File
@@ -0,0 +1,229 @@
---
name: release
on:
push:
tags:
- "*" # triggers only if push new tag version
workflow_dispatch:
jobs:
goreleaser:
runs-on: ubuntu-18.04 # due to CGO we need to user an older version
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19.0
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y gcc-aarch64-linux-gnu
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docker-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Set up QEMU for multiple platforms
uses: docker/setup-qemu-action@master
with:
platforms: arm64,amd64
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: |
${{ secrets.DOCKERHUB_USERNAME }}/headscale
ghcr.io/${{ github.repository_owner }}/headscale
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=latest
type=sha
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
build-args: |
VERSION=${{ steps.meta.outputs.version }}
- name: Prepare cache for next build
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
docker-debug-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Set up QEMU for multiple platforms
uses: docker/setup-qemu-action@master
with:
platforms: arm64,amd64
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache-debug
key: ${{ runner.os }}-buildx-debug-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-debug-
- name: Docker meta
id: meta-debug
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: |
${{ secrets.DOCKERHUB_USERNAME }}/headscale
ghcr.io/${{ github.repository_owner }}/headscale
flavor: |
latest=false
tags: |
type=semver,pattern={{version}}-debug
type=semver,pattern={{major}}.{{minor}}-debug
type=semver,pattern={{major}}-debug
type=raw,value=latest-debug
type=sha,suffix=-debug
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
context: .
file: Dockerfile.debug
tags: ${{ steps.meta-debug.outputs.tags }}
labels: ${{ steps.meta-debug.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache-debug
cache-to: type=local,dest=/tmp/.buildx-cache-debug-new
build-args: |
VERSION=${{ steps.meta-debug.outputs.version }}
- name: Prepare cache for next build
run: |
rm -rf /tmp/.buildx-cache-debug
mv /tmp/.buildx-cache-debug-new /tmp/.buildx-cache-debug
docker-alpine-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Set up QEMU for multiple platforms
uses: docker/setup-qemu-action@master
with:
platforms: arm64,amd64
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache-alpine
key: ${{ runner.os }}-buildx-alpine-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-alpine-
- name: Docker meta
id: meta-alpine
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: |
${{ secrets.DOCKERHUB_USERNAME }}/headscale
ghcr.io/${{ github.repository_owner }}/headscale
flavor: |
latest=false
tags: |
type=semver,pattern={{version}}-alpine
type=semver,pattern={{major}}.{{minor}}-alpine
type=semver,pattern={{major}}-alpine
type=raw,value=latest-alpine
type=sha,suffix=-alpine
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
context: .
file: Dockerfile.alpine
tags: ${{ steps.meta-alpine.outputs.tags }}
labels: ${{ steps.meta-alpine.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache-alpine
cache-to: type=local,dest=/tmp/.buildx-cache-alpine-new
build-args: |
VERSION=${{ steps.meta-alpine.outputs.version }}
- name: Prepare cache for next build
run: |
rm -rf /tmp/.buildx-cache-alpine
mv /tmp/.buildx-cache-alpine-new /tmp/.buildx-cache-alpine
+27
View File
@@ -0,0 +1,27 @@
---
name: Renovate
on:
schedule:
- cron: "* * 5,20 * *" # Every 5th and 20th of the month
workflow_dispatch:
jobs:
renovate:
runs-on: ubuntu-latest
steps:
- name: Get token
id: get_token
uses: machine-learning-apps/actions-app-token@master
with:
APP_PEM: ${{ secrets.RENOVATEBOT_SECRET }}
APP_ID: ${{ secrets.RENOVATEBOT_APP_ID }}
- name: Checkout
uses: actions/checkout@v2.0.0
- name: Self-hosted Renovate
uses: renovatebot/github-action@v31.81.3
with:
configurationFile: .github/renovate.json
token: "x-access-token:${{ steps.get_token.outputs.app_token }}"
# env:
# LOG_LEVEL: "debug"
+58
View File
@@ -0,0 +1,58 @@
name: CI
on: [pull_request]
jobs:
integration-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 10
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v14.1
with:
files: |
*.nix
go.*
**/*.go
integration_test/
config-example.yaml
- uses: cachix/install-nix-action@v16
if: steps.changed-files.outputs.any_changed == 'true'
- name: Run CLI integration tests
if: steps.changed-files.outputs.any_changed == 'true'
uses: nick-fields/retry@v2
with:
timeout_minutes: 240
max_attempts: 5
retry_on: error
command: nix develop --command -- make test_integration_cli
- name: Run Embedded DERP server integration tests
if: steps.changed-files.outputs.any_changed == 'true'
uses: nick-fields/retry@v2
with:
timeout_minutes: 240
max_attempts: 5
retry_on: error
command: nix develop --command -- make test_integration_derp
- name: Run general integration tests
if: steps.changed-files.outputs.any_changed == 'true'
uses: nick-fields/retry@v2
with:
timeout_minutes: 240
max_attempts: 5
retry_on: error
command: nix develop --command -- make test_integration_general
+30
View File
@@ -0,0 +1,30 @@
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v14.1
with:
files: |
*.nix
go.*
**/*.go
integration_test/
config-example.yaml
- uses: cachix/install-nix-action@v16
if: steps.changed-files.outputs.any_changed == 'true'
- name: Run tests
if: steps.changed-files.outputs.any_changed == 'true'
run: nix develop --check
+35
View File
@@ -0,0 +1,35 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, built with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Dependency directories (remove the comment below to include it)
# vendor/
/headscale
config.json
config.yaml
derp.yaml
*.hujson
*.key
/db.sqlite
*.sqlite3
# Exclude Jetbrains Editors
.idea
test_output/
# Nix build output
result
.direnv/
integration_test/etc/config.dump.yaml
+60
View File
@@ -0,0 +1,60 @@
---
run:
timeout: 10m
issues:
skip-dirs:
- gen
linters:
enable-all: true
disable:
- exhaustivestruct
- revive
- lll
- interfacer
- scopelint
- maligned
- golint
- gofmt
- gochecknoglobals
- gochecknoinits
- gocognit
- funlen
- exhaustivestruct
- tagliatelle
- godox
- ireturn
- execinquery
- exhaustruct
# We should strive to enable these:
- wrapcheck
- dupl
- makezero
- maintidx
# We might want to enable this, but it might be a lot of work
- cyclop
- nestif
- wsl # might be incompatible with gofumpt
- testpackage
- paralleltest
linters-settings:
varnamelen:
ignore-type-assert-ok: true
ignore-map-index-ok: true
ignore-names:
- err
- db
- id
- ip
- ok
- c
- tt
gocritic:
disabled-checks:
- appendAssign
# TODO(kradalby): Remove this
- ifElseChain
+81
View File
@@ -0,0 +1,81 @@
---
before:
hooks:
- go mod tidy -compat=1.19
release:
prerelease: auto
builds:
- id: darwin-amd64
main: ./cmd/headscale/headscale.go
mod_timestamp: "{{ .CommitTimestamp }}"
env:
- CGO_ENABLED=0
goos:
- darwin
goarch:
- amd64
flags:
- -mod=readonly
ldflags:
- -s -w -X github.com/juanfont/headscale/cmd/headscale/cli.Version=v{{.Version}}
- id: darwin-arm64
main: ./cmd/headscale/headscale.go
mod_timestamp: "{{ .CommitTimestamp }}"
env:
- CGO_ENABLED=0
goos:
- darwin
goarch:
- arm64
flags:
- -mod=readonly
ldflags:
- -s -w -X github.com/juanfont/headscale/cmd/headscale/cli.Version=v{{.Version}}
- id: linux-amd64
mod_timestamp: "{{ .CommitTimestamp }}"
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
main: ./cmd/headscale/headscale.go
ldflags:
- -s -w -X github.com/juanfont/headscale/cmd/headscale/cli.Version=v{{.Version}}
- id: linux-arm64
mod_timestamp: "{{ .CommitTimestamp }}"
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- arm64
main: ./cmd/headscale/headscale.go
ldflags:
- -s -w -X github.com/juanfont/headscale/cmd/headscale/cli.Version=v{{.Version}}
archives:
- id: golang-cross
builds:
- darwin-amd64
- darwin-arm64
- linux-amd64
- linux-arm64
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
format: binary
checksum:
name_template: "checksums.txt"
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
View File
-1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-14
View File
@@ -1,14 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Redirecting...</title>
<link rel="canonical" href="../ref/acls/">
<script>var anchor=window.location.hash.substr(1);location.href="../ref/acls/"+(anchor?"#"+anchor:"")</script>
<meta http-equiv="refresh" content="0; url=../ref/acls/">
</head>
<body>
You're being redirected to a <a href="../ref/acls/">new destination</a>.
</body>
</html>
-14
View File
@@ -1,14 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Redirecting...</title>
<link rel="canonical" href="../usage/connect/android/">
<script>var anchor=window.location.hash.substr(1);location.href="../usage/connect/android/"+(anchor?"#"+anchor:"")</script>
<meta http-equiv="refresh" content="0; url=../usage/connect/android/">
</head>
<body>
You're being redirected to a <a href="../usage/connect/android/">new destination</a>.
</body>
</html>
-14
View File
@@ -1,14 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Redirecting...</title>
<link rel="canonical" href="../usage/connect/apple/">
<script>var anchor=window.location.hash.substr(1);location.href="../usage/connect/apple/"+(anchor?"#"+anchor:"")</script>
<meta http-equiv="refresh" content="0; url=../usage/connect/apple/">
</head>
<body>
You're being redirected to a <a href="../usage/connect/apple/">new destination</a>.
</body>
</html>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-18
View File
@@ -1,18 +0,0 @@
/*!
* Lunr languages, `Danish` language
* https://github.com/MihaiValentin/lunr-languages
*
* Copyright 2014, Mihai Valentin
* http://www.mozilla.org/MPL/
*/
/*!
* based on
* Snowball JavaScript Library v0.3
* http://code.google.com/p/urim/
* http://snowball.tartarus.org/
*
* Copyright 2010, Oleg Mazko
* http://www.mozilla.org/MPL/
*/
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.da=function(){this.pipeline.reset(),this.pipeline.add(e.da.trimmer,e.da.stopWordFilter,e.da.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.da.stemmer))},e.da.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.da.trimmer=e.trimmerSupport.generateTrimmer(e.da.wordCharacters),e.Pipeline.registerFunction(e.da.trimmer,"trimmer-da"),e.da.stemmer=function(){var r=e.stemmerSupport.Among,i=e.stemmerSupport.SnowballProgram,n=new function(){function e(){var e,r=f.cursor+3;if(d=f.limit,0<=r&&r<=f.limit){for(a=r;;){if(e=f.cursor,f.in_grouping(w,97,248)){f.cursor=e;break}if(f.cursor=e,e>=f.limit)return;f.cursor++}for(;!f.out_grouping(w,97,248);){if(f.cursor>=f.limit)return;f.cursor++}d=f.cursor,d<a&&(d=a)}}function n(){var e,r;if(f.cursor>=d&&(r=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,e=f.find_among_b(c,32),f.limit_backward=r,e))switch(f.bra=f.cursor,e){case 1:f.slice_del();break;case 2:f.in_grouping_b(p,97,229)&&f.slice_del()}}function t(){var e,r=f.limit-f.cursor;f.cursor>=d&&(e=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,f.find_among_b(l,4)?(f.bra=f.cursor,f.limit_backward=e,f.cursor=f.limit-r,f.cursor>f.limit_backward&&(f.cursor--,f.bra=f.cursor,f.slice_del())):f.limit_backward=e)}function s(){var e,r,i,n=f.limit-f.cursor;if(f.ket=f.cursor,f.eq_s_b(2,"st")&&(f.bra=f.cursor,f.eq_s_b(2,"ig")&&f.slice_del()),f.cursor=f.limit-n,f.cursor>=d&&(r=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,e=f.find_among_b(m,5),f.limit_backward=r,e))switch(f.bra=f.cursor,e){case 1:f.slice_del(),i=f.limit-f.cursor,t(),f.cursor=f.limit-i;break;case 2:f.slice_from("løs")}}function o(){var e;f.cursor>=d&&(e=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,f.out_grouping_b(w,97,248)?(f.bra=f.cursor,u=f.slice_to(u),f.limit_backward=e,f.eq_v_b(u)&&f.slice_del()):f.limit_backward=e)}var a,d,u,c=[new r("hed",-1,1),new r("ethed",0,1),new r("ered",-1,1),new r("e",-1,1),new r("erede",3,1),new r("ende",3,1),new r("erende",5,1),new r("ene",3,1),new r("erne",3,1),new r("ere",3,1),new r("en",-1,1),new r("heden",10,1),new r("eren",10,1),new r("er",-1,1),new r("heder",13,1),new r("erer",13,1),new r("s",-1,2),new r("heds",16,1),new r("es",16,1),new r("endes",18,1),new r("erendes",19,1),new r("enes",18,1),new r("ernes",18,1),new r("eres",18,1),new r("ens",16,1),new r("hedens",24,1),new r("erens",24,1),new r("ers",16,1),new r("ets",16,1),new r("erets",28,1),new r("et",-1,1),new r("eret",30,1)],l=[new r("gd",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1)],m=[new r("ig",-1,1),new r("lig",0,1),new r("elig",1,1),new r("els",-1,1),new r("løst",-1,2)],w=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],p=[239,254,42,3,0,0,0,0,0,0,0,0,0,0,0,0,16],f=new i;this.setCurrent=function(e){f.setCurrent(e)},this.getCurrent=function(){return f.getCurrent()},this.stem=function(){var r=f.cursor;return e(),f.limit_backward=r,f.cursor=f.limit,n(),f.cursor=f.limit,t(),f.cursor=f.limit,s(),f.cursor=f.limit,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.da.stemmer,"stemmer-da"),e.da.stopWordFilter=e.generateStopWordFilter("ad af alle alt anden at blev blive bliver da de dem den denne der deres det dette dig din disse dog du efter eller en end er et for fra ham han hans har havde have hende hendes her hos hun hvad hvis hvor i ikke ind jeg jer jo kunne man mange med meget men mig min mine mit mod ned noget nogle nu når og også om op os over på selv sig sin sine sit skal skulle som sådan thi til ud under var vi vil ville vor være været".split(" ")),e.Pipeline.registerFunction(e.da.stopWordFilter,"stopWordFilter-da")}});
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-1
View File
@@ -1 +0,0 @@
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.hi=function(){this.pipeline.reset(),this.pipeline.add(e.hi.trimmer,e.hi.stopWordFilter,e.hi.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.hi.stemmer))},e.hi.wordCharacters="ऀ-ःऄ-एऐ-टठ-यर-िी-ॏॐ-य़ॠ-९॰-ॿa-zA-Z-zA-0-9-",e.hi.trimmer=e.trimmerSupport.generateTrimmer(e.hi.wordCharacters),e.Pipeline.registerFunction(e.hi.trimmer,"trimmer-hi"),e.hi.stopWordFilter=e.generateStopWordFilter("अत अपना अपनी अपने अभी अंदर आदि आप इत्यादि इन इनका इन्हीं इन्हें इन्हों इस इसका इसकी इसके इसमें इसी इसे उन उनका उनकी उनके उनको उन्हीं उन्हें उन्हों उस उसके उसी उसे एक एवं एस ऐसे और कई कर करता करते करना करने करें कहते कहा का काफ़ी कि कितना किन्हें किन्हों किया किर किस किसी किसे की कुछ कुल के को कोई कौन कौनसा गया घर जब जहाँ जा जितना जिन जिन्हें जिन्हों जिस जिसे जीधर जैसा जैसे जो तक तब तरह तिन तिन्हें तिन्हों तिस तिसे तो था थी थे दबारा दिया दुसरा दूसरे दो द्वारा न नके नहीं ना निहायत नीचे ने पर पहले पूरा पे फिर बनी बही बहुत बाद बाला बिलकुल भी भीतर मगर मानो मे में यदि यह यहाँ यही या यिह ये रखें रहा रहे ऱ्वासा लिए लिये लेकिन व वग़ैरह वर्ग वह वहाँ वहीं वाले वुह वे वो सकता सकते सबसे सभी साथ साबुत साभ सारा से सो संग ही हुआ हुई हुए है हैं हो होता होती होते होना होने".split(" ")),e.hi.stemmer=function(){return function(e){return"function"==typeof e.update?e.update(function(e){return e}):e}}();var r=e.wordcut;r.init(),e.hi.tokenizer=function(i){if(!arguments.length||null==i||void 0==i)return[];if(Array.isArray(i))return i.map(function(r){return isLunr2?new e.Token(r.toLowerCase()):r.toLowerCase()});var t=i.toString().toLowerCase().replace(/^\s+/,"");return r.cut(t).split("|")},e.Pipeline.registerFunction(e.hi.stemmer,"stemmer-hi"),e.Pipeline.registerFunction(e.hi.stopWordFilter,"stopWordFilter-hi")}});
File diff suppressed because one or more lines are too long
-1
View File
@@ -1 +0,0 @@
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.hy=function(){this.pipeline.reset(),this.pipeline.add(e.hy.trimmer,e.hy.stopWordFilter)},e.hy.wordCharacters="[A-Za-z԰-֏ff-ﭏ]",e.hy.trimmer=e.trimmerSupport.generateTrimmer(e.hy.wordCharacters),e.Pipeline.registerFunction(e.hy.trimmer,"trimmer-hy"),e.hy.stopWordFilter=e.generateStopWordFilter("դու և եք էիր էիք հետո նաև նրանք որը վրա է որ պիտի են այս մեջ ն իր ու ի այդ որոնք այն կամ էր մի ես համար այլ իսկ էին ենք հետ ին թ էինք մենք նրա նա դուք եմ էի ըստ որպես ում".split(" ")),e.Pipeline.registerFunction(e.hy.stopWordFilter,"stopWordFilter-hy"),e.hy.stemmer=function(){return function(e){return"function"==typeof e.update?e.update(function(e){return e}):e}}(),e.Pipeline.registerFunction(e.hy.stemmer,"stemmer-hy")}});
File diff suppressed because one or more lines are too long
-1
View File
@@ -1 +0,0 @@
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r="2"==e.version[0];e.ja=function(){this.pipeline.reset(),this.pipeline.add(e.ja.trimmer,e.ja.stopWordFilter,e.ja.stemmer),r?this.tokenizer=e.ja.tokenizer:(e.tokenizer&&(e.tokenizer=e.ja.tokenizer),this.tokenizerFn&&(this.tokenizerFn=e.ja.tokenizer))};var t=new e.TinySegmenter;e.ja.tokenizer=function(i){var n,o,s,p,a,u,m,l,c,f;if(!arguments.length||null==i||void 0==i)return[];if(Array.isArray(i))return i.map(function(t){return r?new e.Token(t.toLowerCase()):t.toLowerCase()});for(o=i.toString().toLowerCase().replace(/^\s+/,""),n=o.length-1;n>=0;n--)if(/\S/.test(o.charAt(n))){o=o.substring(0,n+1);break}for(a=[],s=o.length,c=0,l=0;c<=s;c++)if(u=o.charAt(c),m=c-l,u.match(/\s/)||c==s){if(m>0)for(p=t.segment(o.slice(l,c)).filter(function(e){return!!e}),f=l,n=0;n<p.length;n++)r?a.push(new e.Token(p[n],{position:[f,p[n].length],index:a.length})):a.push(p[n]),f+=p[n].length;l=c+1}return a},e.ja.stemmer=function(){return function(e){return e}}(),e.Pipeline.registerFunction(e.ja.stemmer,"stemmer-ja"),e.ja.wordCharacters="一二三四五六七八九十百千万億兆一-龠々〆ヵヶぁ-んァ-ヴーア-ン゙a-zA-Z-zA-0-9-",e.ja.trimmer=e.trimmerSupport.generateTrimmer(e.ja.wordCharacters),e.Pipeline.registerFunction(e.ja.trimmer,"trimmer-ja"),e.ja.stopWordFilter=e.generateStopWordFilter("これ それ あれ この その あの ここ そこ あそこ こちら どこ だれ なに なん 何 私 貴方 貴方方 我々 私達 あの人 あのかた 彼女 彼 です あります おります います は が の に を で え から まで より も どの と し それで しかし".split(" ")),e.Pipeline.registerFunction(e.ja.stopWordFilter,"stopWordFilter-ja"),e.jp=e.ja,e.Pipeline.registerFunction(e.jp.stemmer,"stemmer-jp"),e.Pipeline.registerFunction(e.jp.trimmer,"trimmer-jp"),e.Pipeline.registerFunction(e.jp.stopWordFilter,"stopWordFilter-jp")}});
-1
View File
@@ -1 +0,0 @@
module.exports=require("./lunr.ja");
-1
View File
@@ -1 +0,0 @@
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.kn=function(){this.pipeline.reset(),this.pipeline.add(e.kn.trimmer,e.kn.stopWordFilter,e.kn.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.kn.stemmer))},e.kn.wordCharacters="ಀ-಄ಅ-ಔಕ-ಹಾ-ೌ಼-ಽೕ-ೖೝ-ೞೠ-ೡೢ-ೣ೤೥೦-೯ೱ-ೳ",e.kn.trimmer=e.trimmerSupport.generateTrimmer(e.kn.wordCharacters),e.Pipeline.registerFunction(e.kn.trimmer,"trimmer-kn"),e.kn.stopWordFilter=e.generateStopWordFilter("ಮತ್ತು ಈ ಒಂದು ರಲ್ಲಿ ಹಾಗೂ ಎಂದು ಅಥವಾ ಇದು ರ ಅವರು ಎಂಬ ಮೇಲೆ ಅವರ ತನ್ನ ಆದರೆ ತಮ್ಮ ನಂತರ ಮೂಲಕ ಹೆಚ್ಚು ನ ಆ ಕೆಲವು ಅನೇಕ ಎರಡು ಹಾಗು ಪ್ರಮುಖ ಇದನ್ನು ಇದರ ಸುಮಾರು ಅದರ ಅದು ಮೊದಲ ಬಗ್ಗೆ ನಲ್ಲಿ ರಂದು ಇತರ ಅತ್ಯಂತ ಹೆಚ್ಚಿನ ಸಹ ಸಾಮಾನ್ಯವಾಗಿ ನೇ ಹಲವಾರು ಹೊಸ ದಿ ಕಡಿಮೆ ಯಾವುದೇ ಹೊಂದಿದೆ ದೊಡ್ಡ ಅನ್ನು ಇವರು ಪ್ರಕಾರ ಇದೆ ಮಾತ್ರ ಕೂಡ ಇಲ್ಲಿ ಎಲ್ಲಾ ವಿವಿಧ ಅದನ್ನು ಹಲವು ರಿಂದ ಕೇವಲ ದ ದಕ್ಷಿಣ ಗೆ ಅವನ ಅತಿ ನೆಯ ಬಹಳ ಕೆಲಸ ಎಲ್ಲ ಪ್ರತಿ ಇತ್ಯಾದಿ ಇವು ಬೇರೆ ಹೀಗೆ ನಡುವೆ ಇದಕ್ಕೆ ಎಸ್ ಇವರ ಮೊದಲು ಶ್ರೀ ಮಾಡುವ ಇದರಲ್ಲಿ ರೀತಿಯ ಮಾಡಿದ ಕಾಲ ಅಲ್ಲಿ ಮಾಡಲು ಅದೇ ಈಗ ಅವು ಗಳು ಎ ಎಂಬುದು ಅವನು ಅಂದರೆ ಅವರಿಗೆ ಇರುವ ವಿಶೇಷ ಮುಂದೆ ಅವುಗಳ ಮುಂತಾದ ಮೂಲ ಬಿ ಮೀ ಒಂದೇ ಇನ್ನೂ ಹೆಚ್ಚಾಗಿ ಮಾಡಿ ಅವರನ್ನು ಇದೇ ಯ ರೀತಿಯಲ್ಲಿ ಜೊತೆ ಅದರಲ್ಲಿ ಮಾಡಿದರು ನಡೆದ ಆಗ ಮತ್ತೆ ಪೂರ್ವ ಆತ ಬಂದ ಯಾವ ಒಟ್ಟು ಇತರೆ ಹಿಂದೆ ಪ್ರಮಾಣದ ಗಳನ್ನು ಕುರಿತು ಯು ಆದ್ದರಿಂದ ಅಲ್ಲದೆ ನಗರದ ಮೇಲಿನ ಏಕೆಂದರೆ ರಷ್ಟು ಎಂಬುದನ್ನು ಬಾರಿ ಎಂದರೆ ಹಿಂದಿನ ಆದರೂ ಆದ ಸಂಬಂಧಿಸಿದ ಮತ್ತೊಂದು ಸಿ ಆತನ ".split(" ")),e.kn.stemmer=function(){return function(e){return"function"==typeof e.update?e.update(function(e){return e}):e}}();var r=e.wordcut;r.init(),e.kn.tokenizer=function(t){if(!arguments.length||null==t||void 0==t)return[];if(Array.isArray(t))return t.map(function(r){return isLunr2?new e.Token(r.toLowerCase()):r.toLowerCase()});var n=t.toString().toLowerCase().replace(/^\s+/,"");return r.cut(n).split("|")},e.Pipeline.registerFunction(e.kn.stemmer,"stemmer-kn"),e.Pipeline.registerFunction(e.kn.stopWordFilter,"stopWordFilter-kn")}});
File diff suppressed because one or more lines are too long
-1
View File
@@ -1 +0,0 @@
!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(e.lunr)}(this,function(){return function(e){e.multiLanguage=function(){for(var t=Array.prototype.slice.call(arguments),i=t.join("-"),r="",n=[],s=[],p=0;p<t.length;++p)"en"==t[p]?(r+="\\w",n.unshift(e.stopWordFilter),n.push(e.stemmer),s.push(e.stemmer)):(r+=e[t[p]].wordCharacters,e[t[p]].stopWordFilter&&n.unshift(e[t[p]].stopWordFilter),e[t[p]].stemmer&&(n.push(e[t[p]].stemmer),s.push(e[t[p]].stemmer)));var o=e.trimmerSupport.generateTrimmer(r);return e.Pipeline.registerFunction(o,"lunr-multi-trimmer-"+i),n.unshift(o),function(){this.pipeline.reset(),this.pipeline.add.apply(this.pipeline,n),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add.apply(this.searchPipeline,s))}}}});
File diff suppressed because one or more lines are too long
-18
View File
@@ -1,18 +0,0 @@
/*!
* Lunr languages, `Norwegian` language
* https://github.com/MihaiValentin/lunr-languages
*
* Copyright 2014, Mihai Valentin
* http://www.mozilla.org/MPL/
*/
/*!
* based on
* Snowball JavaScript Library v0.3
* http://code.google.com/p/urim/
* http://snowball.tartarus.org/
*
* Copyright 2010, Oleg Mazko
* http://www.mozilla.org/MPL/
*/
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.no=function(){this.pipeline.reset(),this.pipeline.add(e.no.trimmer,e.no.stopWordFilter,e.no.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.no.stemmer))},e.no.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.no.trimmer=e.trimmerSupport.generateTrimmer(e.no.wordCharacters),e.Pipeline.registerFunction(e.no.trimmer,"trimmer-no"),e.no.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,i=new function(){function e(){var e,r=w.cursor+3;if(a=w.limit,0<=r||r<=w.limit){for(s=r;;){if(e=w.cursor,w.in_grouping(d,97,248)){w.cursor=e;break}if(e>=w.limit)return;w.cursor=e+1}for(;!w.out_grouping(d,97,248);){if(w.cursor>=w.limit)return;w.cursor++}a=w.cursor,a<s&&(a=s)}}function i(){var e,r,n;if(w.cursor>=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(m,29),w.limit_backward=r,e))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:n=w.limit-w.cursor,w.in_grouping_b(c,98,122)?w.slice_del():(w.cursor=w.limit-n,w.eq_s_b(1,"k")&&w.out_grouping_b(d,97,248)&&w.slice_del());break;case 3:w.slice_from("er")}}function t(){var e,r=w.limit-w.cursor;w.cursor>=a&&(e=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,w.find_among_b(u,2)?(w.bra=w.cursor,w.limit_backward=e,w.cursor=w.limit-r,w.cursor>w.limit_backward&&(w.cursor--,w.bra=w.cursor,w.slice_del())):w.limit_backward=e)}function o(){var e,r;w.cursor>=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(l,11),e?(w.bra=w.cursor,w.limit_backward=r,1==e&&w.slice_del()):w.limit_backward=r)}var s,a,m=[new r("a",-1,1),new r("e",-1,1),new r("ede",1,1),new r("ande",1,1),new r("ende",1,1),new r("ane",1,1),new r("ene",1,1),new r("hetene",6,1),new r("erte",1,3),new r("en",-1,1),new r("heten",9,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",12,1),new r("s",-1,2),new r("as",14,1),new r("es",14,1),new r("edes",16,1),new r("endes",16,1),new r("enes",16,1),new r("hetenes",19,1),new r("ens",14,1),new r("hetens",21,1),new r("ers",14,1),new r("ets",14,1),new r("et",-1,1),new r("het",25,1),new r("ert",-1,3),new r("ast",-1,1)],u=[new r("dt",-1,-1),new r("vt",-1,-1)],l=[new r("leg",-1,1),new r("eleg",0,1),new r("ig",-1,1),new r("eig",2,1),new r("lig",2,1),new r("elig",4,1),new r("els",-1,1),new r("lov",-1,1),new r("elov",7,1),new r("slov",7,1),new r("hetslov",9,1)],d=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],c=[119,125,149,1],w=new n;this.setCurrent=function(e){w.setCurrent(e)},this.getCurrent=function(){return w.getCurrent()},this.stem=function(){var r=w.cursor;return e(),w.limit_backward=r,w.cursor=w.limit,i(),w.cursor=w.limit,t(),w.cursor=w.limit,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.no.stemmer,"stemmer-no"),e.no.stopWordFilter=e.generateStopWordFilter("alle at av bare begge ble blei bli blir blitt både båe da de deg dei deim deira deires dem den denne der dere deres det dette di din disse ditt du dykk dykkar då eg ein eit eitt eller elles en enn er et ett etter for fordi fra før ha hadde han hans har hennar henne hennes her hjå ho hoe honom hoss hossen hun hva hvem hver hvilke hvilken hvis hvor hvordan hvorfor i ikke ikkje ikkje ingen ingi inkje inn inni ja jeg kan kom korleis korso kun kunne kva kvar kvarhelst kven kvi kvifor man mange me med medan meg meget mellom men mi min mine mitt mot mykje ned no noe noen noka noko nokon nokor nokre nå når og også om opp oss over på samme seg selv si si sia sidan siden sin sine sitt sjøl skal skulle slik so som som somme somt så sånn til um upp ut uten var vart varte ved vere verte vi vil ville vore vors vort vår være være vært å".split(" ")),e.Pipeline.registerFunction(e.no.stopWordFilter,"stopWordFilter-no")}});
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-1
View File
@@ -1 +0,0 @@
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.sa=function(){this.pipeline.reset(),this.pipeline.add(e.sa.trimmer,e.sa.stopWordFilter,e.sa.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.sa.stemmer))},e.sa.wordCharacters="ऀ-ःऄ-एऐ-टठ-यर-िी-ॏॐ-य़ॠ-९॰-ॿ꣠-꣱ꣲ-ꣷ꣸-ꣻ꣼-ꣽꣾ-ꣿᆰ0-ᆰ9",e.sa.trimmer=e.trimmerSupport.generateTrimmer(e.sa.wordCharacters),e.Pipeline.registerFunction(e.sa.trimmer,"trimmer-sa"),e.sa.stopWordFilter=e.generateStopWordFilter('तथा अयम्‌ एकम्‌ इत्यस्मिन्‌ तथा तत्‌ वा अयम्‌ इत्यस्य ते आहूत उपरि तेषाम्‌ किन्तु तेषाम्‌ तदा इत्यनेन अधिकः इत्यस्य तत्‌ केचन बहवः द्वि तथा महत्वपूर्णः अयम्‌ अस्य विषये अयं अस्ति तत्‌ प्रथमः विषये इत्युपरि इत्युपरि इतर अधिकतमः अधिकः अपि सामान्यतया ठ इतरेतर नूतनम्‌ द न्यूनम्‌ कश्चित्‌ वा विशालः द सः अस्ति तदनुसारम् तत्र अस्ति केवलम्‌ अपि अत्र सर्वे विविधाः तत्‌ बहवः यतः इदानीम्‌ द दक्षिण इत्यस्मै तस्य उपरि नथ अतीव कार्यम्‌ सर्वे एकैकम्‌ इत्यादि। एते सन्ति उत इत्थम्‌ मध्ये एतदर्थं . स कस्य प्रथमः श्री. करोति अस्मिन् प्रकारः निर्मिता कालः तत्र कर्तुं समान अधुना ते सन्ति स एकः अस्ति सः अर्थात् तेषां कृते . स्थितम् विशेषः अग्रिम तेषाम्‌ समान स्रोतः ख म समान इदानीमपि अधिकतया करोतु ते समान इत्यस्य वीथी सह यस्मिन् कृतवान्‌ धृतः तदा पुनः पूर्वं सः आगतः किम्‌ कुल इतर पुरा मात्रा स विषये उ अतएव अपि नगरस्य उपरि यतः प्रतिशतं कतरः कालः साधनानि भूत तथापि जात सम्बन्धि अन्यत्‌ ग अतः अस्माकं स्वकीयाः अस्माकं इदानीं अन्तः इत्यादयः भवन्तः इत्यादयः एते एताः तस्य अस्य इदम् एते तेषां तेषां तेषां तान् तेषां तेषां तेषां समानः सः एकः च तादृशाः बहवः अन्ये च वदन्ति यत् कियत् कस्मै कस्मै यस्मै यस्मै यस्मै यस्मै न अतिनीचः किन्तु प्रथमं सम्पूर्णतया ततः चिरकालानन्तरं पुस्तकं सम्पूर्णतया अन्तः किन्तु अत्र वा इह इव श्रद्धाय अवशिष्यते परन्तु अन्ये वर्गाः सन्ति ते सन्ति शक्नुवन्ति सर्वे मिलित्वा सर्वे एकत्र"'.split(" ")),e.sa.stemmer=function(){return function(e){return"function"==typeof e.update?e.update(function(e){return e}):e}}();var r=e.wordcut;r.init(),e.sa.tokenizer=function(t){if(!arguments.length||null==t||void 0==t)return[];if(Array.isArray(t))return t.map(function(r){return isLunr2?new e.Token(r.toLowerCase()):r.toLowerCase()});var i=t.toString().toLowerCase().replace(/^\s+/,"");return r.cut(i).split("|")},e.Pipeline.registerFunction(e.sa.stemmer,"stemmer-sa"),e.Pipeline.registerFunction(e.sa.stopWordFilter,"stopWordFilter-sa")}});
@@ -1 +0,0 @@
!function(r,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(r.lunr)}(this,function(){return function(r){r.stemmerSupport={Among:function(r,t,i,s){if(this.toCharArray=function(r){for(var t=r.length,i=new Array(t),s=0;s<t;s++)i[s]=r.charCodeAt(s);return i},!r&&""!=r||!t&&0!=t||!i)throw"Bad Among initialisation: s:"+r+", substring_i: "+t+", result: "+i;this.s_size=r.length,this.s=this.toCharArray(r),this.substring_i=t,this.result=i,this.method=s},SnowballProgram:function(){var r;return{bra:0,ket:0,limit:0,cursor:0,limit_backward:0,setCurrent:function(t){r=t,this.cursor=0,this.limit=t.length,this.limit_backward=0,this.bra=this.cursor,this.ket=this.limit},getCurrent:function(){var t=r;return r=null,t},in_grouping:function(t,i,s){if(this.cursor<this.limit){var e=r.charCodeAt(this.cursor);if(e<=s&&e>=i&&(e-=i,t[e>>3]&1<<(7&e)))return this.cursor++,!0}return!1},in_grouping_b:function(t,i,s){if(this.cursor>this.limit_backward){var e=r.charCodeAt(this.cursor-1);if(e<=s&&e>=i&&(e-=i,t[e>>3]&1<<(7&e)))return this.cursor--,!0}return!1},out_grouping:function(t,i,s){if(this.cursor<this.limit){var e=r.charCodeAt(this.cursor);if(e>s||e<i)return this.cursor++,!0;if(e-=i,!(t[e>>3]&1<<(7&e)))return this.cursor++,!0}return!1},out_grouping_b:function(t,i,s){if(this.cursor>this.limit_backward){var e=r.charCodeAt(this.cursor-1);if(e>s||e<i)return this.cursor--,!0;if(e-=i,!(t[e>>3]&1<<(7&e)))return this.cursor--,!0}return!1},eq_s:function(t,i){if(this.limit-this.cursor<t)return!1;for(var s=0;s<t;s++)if(r.charCodeAt(this.cursor+s)!=i.charCodeAt(s))return!1;return this.cursor+=t,!0},eq_s_b:function(t,i){if(this.cursor-this.limit_backward<t)return!1;for(var s=0;s<t;s++)if(r.charCodeAt(this.cursor-t+s)!=i.charCodeAt(s))return!1;return this.cursor-=t,!0},find_among:function(t,i){for(var s=0,e=i,n=this.cursor,u=this.limit,o=0,h=0,c=!1;;){for(var a=s+(e-s>>1),f=0,l=o<h?o:h,_=t[a],m=l;m<_.s_size;m++){if(n+l==u){f=-1;break}if(f=r.charCodeAt(n+l)-_.s[m])break;l++}if(f<0?(e=a,h=l):(s=a,o=l),e-s<=1){if(s>0||e==s||c)break;c=!0}}for(;;){var _=t[s];if(o>=_.s_size){if(this.cursor=n+_.s_size,!_.method)return _.result;var b=_.method();if(this.cursor=n+_.s_size,b)return _.result}if((s=_.substring_i)<0)return 0}},find_among_b:function(t,i){for(var s=0,e=i,n=this.cursor,u=this.limit_backward,o=0,h=0,c=!1;;){for(var a=s+(e-s>>1),f=0,l=o<h?o:h,_=t[a],m=_.s_size-1-l;m>=0;m--){if(n-l==u){f=-1;break}if(f=r.charCodeAt(n-1-l)-_.s[m])break;l++}if(f<0?(e=a,h=l):(s=a,o=l),e-s<=1){if(s>0||e==s||c)break;c=!0}}for(;;){var _=t[s];if(o>=_.s_size){if(this.cursor=n-_.s_size,!_.method)return _.result;var b=_.method();if(this.cursor=n-_.s_size,b)return _.result}if((s=_.substring_i)<0)return 0}},replace_s:function(t,i,s){var e=s.length-(i-t),n=r.substring(0,t),u=r.substring(i);return r=n+s+u,this.limit+=e,this.cursor>=i?this.cursor+=e:this.cursor>t&&(this.cursor=t),e},slice_check:function(){if(this.bra<0||this.bra>this.ket||this.ket>this.limit||this.limit>r.length)throw"faulty slice operation"},slice_from:function(r){this.slice_check(),this.replace_s(this.bra,this.ket,r)},slice_del:function(){this.slice_from("")},insert:function(r,t,i){var s=this.replace_s(r,t,i);r<=this.bra&&(this.bra+=s),r<=this.ket&&(this.ket+=s)},slice_to:function(){return this.slice_check(),r.substring(this.bra,this.ket)},eq_v_b:function(r){return this.eq_s_b(r.length,r)}}}},r.trimmerSupport={generateTrimmer:function(r){var t=new RegExp("^[^"+r+"]+"),i=new RegExp("[^"+r+"]+$");return function(r){return"function"==typeof r.update?r.update(function(r){return r.replace(t,"").replace(i,"")}):r.replace(t,"").replace(i,"")}}}}});
-18
View File
@@ -1,18 +0,0 @@
/*!
* Lunr languages, `Swedish` language
* https://github.com/MihaiValentin/lunr-languages
*
* Copyright 2014, Mihai Valentin
* http://www.mozilla.org/MPL/
*/
/*!
* based on
* Snowball JavaScript Library v0.3
* http://code.google.com/p/urim/
* http://snowball.tartarus.org/
*
* Copyright 2010, Oleg Mazko
* http://www.mozilla.org/MPL/
*/
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.sv=function(){this.pipeline.reset(),this.pipeline.add(e.sv.trimmer,e.sv.stopWordFilter,e.sv.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.sv.stemmer))},e.sv.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.sv.trimmer=e.trimmerSupport.generateTrimmer(e.sv.wordCharacters),e.Pipeline.registerFunction(e.sv.trimmer,"trimmer-sv"),e.sv.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,t=new function(){function e(){var e,r=w.cursor+3;if(o=w.limit,0<=r||r<=w.limit){for(a=r;;){if(e=w.cursor,w.in_grouping(l,97,246)){w.cursor=e;break}if(w.cursor=e,w.cursor>=w.limit)return;w.cursor++}for(;!w.out_grouping(l,97,246);){if(w.cursor>=w.limit)return;w.cursor++}o=w.cursor,o<a&&(o=a)}}function t(){var e,r=w.limit_backward;if(w.cursor>=o&&(w.limit_backward=o,w.cursor=w.limit,w.ket=w.cursor,e=w.find_among_b(u,37),w.limit_backward=r,e))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:w.in_grouping_b(d,98,121)&&w.slice_del()}}function i(){var e=w.limit_backward;w.cursor>=o&&(w.limit_backward=o,w.cursor=w.limit,w.find_among_b(c,7)&&(w.cursor=w.limit,w.ket=w.cursor,w.cursor>w.limit_backward&&(w.bra=--w.cursor,w.slice_del())),w.limit_backward=e)}function s(){var e,r;if(w.cursor>=o){if(r=w.limit_backward,w.limit_backward=o,w.cursor=w.limit,w.ket=w.cursor,e=w.find_among_b(m,5))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:w.slice_from("lös");break;case 3:w.slice_from("full")}w.limit_backward=r}}var a,o,u=[new r("a",-1,1),new r("arna",0,1),new r("erna",0,1),new r("heterna",2,1),new r("orna",0,1),new r("ad",-1,1),new r("e",-1,1),new r("ade",6,1),new r("ande",6,1),new r("arne",6,1),new r("are",6,1),new r("aste",6,1),new r("en",-1,1),new r("anden",12,1),new r("aren",12,1),new r("heten",12,1),new r("ern",-1,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",18,1),new r("or",-1,1),new r("s",-1,2),new r("as",21,1),new r("arnas",22,1),new r("ernas",22,1),new r("ornas",22,1),new r("es",21,1),new r("ades",26,1),new r("andes",26,1),new r("ens",21,1),new r("arens",29,1),new r("hetens",29,1),new r("erns",21,1),new r("at",-1,1),new r("andet",-1,1),new r("het",-1,1),new r("ast",-1,1)],c=[new r("dd",-1,-1),new r("gd",-1,-1),new r("nn",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1),new r("tt",-1,-1)],m=[new r("ig",-1,1),new r("lig",0,1),new r("els",-1,1),new r("fullt",-1,3),new r("löst",-1,2)],l=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,24,0,32],d=[119,127,149],w=new n;this.setCurrent=function(e){w.setCurrent(e)},this.getCurrent=function(){return w.getCurrent()},this.stem=function(){var r=w.cursor;return e(),w.limit_backward=r,w.cursor=w.limit,t(),w.cursor=w.limit,i(),w.cursor=w.limit,s(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return t.setCurrent(e),t.stem(),t.getCurrent()}):(t.setCurrent(e),t.stem(),t.getCurrent())}}(),e.Pipeline.registerFunction(e.sv.stemmer,"stemmer-sv"),e.sv.stopWordFilter=e.generateStopWordFilter("alla allt att av blev bli blir blivit de dem den denna deras dess dessa det detta dig din dina ditt du där då efter ej eller en er era ert ett från för ha hade han hans har henne hennes hon honom hur här i icke ingen inom inte jag ju kan kunde man med mellan men mig min mina mitt mot mycket ni nu när någon något några och om oss på samma sedan sig sin sina sitta själv skulle som så sådan sådana sådant till under upp ut utan vad var vara varför varit varje vars vart vem vi vid vilka vilkas vilken vilket vår våra vårt än är åt över".split(" ")),e.Pipeline.registerFunction(e.sv.stopWordFilter,"stopWordFilter-sv")}});
-1
View File
@@ -1 +0,0 @@
!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.ta=function(){this.pipeline.reset(),this.pipeline.add(e.ta.trimmer,e.ta.stopWordFilter,e.ta.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.ta.stemmer))},e.ta.wordCharacters="஀-உஊ-ஏஐ-ஙச-ட஠-னப-யர-ஹ஺-ிீ-௉ொ-௏ௐ-௙௚-௟௠-௩௪-௯௰-௹௺-௿a-zA-Z-zA-0-9-",e.ta.trimmer=e.trimmerSupport.generateTrimmer(e.ta.wordCharacters),e.Pipeline.registerFunction(e.ta.trimmer,"trimmer-ta"),e.ta.stopWordFilter=e.generateStopWordFilter("அங்கு அங்கே அது அதை அந்த அவர் அவர்கள் அவள் அவன் அவை ஆக ஆகவே ஆகையால் ஆதலால் ஆதலினால் ஆனாலும் ஆனால் இங்கு இங்கே இது இதை இந்த இப்படி இவர் இவர்கள் இவள் இவன் இவை இவ்வளவு உனக்கு உனது உன் உன்னால் எங்கு எங்கே எது எதை எந்த எப்படி எவர் எவர்கள் எவள் எவன் எவை எவ்வளவு எனக்கு எனது எனவே என் என்ன என்னால் ஏது ஏன் தனது தன்னால் தானே தான் நாங்கள் நாம் நான் நீ நீங்கள்".split(" ")),e.ta.stemmer=function(){return function(e){return"function"==typeof e.update?e.update(function(e){return e}):e}}();var t=e.wordcut;t.init(),e.ta.tokenizer=function(r){if(!arguments.length||null==r||void 0==r)return[];if(Array.isArray(r))return r.map(function(t){return isLunr2?new e.Token(t.toLowerCase()):t.toLowerCase()});var i=r.toString().toLowerCase().replace(/^\s+/,"");return t.cut(i).split("|")},e.Pipeline.registerFunction(e.ta.stemmer,"stemmer-ta"),e.Pipeline.registerFunction(e.ta.stopWordFilter,"stopWordFilter-ta")}});
-1
View File
@@ -1 +0,0 @@
!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.te=function(){this.pipeline.reset(),this.pipeline.add(e.te.trimmer,e.te.stopWordFilter,e.te.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.te.stemmer))},e.te.wordCharacters="ఀ-ఄఅ-ఔక-హా-ౌౕ-ౖౘ-ౚౠ-ౡౢ-ౣ౦-౯౸-౿఼ఽ్ౝ౷౤౥",e.te.trimmer=e.trimmerSupport.generateTrimmer(e.te.wordCharacters),e.Pipeline.registerFunction(e.te.trimmer,"trimmer-te"),e.te.stopWordFilter=e.generateStopWordFilter("అందరూ అందుబాటులో అడగండి అడగడం అడ్డంగా అనుగుణంగా అనుమతించు అనుమతిస్తుంది అయితే ఇప్పటికే ఉన్నారు ఎక్కడైనా ఎప్పుడు ఎవరైనా ఎవరో ఏ ఏదైనా ఏమైనప్పటికి ఒక ఒకరు కనిపిస్తాయి కాదు కూడా గా గురించి చుట్టూ చేయగలిగింది తగిన తర్వాత దాదాపు దూరంగా నిజంగా పై ప్రకారం ప్రక్కన మధ్య మరియు మరొక మళ్ళీ మాత్రమే మెచ్చుకో వద్ద వెంట వేరుగా వ్యతిరేకంగా సంబంధం".split(" ")),e.te.stemmer=function(){return function(e){return"function"==typeof e.update?e.update(function(e){return e}):e}}();var t=e.wordcut;t.init(),e.te.tokenizer=function(r){if(!arguments.length||null==r||void 0==r)return[];if(Array.isArray(r))return r.map(function(t){return isLunr2?new e.Token(t.toLowerCase()):t.toLowerCase()});var i=r.toString().toLowerCase().replace(/^\s+/,"");return t.cut(i).split("|")},e.Pipeline.registerFunction(e.te.stemmer,"stemmer-te"),e.Pipeline.registerFunction(e.te.stopWordFilter,"stopWordFilter-te")}});
-1
View File
@@ -1 +0,0 @@
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r="2"==e.version[0];e.th=function(){this.pipeline.reset(),this.pipeline.add(e.th.trimmer),r?this.tokenizer=e.th.tokenizer:(e.tokenizer&&(e.tokenizer=e.th.tokenizer),this.tokenizerFn&&(this.tokenizerFn=e.th.tokenizer))},e.th.wordCharacters="[฀-๿]",e.th.trimmer=e.trimmerSupport.generateTrimmer(e.th.wordCharacters),e.Pipeline.registerFunction(e.th.trimmer,"trimmer-th");var t=e.wordcut;t.init(),e.th.tokenizer=function(i){if(!arguments.length||null==i||void 0==i)return[];if(Array.isArray(i))return i.map(function(t){return r?new e.Token(t):t});var n=i.toString().replace(/^\s+/,"");return t.cut(n).split("|")}}});
File diff suppressed because one or more lines are too long
-1
View File
@@ -1 +0,0 @@
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.vi=function(){this.pipeline.reset(),this.pipeline.add(e.vi.stopWordFilter,e.vi.trimmer)},e.vi.wordCharacters="[A-Za-ẓ̀͐́͑̉̃̓ÂâÊêÔôĂ-ăĐ-đƠ-ơƯ-ư]",e.vi.trimmer=e.trimmerSupport.generateTrimmer(e.vi.wordCharacters),e.Pipeline.registerFunction(e.vi.trimmer,"trimmer-vi"),e.vi.stopWordFilter=e.generateStopWordFilter("là cái nhưng mà".split(" "))}});
-1
View File
@@ -1 +0,0 @@
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r(require("@node-rs/jieba")):r()(e.lunr)}(this,function(e){return function(r,t){if(void 0===r)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===r.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var i="2"==r.version[0];r.zh=function(){this.pipeline.reset(),this.pipeline.add(r.zh.trimmer,r.zh.stopWordFilter,r.zh.stemmer),i?this.tokenizer=r.zh.tokenizer:(r.tokenizer&&(r.tokenizer=r.zh.tokenizer),this.tokenizerFn&&(this.tokenizerFn=r.zh.tokenizer))},r.zh.tokenizer=function(n){if(!arguments.length||null==n||void 0==n)return[];if(Array.isArray(n))return n.map(function(e){return i?new r.Token(e.toLowerCase()):e.toLowerCase()});t&&e.load(t);var o=n.toString().trim().toLowerCase(),s=[];e.cut(o,!0).forEach(function(e){s=s.concat(e.split(" "))}),s=s.filter(function(e){return!!e});var u=0;return s.map(function(e,t){if(i){var n=o.indexOf(e,u),s={};return s.position=[n,e.length],s.index=t,u=n,new r.Token(e,s)}return e})},r.zh.wordCharacters="\\w一-龥",r.zh.trimmer=r.trimmerSupport.generateTrimmer(r.zh.wordCharacters),r.Pipeline.registerFunction(r.zh.trimmer,"trimmer-zh"),r.zh.stemmer=function(){return function(e){return e}}(),r.Pipeline.registerFunction(r.zh.stemmer,"stemmer-zh"),r.zh.stopWordFilter=r.generateStopWordFilter("的 一 不 在 人 有 是 为 為 以 于 於 上 他 而 后 後 之 来 來 及 了 因 下 可 到 由 这 這 与 與 也 此 但 并 並 个 個 其 已 无 無 小 我 们 們 起 最 再 今 去 好 只 又 或 很 亦 某 把 那 你 乃 它 吧 被 比 别 趁 当 當 从 從 得 打 凡 儿 兒 尔 爾 该 該 各 给 給 跟 和 何 还 還 即 几 幾 既 看 据 據 距 靠 啦 另 么 麽 每 嘛 拿 哪 您 凭 憑 且 却 卻 让 讓 仍 啥 如 若 使 谁 誰 虽 雖 随 隨 同 所 她 哇 嗡 往 些 向 沿 哟 喲 用 咱 则 則 怎 曾 至 致 着 著 诸 諸 自".split(" ")),r.Pipeline.registerFunction(r.zh.stopWordFilter,"stopWordFilter-zh")}});
-206
View File
@@ -1,206 +0,0 @@
/**
* export the module via AMD, CommonJS or as a browser global
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
*/
;(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(factory)
} else if (typeof exports === 'object') {
/**
* Node. Does not work with strict CommonJS, but
* only CommonJS-like environments that support module.exports,
* like Node.
*/
module.exports = factory()
} else {
// Browser globals (root is window)
factory()(root.lunr);
}
}(this, function () {
/**
* Just return a value to define the module export.
* This example returns an object, but the module
* can return a function as the exported value.
*/
return function(lunr) {
// TinySegmenter 0.1 -- Super compact Japanese tokenizer in Javascript
// (c) 2008 Taku Kudo <taku@chasen.org>
// TinySegmenter is freely distributable under the terms of a new BSD licence.
// For details, see http://chasen.org/~taku/software/TinySegmenter/LICENCE.txt
function TinySegmenter() {
var patterns = {
"[一二三四五六七八九十百千万億兆]":"M",
"[一-龠々〆ヵヶ]":"H",
"[ぁ-ん]":"I",
"[ァ-ヴーア-ン゙ー]":"K",
"[a-zA-Z-zA-]":"A",
"[0-9-]":"N"
}
this.chartype_ = [];
for (var i in patterns) {
var regexp = new RegExp(i);
this.chartype_.push([regexp, patterns[i]]);
}
this.BIAS__ = -332
this.BC1__ = {"HH":6,"II":2461,"KH":406,"OH":-1378};
this.BC2__ = {"AA":-3267,"AI":2744,"AN":-878,"HH":-4070,"HM":-1711,"HN":4012,"HO":3761,"IA":1327,"IH":-1184,"II":-1332,"IK":1721,"IO":5492,"KI":3831,"KK":-8741,"MH":-3132,"MK":3334,"OO":-2920};
this.BC3__ = {"HH":996,"HI":626,"HK":-721,"HN":-1307,"HO":-836,"IH":-301,"KK":2762,"MK":1079,"MM":4034,"OA":-1652,"OH":266};
this.BP1__ = {"BB":295,"OB":304,"OO":-125,"UB":352};
this.BP2__ = {"BO":60,"OO":-1762};
this.BQ1__ = {"BHH":1150,"BHM":1521,"BII":-1158,"BIM":886,"BMH":1208,"BNH":449,"BOH":-91,"BOO":-2597,"OHI":451,"OIH":-296,"OKA":1851,"OKH":-1020,"OKK":904,"OOO":2965};
this.BQ2__ = {"BHH":118,"BHI":-1159,"BHM":466,"BIH":-919,"BKK":-1720,"BKO":864,"OHH":-1139,"OHM":-181,"OIH":153,"UHI":-1146};
this.BQ3__ = {"BHH":-792,"BHI":2664,"BII":-299,"BKI":419,"BMH":937,"BMM":8335,"BNN":998,"BOH":775,"OHH":2174,"OHM":439,"OII":280,"OKH":1798,"OKI":-793,"OKO":-2242,"OMH":-2402,"OOO":11699};
this.BQ4__ = {"BHH":-3895,"BIH":3761,"BII":-4654,"BIK":1348,"BKK":-1806,"BMI":-3385,"BOO":-12396,"OAH":926,"OHH":266,"OHK":-2036,"ONN":-973};
this.BW1__ = {",と":660,",同":727,"B1あ":1404,"B1同":542,"、と":660,"、同":727,"」と":1682,"あっ":1505,"いう":1743,"いっ":-2055,"いる":672,"うし":-4817,"うん":665,"から":3472,"がら":600,"こう":-790,"こと":2083,"こん":-1262,"さら":-4143,"さん":4573,"した":2641,"して":1104,"すで":-3399,"そこ":1977,"それ":-871,"たち":1122,"ため":601,"った":3463,"つい":-802,"てい":805,"てき":1249,"でき":1127,"です":3445,"では":844,"とい":-4915,"とみ":1922,"どこ":3887,"ない":5713,"なっ":3015,"など":7379,"なん":-1113,"にし":2468,"には":1498,"にも":1671,"に対":-912,"の一":-501,"の中":741,"ませ":2448,"まで":1711,"まま":2600,"まる":-2155,"やむ":-1947,"よっ":-2565,"れた":2369,"れで":-913,"をし":1860,"を見":731,"亡く":-1886,"京都":2558,"取り":-2784,"大き":-2604,"大阪":1497,"平方":-2314,"引き":-1336,"日本":-195,"本当":-2423,"毎日":-2113,"目指":-724,"B1あ":1404,"B1同":542,"」と":1682};
this.BW2__ = {"..":-11822,"11":-669,"――":-5730,"−−":-13175,"いう":-1609,"うか":2490,"かし":-1350,"かも":-602,"から":-7194,"かれ":4612,"がい":853,"がら":-3198,"きた":1941,"くな":-1597,"こと":-8392,"この":-4193,"させ":4533,"され":13168,"さん":-3977,"しい":-1819,"しか":-545,"した":5078,"して":972,"しな":939,"その":-3744,"たい":-1253,"たた":-662,"ただ":-3857,"たち":-786,"たと":1224,"たは":-939,"った":4589,"って":1647,"っと":-2094,"てい":6144,"てき":3640,"てく":2551,"ては":-3110,"ても":-3065,"でい":2666,"でき":-1528,"でし":-3828,"です":-4761,"でも":-4203,"とい":1890,"とこ":-1746,"とと":-2279,"との":720,"とみ":5168,"とも":-3941,"ない":-2488,"なが":-1313,"など":-6509,"なの":2614,"なん":3099,"にお":-1615,"にし":2748,"にな":2454,"によ":-7236,"に対":-14943,"に従":-4688,"に関":-11388,"のか":2093,"ので":-7059,"のに":-6041,"のの":-6125,"はい":1073,"はが":-1033,"はず":-2532,"ばれ":1813,"まし":-1316,"まで":-6621,"まれ":5409,"めて":-3153,"もい":2230,"もの":-10713,"らか":-944,"らし":-1611,"らに":-1897,"りし":651,"りま":1620,"れた":4270,"れて":849,"れば":4114,"ろう":6067,"われ":7901,"を通":-11877,"んだ":728,"んな":-4115,"一人":602,"一方":-1375,"一日":970,"一部":-1051,"上が":-4479,"会社":-1116,"出て":2163,"分の":-7758,"同党":970,"同日":-913,"大阪":-2471,"委員":-1250,"少な":-1050,"年度":-8669,"年間":-1626,"府県":-2363,"手権":-1982,"新聞":-4066,"日新":-722,"日本":-7068,"日米":3372,"曜日":-601,"朝鮮":-2355,"本人":-2697,"東京":-1543,"然と":-1384,"社会":-1276,"立て":-990,"第に":-1612,"米国":-4268,"11":-669};
this.BW3__ = {"あた":-2194,"あり":719,"ある":3846,"い.":-1185,"い。":-1185,"いい":5308,"いえ":2079,"いく":3029,"いた":2056,"いっ":1883,"いる":5600,"いわ":1527,"うち":1117,"うと":4798,"えと":1454,"か.":2857,"か。":2857,"かけ":-743,"かっ":-4098,"かに":-669,"から":6520,"かり":-2670,"が,":1816,"が、":1816,"がき":-4855,"がけ":-1127,"がっ":-913,"がら":-4977,"がり":-2064,"きた":1645,"けど":1374,"こと":7397,"この":1542,"ころ":-2757,"さい":-714,"さを":976,"し,":1557,"し、":1557,"しい":-3714,"した":3562,"して":1449,"しな":2608,"しま":1200,"す.":-1310,"す。":-1310,"する":6521,"ず,":3426,"ず、":3426,"ずに":841,"そう":428,"た.":8875,"た。":8875,"たい":-594,"たの":812,"たり":-1183,"たる":-853,"だ.":4098,"だ。":4098,"だっ":1004,"った":-4748,"って":300,"てい":6240,"てお":855,"ても":302,"です":1437,"でに":-1482,"では":2295,"とう":-1387,"とし":2266,"との":541,"とも":-3543,"どう":4664,"ない":1796,"なく":-903,"など":2135,"に,":-1021,"に、":-1021,"にし":1771,"にな":1906,"には":2644,"の,":-724,"の、":-724,"の子":-1000,"は,":1337,"は、":1337,"べき":2181,"まし":1113,"ます":6943,"まっ":-1549,"まで":6154,"まれ":-793,"らし":1479,"られ":6820,"るる":3818,"れ,":854,"れ、":854,"れた":1850,"れて":1375,"れば":-3246,"れる":1091,"われ":-605,"んだ":606,"んで":798,"カ月":990,"会議":860,"入り":1232,"大会":2217,"始め":1681,"市":965,"新聞":-5055,"日,":974,"日、":974,"社会":2024,"カ月":990};
this.TC1__ = {"AAA":1093,"HHH":1029,"HHM":580,"HII":998,"HOH":-390,"HOM":-331,"IHI":1169,"IOH":-142,"IOI":-1015,"IOM":467,"MMH":187,"OOI":-1832};
this.TC2__ = {"HHO":2088,"HII":-1023,"HMM":-1154,"IHI":-1965,"KKH":703,"OII":-2649};
this.TC3__ = {"AAA":-294,"HHH":346,"HHI":-341,"HII":-1088,"HIK":731,"HOH":-1486,"IHH":128,"IHI":-3041,"IHO":-1935,"IIH":-825,"IIM":-1035,"IOI":-542,"KHH":-1216,"KKA":491,"KKH":-1217,"KOK":-1009,"MHH":-2694,"MHM":-457,"MHO":123,"MMH":-471,"NNH":-1689,"NNO":662,"OHO":-3393};
this.TC4__ = {"HHH":-203,"HHI":1344,"HHK":365,"HHM":-122,"HHN":182,"HHO":669,"HIH":804,"HII":679,"HOH":446,"IHH":695,"IHO":-2324,"IIH":321,"III":1497,"IIO":656,"IOO":54,"KAK":4845,"KKA":3386,"KKK":3065,"MHH":-405,"MHI":201,"MMH":-241,"MMM":661,"MOM":841};
this.TQ1__ = {"BHHH":-227,"BHHI":316,"BHIH":-132,"BIHH":60,"BIII":1595,"BNHH":-744,"BOHH":225,"BOOO":-908,"OAKK":482,"OHHH":281,"OHIH":249,"OIHI":200,"OIIH":-68};
this.TQ2__ = {"BIHH":-1401,"BIII":-1033,"BKAK":-543,"BOOO":-5591};
this.TQ3__ = {"BHHH":478,"BHHM":-1073,"BHIH":222,"BHII":-504,"BIIH":-116,"BIII":-105,"BMHI":-863,"BMHM":-464,"BOMH":620,"OHHH":346,"OHHI":1729,"OHII":997,"OHMH":481,"OIHH":623,"OIIH":1344,"OKAK":2792,"OKHH":587,"OKKA":679,"OOHH":110,"OOII":-685};
this.TQ4__ = {"BHHH":-721,"BHHM":-3604,"BHII":-966,"BIIH":-607,"BIII":-2181,"OAAA":-2763,"OAKK":180,"OHHH":-294,"OHHI":2446,"OHHO":480,"OHIH":-1573,"OIHH":1935,"OIHI":-493,"OIIH":626,"OIII":-4007,"OKAK":-8156};
this.TW1__ = {"につい":-4681,"東京都":2026};
this.TW2__ = {"ある程":-2049,"いった":-1256,"ころが":-2434,"しょう":3873,"その後":-4430,"だって":-1049,"ていた":1833,"として":-4657,"ともに":-4517,"もので":1882,"一気に":-792,"初めて":-1512,"同時に":-8097,"大きな":-1255,"対して":-2721,"社会党":-3216};
this.TW3__ = {"いただ":-1734,"してい":1314,"として":-4314,"につい":-5483,"にとっ":-5989,"に当た":-6247,"ので,":-727,"ので、":-727,"のもの":-600,"れから":-3752,"十二月":-2287};
this.TW4__ = {"いう.":8576,"いう。":8576,"からな":-2348,"してい":2958,"たが,":1516,"たが、":1516,"ている":1538,"という":1349,"ました":5543,"ません":1097,"ようと":-4258,"よると":5865};
this.UC1__ = {"A":484,"K":93,"M":645,"O":-505};
this.UC2__ = {"A":819,"H":1059,"I":409,"M":3987,"N":5775,"O":646};
this.UC3__ = {"A":-1370,"I":2311};
this.UC4__ = {"A":-2643,"H":1809,"I":-1032,"K":-3450,"M":3565,"N":3876,"O":6646};
this.UC5__ = {"H":313,"I":-1238,"K":-799,"M":539,"O":-831};
this.UC6__ = {"H":-506,"I":-253,"K":87,"M":247,"O":-387};
this.UP1__ = {"O":-214};
this.UP2__ = {"B":69,"O":935};
this.UP3__ = {"B":189};
this.UQ1__ = {"BH":21,"BI":-12,"BK":-99,"BN":142,"BO":-56,"OH":-95,"OI":477,"OK":410,"OO":-2422};
this.UQ2__ = {"BH":216,"BI":113,"OK":1759};
this.UQ3__ = {"BA":-479,"BH":42,"BI":1913,"BK":-7198,"BM":3160,"BN":6427,"BO":14761,"OI":-827,"ON":-3212};
this.UW1__ = {",":156,"、":156,"「":-463,"あ":-941,"う":-127,"が":-553,"き":121,"こ":505,"で":-201,"と":-547,"ど":-123,"に":-789,"の":-185,"は":-847,"も":-466,"や":-470,"よ":182,"ら":-292,"り":208,"れ":169,"を":-446,"ん":-137,"・":-135,"主":-402,"京":-268,"区":-912,"午":871,"国":-460,"大":561,"委":729,"市":-411,"日":-141,"理":361,"生":-408,"県":-386,"都":-718,"「":-463,"・":-135};
this.UW2__ = {",":-829,"、":-829,"":892,"「":-645,"」":3145,"あ":-538,"い":505,"う":134,"お":-502,"か":1454,"が":-856,"く":-412,"こ":1141,"さ":878,"ざ":540,"し":1529,"す":-675,"せ":300,"そ":-1011,"た":188,"だ":1837,"つ":-949,"て":-291,"で":-268,"と":-981,"ど":1273,"な":1063,"に":-1764,"の":130,"は":-409,"ひ":-1273,"べ":1261,"ま":600,"も":-1263,"や":-402,"よ":1639,"り":-579,"る":-694,"れ":571,"を":-2516,"ん":2095,"ア":-587,"カ":306,"キ":568,"ッ":831,"三":-758,"不":-2150,"世":-302,"中":-968,"主":-861,"事":492,"人":-123,"会":978,"保":362,"入":548,"初":-3025,"副":-1566,"北":-3414,"区":-422,"大":-1769,"天":-865,"太":-483,"子":-1519,"学":760,"実":1023,"小":-2009,"市":-813,"年":-1060,"強":1067,"手":-1519,"揺":-1033,"政":1522,"文":-1355,"新":-1682,"日":-1815,"明":-1462,"最":-630,"朝":-1843,"本":-1650,"東":-931,"果":-665,"次":-2378,"民":-180,"気":-1740,"理":752,"発":529,"目":-1584,"相":-242,"県":-1165,"立":-763,"第":810,"米":509,"自":-1353,"行":838,"西":-744,"見":-3874,"調":1010,"議":1198,"込":3041,"開":1758,"間":-1257,"「":-645,"」":3145,"ッ":831,"ア":-587,"カ":306,"キ":568};
this.UW3__ = {",":4889,"1":-800,"":-1723,"、":4889,"々":-2311,"":5827,"」":2670,"〓":-3573,"あ":-2696,"い":1006,"う":2342,"え":1983,"お":-4864,"か":-1163,"が":3271,"く":1004,"け":388,"げ":401,"こ":-3552,"ご":-3116,"さ":-1058,"し":-395,"す":584,"せ":3685,"そ":-5228,"た":842,"ち":-521,"っ":-1444,"つ":-1081,"て":6167,"で":2318,"と":1691,"ど":-899,"な":-2788,"に":2745,"の":4056,"は":4555,"ひ":-2171,"ふ":-1798,"へ":1199,"ほ":-5516,"ま":-4384,"み":-120,"め":1205,"も":2323,"や":-788,"よ":-202,"ら":727,"り":649,"る":5905,"れ":2773,"わ":-1207,"を":6620,"ん":-518,"ア":551,"グ":1319,"ス":874,"ッ":-1350,"ト":521,"ム":1109,"ル":1591,"ロ":2201,"ン":278,"・":-3794,"一":-1619,"下":-1759,"世":-2087,"両":3815,"中":653,"主":-758,"予":-1193,"二":974,"人":2742,"今":792,"他":1889,"以":-1368,"低":811,"何":4265,"作":-361,"保":-2439,"元":4858,"党":3593,"全":1574,"公":-3030,"六":755,"共":-1880,"円":5807,"再":3095,"分":457,"初":2475,"別":1129,"前":2286,"副":4437,"力":365,"動":-949,"務":-1872,"化":1327,"北":-1038,"区":4646,"千":-2309,"午":-783,"協":-1006,"口":483,"右":1233,"各":3588,"合":-241,"同":3906,"和":-837,"員":4513,"国":642,"型":1389,"場":1219,"外":-241,"妻":2016,"学":-1356,"安":-423,"実":-1008,"家":1078,"小":-513,"少":-3102,"州":1155,"市":3197,"平":-1804,"年":2416,"広":-1030,"府":1605,"度":1452,"建":-2352,"当":-3885,"得":1905,"思":-1291,"性":1822,"戸":-488,"指":-3973,"政":-2013,"教":-1479,"数":3222,"文":-1489,"新":1764,"日":2099,"旧":5792,"昨":-661,"時":-1248,"曜":-951,"最":-937,"月":4125,"期":360,"李":3094,"村":364,"東":-805,"核":5156,"森":2438,"業":484,"氏":2613,"民":-1694,"決":-1073,"法":1868,"海":-495,"無":979,"物":461,"特":-3850,"生":-273,"用":914,"町":1215,"的":7313,"直":-1835,"省":792,"県":6293,"知":-1528,"私":4231,"税":401,"立":-960,"第":1201,"米":7767,"系":3066,"約":3663,"級":1384,"統":-4229,"総":1163,"線":1255,"者":6457,"能":725,"自":-2869,"英":785,"見":1044,"調":-562,"財":-733,"費":1777,"車":1835,"軍":1375,"込":-1504,"通":-1136,"選":-681,"郎":1026,"郡":4404,"部":1200,"金":2163,"長":421,"開":-1432,"間":1302,"関":-1282,"雨":2009,"電":-1045,"非":2066,"駅":1620,"":-800,"」":2670,"・":-3794,"ッ":-1350,"ア":551,"グ":1319,"ス":874,"ト":521,"ム":1109,"ル":1591,"ロ":2201,"ン":278};
this.UW4__ = {",":3930,".":3508,"―":-4841,"、":3930,"。":3508,"":4999,"「":1895,"」":3798,"〓":-5156,"あ":4752,"い":-3435,"う":-640,"え":-2514,"お":2405,"か":530,"が":6006,"き":-4482,"ぎ":-3821,"く":-3788,"け":-4376,"げ":-4734,"こ":2255,"ご":1979,"さ":2864,"し":-843,"じ":-2506,"す":-731,"ず":1251,"せ":181,"そ":4091,"た":5034,"だ":5408,"ち":-3654,"っ":-5882,"つ":-1659,"て":3994,"で":7410,"と":4547,"な":5433,"に":6499,"ぬ":1853,"ね":1413,"の":7396,"は":8578,"ば":1940,"ひ":4249,"び":-4134,"ふ":1345,"へ":6665,"べ":-744,"ほ":1464,"ま":1051,"み":-2082,"む":-882,"め":-5046,"も":4169,"ゃ":-2666,"や":2795,"ょ":-1544,"よ":3351,"ら":-2922,"り":-9726,"る":-14896,"れ":-2613,"ろ":-4570,"わ":-1783,"を":13150,"ん":-2352,"カ":2145,"コ":1789,"セ":1287,"ッ":-724,"ト":-403,"メ":-1635,"ラ":-881,"リ":-541,"ル":-856,"ン":-3637,"・":-4371,"ー":-11870,"一":-2069,"中":2210,"予":782,"事":-190,"井":-1768,"人":1036,"以":544,"会":950,"体":-1286,"作":530,"側":4292,"先":601,"党":-2006,"共":-1212,"内":584,"円":788,"初":1347,"前":1623,"副":3879,"力":-302,"動":-740,"務":-2715,"化":776,"区":4517,"協":1013,"参":1555,"合":-1834,"和":-681,"員":-910,"器":-851,"回":1500,"国":-619,"園":-1200,"地":866,"場":-1410,"塁":-2094,"士":-1413,"多":1067,"大":571,"子":-4802,"学":-1397,"定":-1057,"寺":-809,"小":1910,"屋":-1328,"山":-1500,"島":-2056,"川":-2667,"市":2771,"年":374,"庁":-4556,"後":456,"性":553,"感":916,"所":-1566,"支":856,"改":787,"政":2182,"教":704,"文":522,"方":-856,"日":1798,"時":1829,"最":845,"月":-9066,"木":-485,"来":-442,"校":-360,"業":-1043,"氏":5388,"民":-2716,"気":-910,"沢":-939,"済":-543,"物":-735,"率":672,"球":-1267,"生":-1286,"産":-1101,"田":-2900,"町":1826,"的":2586,"目":922,"省":-3485,"県":2997,"空":-867,"立":-2112,"第":788,"米":2937,"系":786,"約":2171,"経":1146,"統":-1169,"総":940,"線":-994,"署":749,"者":2145,"能":-730,"般":-852,"行":-792,"規":792,"警":-1184,"議":-244,"谷":-1000,"賞":730,"車":-1481,"軍":1158,"輪":-1433,"込":-3370,"近":929,"道":-1291,"選":2596,"郎":-4866,"都":1192,"野":-1100,"銀":-2213,"長":357,"間":-2344,"院":-2297,"際":-2604,"電":-878,"領":-1659,"題":-792,"館":-1984,"首":1749,"高":2120,"「":1895,"」":3798,"・":-4371,"ッ":-724,"ー":-11870,"カ":2145,"コ":1789,"セ":1287,"ト":-403,"メ":-1635,"ラ":-881,"リ":-541,"ル":-856,"ン":-3637};
this.UW5__ = {",":465,".":-299,"1":-514,"E2":-32768,"]":-2762,"、":465,"。":-299,"「":363,"あ":1655,"い":331,"う":-503,"え":1199,"お":527,"か":647,"が":-421,"き":1624,"ぎ":1971,"く":312,"げ":-983,"さ":-1537,"し":-1371,"す":-852,"だ":-1186,"ち":1093,"っ":52,"つ":921,"て":-18,"で":-850,"と":-127,"ど":1682,"な":-787,"に":-1224,"の":-635,"は":-578,"べ":1001,"み":502,"め":865,"ゃ":3350,"ょ":854,"り":-208,"る":429,"れ":504,"わ":419,"を":-1264,"ん":327,"イ":241,"ル":451,"ン":-343,"中":-871,"京":722,"会":-1153,"党":-654,"務":3519,"区":-901,"告":848,"員":2104,"大":-1296,"学":-548,"定":1785,"嵐":-1304,"市":-2991,"席":921,"年":1763,"思":872,"所":-814,"挙":1618,"新":-1682,"日":218,"月":-4353,"査":932,"格":1356,"機":-1508,"氏":-1347,"田":240,"町":-3912,"的":-3149,"相":1319,"省":-1052,"県":-4003,"研":-997,"社":-278,"空":-813,"統":1955,"者":-2233,"表":663,"語":-1073,"議":1219,"選":-1018,"郎":-368,"長":786,"間":1191,"題":2368,"館":-689,"":-514,"E2":-32768,"「":363,"イ":241,"ル":451,"ン":-343};
this.UW6__ = {",":227,".":808,"1":-270,"E1":306,"、":227,"。":808,"あ":-307,"う":189,"か":241,"が":-73,"く":-121,"こ":-200,"じ":1782,"す":383,"た":-428,"っ":573,"て":-1014,"で":101,"と":-105,"な":-253,"に":-149,"の":-417,"は":-236,"も":-206,"り":187,"る":-135,"を":195,"ル":-673,"ン":-496,"一":-277,"中":201,"件":-800,"会":624,"前":302,"区":1792,"員":-1212,"委":798,"学":-960,"市":887,"広":-695,"後":535,"業":-697,"相":753,"社":-507,"福":974,"空":-822,"者":1811,"連":463,"郎":1082,"":-270,"E1":306,"ル":-673,"ン":-496};
return this;
}
TinySegmenter.prototype.ctype_ = function(str) {
for (var i in this.chartype_) {
if (str.match(this.chartype_[i][0])) {
return this.chartype_[i][1];
}
}
return "O";
}
TinySegmenter.prototype.ts_ = function(v) {
if (v) { return v; }
return 0;
}
TinySegmenter.prototype.segment = function(input) {
if (input == null || input == undefined || input == "") {
return [];
}
var result = [];
var seg = ["B3","B2","B1"];
var ctype = ["O","O","O"];
var o = input.split("");
for (i = 0; i < o.length; ++i) {
seg.push(o[i]);
ctype.push(this.ctype_(o[i]))
}
seg.push("E1");
seg.push("E2");
seg.push("E3");
ctype.push("O");
ctype.push("O");
ctype.push("O");
var word = seg[3];
var p1 = "U";
var p2 = "U";
var p3 = "U";
for (var i = 4; i < seg.length - 3; ++i) {
var score = this.BIAS__;
var w1 = seg[i-3];
var w2 = seg[i-2];
var w3 = seg[i-1];
var w4 = seg[i];
var w5 = seg[i+1];
var w6 = seg[i+2];
var c1 = ctype[i-3];
var c2 = ctype[i-2];
var c3 = ctype[i-1];
var c4 = ctype[i];
var c5 = ctype[i+1];
var c6 = ctype[i+2];
score += this.ts_(this.UP1__[p1]);
score += this.ts_(this.UP2__[p2]);
score += this.ts_(this.UP3__[p3]);
score += this.ts_(this.BP1__[p1 + p2]);
score += this.ts_(this.BP2__[p2 + p3]);
score += this.ts_(this.UW1__[w1]);
score += this.ts_(this.UW2__[w2]);
score += this.ts_(this.UW3__[w3]);
score += this.ts_(this.UW4__[w4]);
score += this.ts_(this.UW5__[w5]);
score += this.ts_(this.UW6__[w6]);
score += this.ts_(this.BW1__[w2 + w3]);
score += this.ts_(this.BW2__[w3 + w4]);
score += this.ts_(this.BW3__[w4 + w5]);
score += this.ts_(this.TW1__[w1 + w2 + w3]);
score += this.ts_(this.TW2__[w2 + w3 + w4]);
score += this.ts_(this.TW3__[w3 + w4 + w5]);
score += this.ts_(this.TW4__[w4 + w5 + w6]);
score += this.ts_(this.UC1__[c1]);
score += this.ts_(this.UC2__[c2]);
score += this.ts_(this.UC3__[c3]);
score += this.ts_(this.UC4__[c4]);
score += this.ts_(this.UC5__[c5]);
score += this.ts_(this.UC6__[c6]);
score += this.ts_(this.BC1__[c2 + c3]);
score += this.ts_(this.BC2__[c3 + c4]);
score += this.ts_(this.BC3__[c4 + c5]);
score += this.ts_(this.TC1__[c1 + c2 + c3]);
score += this.ts_(this.TC2__[c2 + c3 + c4]);
score += this.ts_(this.TC3__[c3 + c4 + c5]);
score += this.ts_(this.TC4__[c4 + c5 + c6]);
// score += this.ts_(this.TC5__[c4 + c5 + c6]);
score += this.ts_(this.UQ1__[p1 + c1]);
score += this.ts_(this.UQ2__[p2 + c2]);
score += this.ts_(this.UQ3__[p3 + c3]);
score += this.ts_(this.BQ1__[p2 + c2 + c3]);
score += this.ts_(this.BQ2__[p2 + c3 + c4]);
score += this.ts_(this.BQ3__[p3 + c2 + c3]);
score += this.ts_(this.BQ4__[p3 + c3 + c4]);
score += this.ts_(this.TQ1__[p2 + c1 + c2 + c3]);
score += this.ts_(this.TQ2__[p2 + c2 + c3 + c4]);
score += this.ts_(this.TQ3__[p3 + c1 + c2 + c3]);
score += this.ts_(this.TQ4__[p3 + c2 + c3 + c4]);
var p = "O";
if (score > 0) {
result.push(word);
word = "";
p = "B";
}
p1 = p2;
p2 = p3;
p3 = p;
word += seg[i];
}
result.push(word);
return result;
}
lunr.TinySegmenter = TinySegmenter;
};
}));
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More