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.
Prerequisites
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
:
./scripts/build.sh
Run installer
Installer is responsible for:
- import templates: offering, access (to Privatix core database)
- import product and link it to templates (to Privatix core database)
- 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:
./scripts/run_installer.sh
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 github.com/rakyll/statik
Generate statik filesystem:
go generate ./...
Command Line Options
dapp-openvpn-inst
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
-setauth
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")
-version
Prints current dappctrl version
Tests
Run tests for all packages:
./scripts/run_tests.sh <path_to_the_test.conf>
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
Authors
See also the list of contributors
who participated in this project.
License
This project is licensed under the GPL-3.0 License - see the
COPYING file for details.