1
0
Fork 0
server-configuration/README.md
2025-02-22 06:01:14 -06:00

1 KiB

VPN server configuration

This is an experimental configuration for my Hetzner VPS and Cloudflare to run a VPN using OpenTofu and Nix, based on NixOS/nixos-wiki-infra on Github.

How to use

Copy .env.example to .env and fill in the values.

To generate a token with Hetzner, go to the project and click Security -> API Tokens.

For cross-compiling, you will need to add a builder by visiting the following resources:

Run nix develop at the root of the project directory to access a shell where OpenTofu is accessible.

In the targets directory, run ./apply.sh to update the configurations.

VPN

To set up the VPN, on the VPS run:

headscale users create default
headscale preauthkeys create --user default --reusable

On the client run:

tailscale up --login-server <HEADSCALE_URL> --auth-key <KEY>