An open API service indexing awesome lists of open source software.

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.

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.

![POST Request](https://github.com/jdockerty/EasyOpenVPNSetup/blob/master/Images/POST%20request.png)