juanfont / headscale

An open source, self-hosted implementation of the Tailscale control server
BSD 3-Clause "New" or "Revised" License
22.4k stars 1.24k forks source link

Quickstart script #1275

Closed prom3theu5 closed 1 year ago

prom3theu5 commented 1 year ago

Headscale Quickstart script

Would it be beneficial to include quick start docker scripting that setups up a base instance of headscale, containerised along with headscale-ui, and expose them through Caddy?

I have one I use here: https://github.com/SimCubeLtd/headscale-quickstart, which when running will allow you to be setup in about 2 mins

It's interactive similar to the Netmaker quick-start, only it deploys 3 containers: Headscale, Headscale-ui and Caddy, and I massively prefer this project over netmaker.

Base config is UI and Headscale running on http, with them both exposed through Caddy which will setup TLS with a requested cert at startup (based on either the custom email address you add during the script execution that it will ask you for, or the random email address it automatically generates during install - This SSL cert comes from ZeroSSL, but it could come from lets encrypt too)

sudo wget -qO ./headscale-quickstart.sh https://raw.githubusercontent.com/SimCubeLtd/headscale-quickstart/main/headscale-quickstart.sh && sudo chmod +x ./headscale-quickstart.sh && sudo ./headscale-quickstart.sh

After running, you'd copy and past the create apikey command, and then paste that api key into the web dashboard settings page

kradalby commented 1 year ago

This is out of scope for this project, we do not support Docker or Reverse proxies (caddy).

prom3theu5 commented 1 year ago

Strange as you have a k3s example lol Not everyone wants to have a droplet running a k8s runtime

no drama :P

kradalby commented 1 year ago

Those examples are unsupported and community organised, but I agree, it was a week moment.

Happy for you to contribute your script to the unsupported section, but we often find that we end up supporting them, and we are therefore sceptical.

PizzaProgram commented 1 year ago

Get an API key:

After the script finished, an API key must be created to be able to log in from the UI.

So for this docker you need to run this line on the server to get one:

Additional infos:

PizzaProgram commented 1 year ago

Personal experience:

Recommendation for improvements:

  1. The script should ask for if not generating a random-domain.

  2. For me: the final "Headscale setup is now complete. ... " part did not show. (After showing "Testing Caddy setup (please be patient, this may take 1-2 minutes)" ... the script exited immediately) But it is working!

  3. Should call the docker exec headscale headscale apikeys create -e 9999d line itself to generate the necessary API key.

  4. Maybe the other UI would be better.

    • or both ? +1 docker would not hurt.