No description
Find a file
2019-04-25 13:59:40 +02:00
assets Replace deprecated ns-cert-type option 2019-04-25 13:59:40 +02:00
handlers Make fully configurable for other networks 2018-04-22 20:34:51 +02:00
middleware Simplify: use OAuth2 2018-02-01 09:31:06 +01:00
models Refactor code, delete old references 2018-02-03 18:26:54 +01:00
router Refactor code, delete old references 2018-02-03 18:26:54 +01:00
services Refactor code, delete old references 2018-02-03 18:26:54 +01:00
settings Move database and sessions to services 2018-01-26 14:49:03 +01:00
views Simplify: use OAuth2 2018-02-01 09:31:06 +01:00
.gitignore Refactor code, delete old references 2018-02-03 18:26:54 +01:00
.gitlab-ci.yml Use dev tag for vetting 2018-04-22 20:47:23 +02:00
docker-compose.yml.example Make fully configurable for other networks 2018-04-22 20:34:51 +02:00
Dockerfile Bump go version 2019-04-24 23:31:55 +02:00
main.go Add APP_LISTEN 2018-02-03 19:38:28 +01:00
README.md Increase security of config 2019-04-24 23:22:57 +02:00
usage.md Add usage manual 2018-03-09 11:59:31 +01:00

Certman

Certman is a simple certificate manager web service for OpenVPN.

**For usage tips, please consult usage.md

Installation

Binary

There are prebuilt binary files for this application. They are statically linked and have no additional dependencies. Supported plattforms are:

  • Windows (XP and up)
  • Linux (2.6.16 and up)
  • Linux ARM (for raspberry pi, 3.0 and up) Simply download them from the "artifacts" section of this project.

Docker

A prebuilt docker image (10MB) is available:

docker pull zombi/certman

From Source-Docker

You can easily build your own docker image from source

docker build -t zombi/certman .

Configuration

Certman assumes the root certificates of the VPN CA are located in the same directory as the binary, If that is not the case you need to copy over the ca.crt and ca.key files before you are able to generate certificates with this tool.

Additionally, the project is configured by the following environment variables:

  • OAUTH2_CLIENT_ID the Client ID, assigned during client registration
  • OAUTH2_CLIENT_SECRET the Client secret, assigned during client registration
  • OAUTH2_AUTH_URL the URL to the "/authorize" endpoint of the identity provider
  • OAUTH2_TOKEN_URL the URL to the "/token" endpoint of the identity provider
  • OAUTH2_REDIRECT_URL the redirect URL used by the app, usually the hostname suffixed by "/login/oauth2/redirect"
  • USER_ENDPOINT the URL to the Identity provider user endpoint, for gitlab this is "/api/v4/user". The "username" attribute of the returned JSON will used for authentication.
  • APP_KEY random ASCII string, 32 characters in length. Used for cookie generation.
  • APP_LISTEN port and ip to listen on, e.g. :8000 or 127.0.0.1:3000
  • VPN_DEV which device is used by the network, either tun or tap (check server cfg)
  • VPN_HOST Hostname or IP address of the server
  • VPN_PORT Port of the VPN server
  • VPN_PROTO Protocol of the VPN server, either tcp or udp

There are some files that need to be mounted inside the container:

  • /ca.crt the certificate of the server PKI
  • /ca.key the key of the server PKI, unencrypted
  • /ta.key shared HMAC secret of server and client
  • /clients.json the generated certificates for each client

There is an docker-compose.yml example you can use as a base for your own docker-compose service.