Skip to content

Proof of concept implementation for adding clients to an OpenVPN server in AWS through a HTTP API written in Go.

Notifications You must be signed in to change notification settings

jdockerty/easy-openvpn-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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, 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 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

About

Proof of concept implementation for adding clients to an OpenVPN server in AWS through a HTTP API written in Go.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published