GoodiesHQ/headscale-admin

[FR] Store apikey in app

Ziomal12 opened this issue · 1 comments

Hello,

I'd love to have this web ui remember apikey for headscale or have ability to configure it in docker compose file.
Right now when logging in to admin page from new device I'm prompted to enter said apikey.

Hi @Ziomal12

For better or worse, this is essentially by design. The essence of headscale-admin is to be a static application. A collection of HTML, JSS, and CSS files that can be hosted or served anywhere, on any filesystem, using any program, on any server. This makes it highly versatile in its deployment, but severely limited in its backend interaction. I decided to sacrifice one for the other.

The static files, by definition, have no execution state in which they can interact with the environment via variables or config files or anything at all. It would be up to the server implementation to gather those value and embed them in the HTML file as it is sent out. This varies wildly by implementation.

I think a better solution is to offer an optional external service. I think I'll call it headscale-admin-extras. That will include interaction with the ACL management, SSO-based authentication to generate an API key, execution of headscale commands, and possibly persistent storage for settings and such. For right now, I'm focusing on stability and the creation of an ACL configuration generation page. But this is on my to-do list.