Skip to content

Commit

Permalink
feat: Info about user data
Browse files Browse the repository at this point in the history
Added small guide with info about running pivpn unattended as user data
during cloud instance boot
  • Loading branch information
coolapso committed Nov 25, 2021
1 parent 2a8ee92 commit ed83004
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
54 changes: 54 additions & 0 deletions docs/guides/user-data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
title: Cloud instance user data
summary: How to run the script on cloud instance user data
Authors: 4s3ti

# Cloud instance user data

PiVPN can be used to install OpenVPN or Wireguard completely unattended during a cloud instance boot (example AWS)

!!! Note
This info is focused at more advanced users that wish to have their own VPN in the cloud or spin up VPN servers on demand with PiVPN.

* You should be comfortable reading bash and understanding what the provided scripts below are doing.
* You should know what a cloud instance is
* You should know what user data is



Configuration file examples can be found here [here](https://github.com/pivpn/pivpn/tree/master/examples)

You can use the following script as an example and adjust the values to suit your needs

```
#!/bin/bash
# Create options file
cat << EOF > /tmp/options.conf
USING_UFW=0
IPv4dev=ens5
install_user=admin
install_home=/home/admin
VPN=openvpn
pivpnPROTO=udp
pivpnPORT=1194
pivpnDNS1=8.8.8.8
pivpnDNS2=8.8.4.4
TWO_POINT_FOUR=1
pivpnENCRYPT=256
USE_PREDEFINED_DH_PARAM=1
INPUT_CHAIN_EDITED=0
FORWARD_CHAIN_EDITED=0
pivpnDEV=tun0
pivpnNET=10.8.0.0
subnetClass=24
UNATTUPG=1
EOF
# Install git and clone pivpn repo
apt update && apt install -y git
git clone https://github.com/pivpn/pivpn /tmp/pivpn
# Install PiVPN from options.conf
cd /tmp/ || exit
bash pivpn/auto_install/install.sh --unattended /tmp/options.conf
```
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ nav:
- projects.md
- Guides:
- Dynamic DNS: guides/dynamic-dns.md
- User Data: guides/user-data.md

extra:
social:
Expand Down

0 comments on commit ed83004

Please sign in to comment.