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

https://github.com/jdevelop/ezovpn

Easy .ovpn files import/generation tool
https://github.com/jdevelop/ezovpn

config-management go-application openvpn

Last synced: 3 months ago
JSON representation

Easy .ovpn files import/generation tool

Awesome Lists containing this project

README

          

# ezovpn - .ovpn files import/generation tool

The simple tool to import and generate OpenVPN configuration files with [**embedded certificates**](https://community.openvpn.net/openvpn/wiki/Openvpn23ManPage#lbAV), as this is the format
that you might want to use for an OpenVPN client on Android or iPhone.

OpenVPN allows to include CA/Certificate/Key/TlsAuth files into an OpenVPN configuration file.
For example:
```
client
dev tun
proto udp
remote 1.2.3.4 1141
nobind
persist-key
persist-tun
key-direction 1
comp-lzo

-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----

...

-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----

#
# 2048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----
...
-----END OpenVPN Static key V1-----

```
Substantially this is just replacement of the following configuration lines:
```
ca /etc/openvpn/ca.crt
cert /etc/openvpn/client.crt
key /etc/openvpn/client.key
tls-auth /etc/openvpn/ta.key 1
```
with the content of the corresponding files.

This application makes it easier either to generate the new basic OpenVPN configuration with all the necessary resources, or to import and convert the existing OpenVPN configuration.
```
Usage:
[flags]
[command]

Available Commands:
generate Generates the config file according to the built-in template
help Help about any command
import Imports an existing VPN configuration and embeds the certificates

Flags:
-d, --confdir string VPN root dir to look for certificates
-h, --help help for this command
-o, --out string .ovpn config file ( if not specified - then stdout will be used )

Use " [command] --help" for more information about a command.
```
### Generate

If you have the certificates and keys generated by [easy-rsa](https://github.com/OpenVPN/easy-rsa) and just want to generate a bare minimum OpenVPN configuration file:

```
ezovpn generate -h
Generates the config file according to the built-in template

Usage:
generate [flags]

Aliases:
generate, gen

Flags:
--ca string RSA CA file name (default "ca.crt")
--cert string RSA certificate file name
-h, --help help for generate
--key string RSA certificate key file name
-p, --port int VPN Port (default 1144)
-s, --server string VPN Server
--ta string VPN tls-auth key file name (default "ta.key")

Global Flags:
-d, --confdir string VPN root dir to look for certificates
-o, --out string .ovpn config file ( if not specified - then stdout will be used )
```

Example usage would be something like:
```
ezovpn -d /etc/openvpn gen --cert client.crt --key client.key -s 123.123.123.123
```

### Import

If you have a config file you want to embed the certificates into:
```
ezovpn import -h
Imports an existing VPN configuration and embeds the certificates

Usage:
import [flags]

Aliases:
import, imp

Flags:
-h, --help help for import
-i, --import string VPN configuration file ( if not specified - stdin will be used )

Global Flags:
-d, --confdir string VPN root dir to look for certificates
-o, --out string .ovpn config file ( if not specified - then stdout will be used )
```
and the example command line would be:
```
ezovpn -d /etc/openvpn import -i /etc/openvpn/client.conf
```