Commit Graph

862 Commits

Author SHA1 Message Date
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