107 Commits

Author SHA1 Message Date
itbencn
d193ade192 fix add_machine reload bug 2023-05-02 13:25:46 +08:00
iFargle
2033f80258 Reverting to 0.6.1 2023-05-02 12:25:07 +09:00
Marek Pikuła
fe7a3667d4 Complete the major refactor
Major part of #73

Unfortunately, it wasn't possible to split it to multiple smaller
commits, since the changes touched the entire application substantially.
Here is a short list of major changes:

1. Create a separate library (headscale-api), which is used as a
   convenient abstraction layer providing Pythonic interface with
   Pydantic. Headscale API is fully asynchronous library, benefitting
   from improved concurrency for backend requests thus increasing page
   load speed, e.g., on "Machines" page.
2. Create a common common, validated with flask-pydantic API passthrough
   layer from GUI to the backend.
3. Move authentication to a separate (auth.py), consolidating the
   functionality in a single place (with better place for expansion in
   the future).
4. Move configuration management to a separate module (config.py). Use
   Pydantic's BaseSettings for reading values from environment, with
   extensive validation and error reporting.
5. Reduce the number of health checks.
    - Now, most are performed during server initialization. If any test
      fails, the server is started in tainted mode, with only the error
      page exposed (thus reducing the surface of attack in invalid
      state).
    - Key checks are implicit in the requests to the backend and
      guarded by `@headscale.key_check_guard` decorator.
    - Key renewal is moved to server-side scheduler.
6. Introduce type hints to the level satisfactory for mypy static
   analysis. Also, enable some other linters in CI and add optional
   pre-commit hooks.
7. Properly handle some error states. Instead of returning success and
   handling different responses, if something fails, there is HTTP error
   code and standard response for it.
8. General formatting, small rewrites for clarity and more idiomatic
   Python constructs.

Signed-off-by: Marek Pikuła <marek.pikula@embevity.com>
2023-04-21 06:02:29 +00:00
itbencn
2fdbbf5519 fix add_machine bug & foramt 2023-04-21 01:28:56 +08:00
iFargle
56d8ed25ad test 2023-03-30 13:20:18 +09:00
iFargle
77c50dd130 test 2023-03-30 13:16:31 +09:00
iFargle
106c855d2a test 2023-03-30 13:13:26 +09:00
iFargle
a87419cbff test 2023-03-30 13:01:59 +09:00
iFargle
3978c86c92 test 2023-03-30 12:57:35 +09:00
iFargle
68b177a379 lol 2023-03-30 12:49:06 +09:00
iFargle
316183cb1f test 2023-03-30 12:40:37 +09:00
iFargle
d07c19902d test 2023-03-30 12:33:37 +09:00
iFargle
f7b3bdd824 test 2023-03-30 12:29:07 +09:00
iFargle
72b0c61b7d test 2023-03-30 12:20:04 +09:00
iFargle
95ea7e40b2 test 2023-03-30 12:16:25 +09:00
iFargle
1f6419b68f test 2023-03-30 12:03:55 +09:00
iFargle
6494907d11 test 2023-03-30 11:58:43 +09:00
iFargle
38b0cae577 test 2023-03-30 11:53:58 +09:00
iFargle
58d9c30ce7 test 2023-03-30 11:38:53 +09:00
iFargle
6dac7ad7a6 test 2023-03-30 11:26:10 +09:00
iFargle
5836a010d5 tset 2023-03-30 11:18:12 +09:00
iFargle
e1c46dec5f this worked earlier... 2023-03-30 11:09:04 +09:00
iFargle
393ab524e7 test 2023-03-30 11:03:47 +09:00
iFargle
09b92ed715 test 2023-03-30 10:58:28 +09:00
iFargle
06b1324bfe test 2023-03-30 10:52:50 +09:00
iFargle
6c4577e1b0 add more logging 2023-03-30 10:48:41 +09:00
iFargle
be690c2e82 test 2023-03-30 10:38:40 +09:00
iFargle
62acf859b3 test 2023-03-30 10:16:24 +09:00
iFargle
53aae4e9a5 test 2023-03-30 10:01:49 +09:00
iFargle
342dca678d test 2023-03-30 10:00:20 +09:00
iFargle
812d30f576 test 2023-03-30 09:54:35 +09:00
iFargle
1032698870 test 2023-03-30 09:47:27 +09:00
iFargle
7f828de7c6 test 2023-03-29 21:02:57 +09:00
iFargle
e1bbe81caf test 2023-03-29 20:22:13 +09:00
iFargle
3459d8e251 test 2023-03-29 20:07:03 +09:00
iFargle
0f55d35087 test 2023-03-29 19:49:54 +09:00
iFargle
c481bd979f test 2023-03-29 18:15:13 +09:00
iFargle
b10799a5e6 test 2023-03-29 18:04:07 +09:00
iFargle
ffca3fd596 test 2023-03-29 17:58:52 +09:00
iFargle
c7555bd43e test 2023-03-29 16:29:54 +09:00
iFargle
0473290e95 test 2023-03-29 13:59:34 +09:00
iFargle
9b5d8473c9 test 2023-03-29 13:03:24 +09:00
iFargle
5ba004c0c5 test 2023-03-29 12:59:11 +09:00
iFargle
fc12e99e0a test 2023-03-29 12:49:08 +09:00
iFargle
db24505825 test 2023-03-29 12:42:55 +09:00
iFargle
e929adc6b7 test 2023-03-29 12:36:59 +09:00
iFargle
d4a0e72747 test 2023-03-25 15:47:11 +09:00
iFargle
5aa10e67df Test 2023-03-25 15:19:03 +09:00
iFargle
507f27ceaa test 2023-03-24 15:02:11 +09:00
iFargle
b17ac9dc94 Logic for exit nodes for routes page 2023-03-24 14:12:21 +09:00