headscale-ui/documentation/route_queries.md
Austin Drummond 1f73a7bf8a
Add a new device registration route (#121)
* added a new device registration form

* removed unused variables

* remove old register html

* bind new device key from url

* remove redirect

* clear nodekey query string param after successuful addition

* expand bool flipping

* added documention on nodekey

* remove null check

* tweak wording
2023-11-18 09:34:36 +11:00

830 B

Route Queries

Some routes offer additional behavior to a route when a ? exists in the URL. These are called query string parameters or route queries. Route queries are used to modify the behavior of a route. Below are the available route queries.

Devices

/devices.html

Parameters

?nodekey={nodekey of a pending device}

When this parameter exists, it will automatically open the New Device form and pre-fill the Device Key input automatically. Everything right of the = is used as the value of the input.

Below is an example of how to set up a redirect in NGINX from the default headscale /register/{nodekey} URL to utilize this parameter:

    ...

    location /register/nodekey {
        rewrite ^/register/(.*)$ /web/devices.html?nodekey=$1 redirect;
    }

    location /web {

    ...