Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Build Status Go report Maintainability

OpenVPN Service Plug-in

OpenVPN service plug-in allows Agents and Clients to buy and sell their internet traffic in form of VPN service without 3rd party.

This service plug-in is a PoC service for Privatix core.

Custom integration includes

  • Start and stop of session by Privatix Core
  • OpenVPN client sessions authentication by Privatix Core
  • OpenVPN traffic usage reporting to Privatix core (is a must for automatic payments)
  • Push OpenVPN server configuration
  • Traffic shaping based on offering parameters (Ubuntu only)

Benefits from Privatix Core

  • Automatic billing
  • Automatic payment
  • Access control based on billing
  • Automatic credentials delivery
  • Automatic configuration delivery
  • Anytime increase of deposit
  • Privatix GUI for service control

Service plug-in components:

  • Templates (offering and access)
  • Service adapter (with access to OpenVPN and Privatix core)
  • OpenVPN software (with management interface)

Getting started

These instructions will help you to build and configure the OpenVPN service adapter.


  • Install OpenVPN 2.4+.

Building Executables

Switch to the dapp-openvpn repository root directory.

You can build all binaries using the go tool, placing the resulting binary in $GOPATH/bin:


Run installer

Installer is responsible for:

  1. import templates: offering, access (to Privatix core database)
  2. import product and link it to templates (to Privatix core database)
  3. generate adapter config with proper authentication (same as in Privatix core database database product table)

Install and register OpenVPN service plug-in in Privatix core using the following script:


Additional steps for OpenVPN server configuration

On the agent side it necessary to perform the following steps: additional steps

Running the agent service

  • Start the OpenVPN-server.
  • Start the adapter -config adapter.config.json in the background with the configuration provided by the installer.

Running the client service

  • Start the adapter -config adapter.config.json in the background with the configuration provided by the installer.

Install statik

go get

Generate statik filesystem:

go generate ./...

Command Line Options


Usage of dapp-openvpn-inst:
  -connstr string
        PostgreSQL connection string (default "user=postgres dbname=dappctrl sslmode=disable")
  -rootdir string
        Full path to root directory of service adapter
        Generate authentication credentials for service adapter

dapp-openvpn (adapter)

Usage of dapp-openvpn:
  -channel string
        Channel ID for client mode
  -config string
        Configuration file (default "adapter.config.json")
        Prints current dappctrl version


Run tests for all packages:

./scripts/ <path_to_the_test.conf>


Please read for details on our code of conduct, and the process for submitting pull requests to us.


We use SemVer for versioning. For the versions available, see the tags on this repository.


See also the list of contributors who participated in this project.


This project is licensed under the GPL-3.0 License - see the COPYING file for details.