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
2023-03-30 13:46:55 +09:00
2023-04-21 06:02:29 +00:00
2023-04-21 06:02:29 +00:00
2023-04-21 05:50:28 +00:00
2023-04-21 06:02:29 +00:00
2023-04-21 06:02:29 +00:00
2023-03-30 13:46:55 +09:00
2023-03-29 20:33:30 +09:00
2023-02-08 13:11:38 +09:00
2023-04-21 06:02:29 +00:00
2023-04-21 06:02:29 +00:00
2023-04-02 08:50:36 +09:00
2023-04-21 06:02:29 +00:00
2023-04-21 05:50:28 +00:00
2023-04-21 06:02:29 +00:00
2023-03-30 14:02:28 +09:00
2023-04-21 06:02:29 +00:00
2023-04-21 06:02:29 +00:00

Headscale-WebUI

A simple Headscale web UI for small-scale deployments.

Screenshots | Installation | Issues


Features

  1. Enable/Disable routes and exit nodes
    • Manage failover routes as well
  2. Add, move, rename, and remove machines
  3. Add and remove users/namespaces
  4. Add and expire PreAuth keys
  5. Add and remove machine tags
  6. View machine details
    • Hostname
    • User associated with the machine
    • IP addresses in the Tailnet
    • Last seen by the control server
    • Last update with the control server
    • Creation date
    • Expiration date (will also display a badge when nearing expiration)
    • PreAuth key associated with the machine
    • Enable / disable routes and exit nodes
    • Add and delete machine tags
  7. Basic and OIDC Authentication
    • OIDC Authentication tested with Authelia and Keycloak
  8. Change your color theme! See MaterializeCSS Documentation for Colors for examples.
  9. Search your machines and users.
    • Machines have tags you can use to filter search:
      • tag:tagname Searches only for specific tags
      • machine:machine-name Searches only for specific machines
      • user:user-name Searches only for specific users

Installation

  • See SETUP.md for installation and configuration instructions.

Screenshots:

Overview Routes Machines Users Settings


Tech used:

For Python libraries, see pyproject.toml

If you use this project, please reach out! It keeps me motivated! Thank you!

Description
Languages
Python 54.2%
JavaScript 27.6%
HTML 16.3%
Dockerfile 1%
CSS 0.9%