https://github.com/jdockerty/easy-openvpn-setup
Proof of concept implementation for adding clients to an OpenVPN server in AWS through a HTTP API written in Go.
https://github.com/jdockerty/easy-openvpn-setup
openvpn openvpn-configuration terraform-aws
Last synced: about 1 year ago
JSON representation
Proof of concept implementation for adding clients to an OpenVPN server in AWS through a HTTP API written in Go.
- Host: GitHub
- URL: https://github.com/jdockerty/easy-openvpn-setup
- Owner: jdockerty
- Created: 2020-03-14T14:11:49.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-30T16:31:51.000Z (about 6 years ago)
- Last Synced: 2025-01-23T13:29:39.971Z (over 1 year ago)
- Topics: openvpn, openvpn-configuration, terraform-aws
- Language: Go
- Homepage:
- Size: 70.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# EasyOpenVPNSetup
**This is a proof of concept implementation, a secure version would require a HTTPS endpoint rather than HTTP. The setup is fully functioning, but this is something to keep in mind.**
## Overview
This project was inspired after considering how I could somewhat automate the [AWS OpenVPN repo](https://github.com/jdockerty/OpenVPNAWS), using Go and adding a HTTP API onto a server for creating clients was the idea that I came to. This means that you can send a new client name as JSON, such as `{ "Name" : "Jack" }` *(these names must be unique on the deployed server)* via `/api/addclient` and it adds a new client to the VPN server, responding with the relevant `.ovpn` configuration to paste into a file and load into the OpenVPN UI client.
## Terraform
[Terraform](https://www.terraform.io/downloads.html) is used to provision the instance and an elastic IP which is associated to it, this means that the address of the instance remains static.
The command `terraform init` is required to enable the usage of the files once it is installed.
Once Terraform is installed and configured, using `terraform apply` from within the folder will provision the appropriate resources and complete the initial OpenVPN configuration steps.
*Note: The full configuration of the server can take a couple of minutes to install everything that is required.*
## HTTP API Response
Sending a POST request to the server containing the appropriate JSON format will cause it to respond with the relevant output required to paste into an `.ovpn` file and load into the OpenVPN UI client. This is demonstrated using Postman below.
