headscale-admin icon indicating copy to clipboard operation
headscale-admin copied to clipboard

Update Nginx Config to support /api/v1/node

Open soudaburger opened this issue 1 year ago • 5 comments

Currently, the latest version of headscale the /api/v1/machine endpoint is now /api/v1/node. As such, an additional modification to the nginx config needs to be made until the UI is fully caught up with upstream releases.

  location = /api/v1/machine {
    return 301 $scheme://$http_host/api/v1/node;
  }

soudaburger avatar Jun 15 '24 21:06 soudaburger

Good.

shaxiaozz avatar Jun 27 '24 07:06 shaxiaozz

@soudaburger: thanks for the tip!

Would be great to get a small update on headscale-admin that changes the call to the right endpoint though :-D

tacognito avatar Jul 10 '24 13:07 tacognito

Ahhhh my bad, I have legacy api enabled in settings appearently. Removing it, brought back all functionality and I also don't see machine call any more. Also not the 301's I saw after applying the nginx fix proposed by @soudaburger.

Keep on the great work!

tacognito avatar Jul 10 '24 17:07 tacognito

i quickly came up with something for caddy

@match path_regexp match ^/api/v1/machine(.*)
rewrite @match /api/v1/node{re.match.1}

a55uka avatar Jul 15 '24 15:07 a55uka

whoops, turns out that in the settings page you can disable legacy api, which uses the node endpoint instead of the machine endpoint (thanks to @tacognito for pointing that out) image

a55uka avatar Jul 15 '24 15:07 a55uka

Thank you @tacognito @ElonGaties , I was also confused. I feel like that setting should be on by default since new users (like myself) are more likely to use the latest version of headscale, since we're just starting out.

mobalt avatar Nov 02 '24 20:11 mobalt

Thank you, all! I am changing versioning such that the version of headscale-admin tag will equate to the version of headscale that it targets. e.g. the newest stable headscale version (which is 0.23) will be compatible with headscale version 0.23 as well.

GoodiesHQ avatar Jan 13 '25 04:01 GoodiesHQ