Idea: make register url configurable #28

Closed
opened 2025-12-29 01:20:24 +01:00 by adam · 4 comments
Owner

Originally created by @sim-san on GitHub (Sep 6, 2021).

I think about writing a small web fronted for headscale. Just to learn a bit about web development. In order to handle the registration of nodes in the web frontend, the AuthURL have to be configurable.

resp.AuthURL = fmt.Sprintf("%s/register?key=%s",
	h.cfg.ServerURL, mKey.HexString())

https://github.com/juanfont/headscale/blob/main/api.go#L138
https://github.com/juanfont/headscale/blob/main/api.go#L204

@juanfont What is your idea ?

Originally created by @sim-san on GitHub (Sep 6, 2021). I think about writing a small web fronted for headscale. Just to learn a bit about web development. In order to handle the registration of nodes in the web frontend, the `AuthURL ` have to be configurable. ``` resp.AuthURL = fmt.Sprintf("%s/register?key=%s", h.cfg.ServerURL, mKey.HexString()) ``` https://github.com/juanfont/headscale/blob/main/api.go#L138 https://github.com/juanfont/headscale/blob/main/api.go#L204 @juanfont What is your idea ?
adam closed this issue 2025-12-29 01:20:24 +01:00
Author
Owner

@juanfont commented on GitHub (Sep 13, 2021):

Hey @sim-san,

Sounds good to me. Although I reckon at some point you will need some kind of internal API provided by headscale.

@kradalby any thoughts on this?

@juanfont commented on GitHub (Sep 13, 2021): Hey @sim-san, Sounds good to me. Although I reckon at some point you will need some kind of internal API provided by headscale. @kradalby any thoughts on this?
Author
Owner

@kradalby commented on GitHub (Sep 14, 2021):

A webui would be neat, however I think we would benefit from a bit of a refactoring before that work is started.

We currently have a CLI tool that talks directly to the database and sometimes communicates by having the serve mode watching database tables. What we probably should to, to make it easier to use the CLI tool on another computer, and to avoid update and state issues in the database because the CLI changed something the server has loaded.

Doing that work, which is making an API that the CLI uses, forcing us to implement an API for all of the CLI, we should have a suitable API for a webui.

I think that we should bite the learning curve and use protobuf and gRPC to design and generate the client/server code for the CLI, and then use something like https://github.com/grpc-ecosystem/grpc-gateway to make a JSON API out of it.

This way we should also be able to generate a lot of the code for a webui for interacting with the API.

This is quite an undertaking, and I was hoping to start playing around with it at some point.

Feedback on the approach is welcome.

@kradalby commented on GitHub (Sep 14, 2021): A webui would be neat, however I think we would benefit from a bit of a refactoring before that work is started. We currently have a CLI tool that talks directly to the database and sometimes communicates by having the `serve` mode watching database tables. What we probably should to, to make it easier to use the CLI tool on another computer, and to avoid update and state issues in the database because the CLI changed something the server has loaded. Doing that work, which is making an API that the CLI uses, forcing us to implement an API for all of the CLI, we should have a suitable API for a webui. I think that we should bite the learning curve and use protobuf and gRPC to design and generate the client/server code for the CLI, and then use something like https://github.com/grpc-ecosystem/grpc-gateway to make a JSON API out of it. This way we should also be able to generate a lot of the code for a webui for interacting with the API. This is quite an undertaking, and I was hoping to start playing around with it at some point. Feedback on the approach is welcome.
Author
Owner

@sim-san commented on GitHub (Sep 20, 2021):

Due to personal circumstances I will not be able to work on it in the future

@sim-san commented on GitHub (Sep 20, 2021): Due to personal circumstances I will not be able to work on it in the future
Author
Owner

@juanfont commented on GitHub (Sep 20, 2021):

@sim-san sorry to hear that. Will close the issue now.

@juanfont commented on GitHub (Sep 20, 2021): @sim-san sorry to hear that. Will close the issue now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#28