Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add headless support - 2th approach 2024-03 #500

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,39 @@ It will install WireGuard (kernel module and tools) on the server, configure it,

Run the script again to add or remove clients!

## Headless installation

It's also possible to run the script headless, e.g. without waiting for user input, in an automated way.

Example usage:

```bash
APPROVE_INSTALL=y ./wireguard-install.sh

# or

export APPROVE_INSTALL=y
./wireguard-install.sh
```

This will set a default set of variables, bypassing any user input.

If you want to customise your installation, you can use variables, as shown below:

```
export APPROVE_INSTALL=y
export SERVER_PUB_IP="54.14.1.48"
export SERVER_PORT=64567
export CLIENT_NAME=client
```

If the server is behind NAT, you can specify its endpoint with the `SERVER_PUB_IP` variable. If the endpoint is the public IP address which it is behind, you can use `SERVER_PUB_IP=$(curl -s https://api.ipify.org)` (the script defaults to this). The endpoint can be an IP or a domain.

The headless installation involves adding a new user. Adding `CLIENT_NAME=foo` will change the name of the new user to `foo` instead of the default.

Other variables can be set as required on your choice (`SERVER_NIC`). You can find them in the `installQuestions()` function of the script.


## Providers

I recommend these cheap cloud providers for your VPN server:
Expand Down
Loading
Loading