Skip to content

[FEATURE] Support for Headscale API Keys (hskey prefix) and Custom API Endpoints #1013

Description

@tgalex75

Title

Support for Headscale API Keys (hskey prefix) and Custom API Endpoints

Platform

Web-app

Is it related to an issue?

No.

Description

I am currently using Termix on a Debian host that is part of a Tailnet managed by Headscale (the open-source implementation of the Tailscale control server).

While the connectivity and Tailscale SSH work perfectly (since the host is connected to the network), the Device Discovery feature is currently unusable. When attempting to configure the Tailscale API key in the Admin Settings, the UI does not recognize the key and displays a message stating that no API key is configured.

The current implementation seems to assume a hardcoded dependency on the official Tailscale infrastructure. This creates two main blockers for self-hosted users:

  1. Fixed API Endpoint: The application likely points to api.tailscale.com by default, making it impossible to communicate with a private Headscale instance.
  2. Key Prefix Validation: Maybe the UI enforces a validation check that only accepts keys starting with tskey (official Tailscale)? Headscale API keys, which start with hskey, are rejected as invalid before any request is even sent.

The Solution

I suggest decoupling the Tailscale integration to allow for different control plane providers:

  1. Configurable API Endpoint: Add a field in the Admin Settings to define the API base URL. This would allow users to point Termix to their own Headscale instance (e.g., https://headscale.example.com).
  2. Flexible Key Validation: Update the API key validation logic to support different prefixes based on the provider (or simply allow both tskey and hskey). If a custom endpoint is provided, the system should accept the hskey format used by Headscale.

Additional Context

Use Case

This would allow users who prefer self-hosting their control plane to enjoy the full "Device Discovery" experience, enabling them to select hosts from their Tailnet via a dropdown menu rather than manually entering the 100.x.y.z IP addresses for every device.

Environment

  • OS: Debian 12 (running in Docker)
  • Control Plane: Headscale (running in Docker)
  • Connectivity: Tailscale SSH enabled

Thank you for your great work on Termix!

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status
    Feature Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions