Trifle VPN

Trifle VPN

An example demonstrating the API for developing a VPN application for Aurora OS.

TrifleVPN

An example demonstrating the API for developing a VPN application for Aurora OS.

The project is a basic example that allows VPN solution developers to understand how to build their projects. It shows the basic universal logic without being tied to a specific real provider.

A non-existent provider is used as a VPN provider (the name Trifle can be translated as “toy”).

The server to which the connection is made does not exist, so the result "connected successfully" is immediately returned. At the same time, you can see and debug how the client part works.

The project contains an example of a toy VPN provider Trifle, a plugin for connman and for system settings (jolla-settings), as well as a GUI application for communicating with the plugin.

Installing

For correct working it's nessecary to install two rpm-packages:

  • ru.auroraos.TrifleVPN-{version}.{arch}.rpm - the package contains the application, the plugin for settings, the plugin for the Connman.
  • ru.auroraos.TrifleVPN-provider-{version}.{arch}.rpm - the package contains the provider called by the plugin for connection.

VPN provider

It's a binary application installing a VPN connection. It may be run by the user with the settings system menu or by the user's own desktop application.

The application can configure the network device using the connman plugin. There is a problem with installing the ru.auroraos.TrifleVPN-provider-{version}.{arch}.rpm package via sdk. This package can be installed in 2 ways:

  • Using system key signing.
  • Disabling package validation (dev mode required).

The package is installed via psdk as standard.

Plugin to integrate in connman

The plugin defines the necessary behavior to start a VPN tunnel and establishes a communication channel to the tunnel through which TUN/TAP interfaces can be configured.

  • triflevpn_plugin.c — contains the necessary functions to register the plugin in the Connman VPN.

Plugin to integrate in the system settings

Includes .qml files that will be dynamically loaded by system settings:

and plugin QQmlExtensionPlugin:

VPN application

Allows to manage connections related to this VPN.

IPC between VPN provider and VPN application

The application obtains a socket to communicate with the provider through a call to a DBus service that the provider registers:

In order to the application has access a DBus service that the provider registers, the provider must register a service named ORG_NAME.APP_NAME, where APP_NAME is the name of the application.

Important

To install the application, its RPM package must be signed with extended profile key.

Terms of Use and Participation

The source code of the project is provided under the license, which allows its use in third-party applications.

The contributor agreement documents the rights granted by contributors of the Open Mobile Platform.

Information about the contributors is specified in the AUTHORS file.

Code of conduct is a current set of rules of the Open Mobile Platform which informs you how we expect the members of the community will interact while contributing and communicating.

Project Structure

  • application directory contains implementation of the application to edit the connection settings.
    • application.pro file describes the subproject structure for the qmake build system.
    • icons directory contains application icons for different screen resolutions.
    • qml directory contains the QML source code and the UI resources.
      • components directory contains user QML components which implements some input fields.
      • cover directory contains the application cover implementations.
      • images directory contains the custom images.
      • pages directory contains the application pages.
      • TrifleVPN.qml file provides the application window implementation.
    • src directory contains the C++ source code.
      • main.cpp file is the application entry point.
    • ru.auroraos.TrifleVPN.desktop file defines the display and parameters for launching the application.
  • provider directory contains implementation of a VPN provider.
  • rpm directory contains the rpm-package build settings.
  • plugin directory contains the plugin to integrate in connman.
  • settings directory contains the plugin to integrate in the system settings.
  • translations directory contains the UI translation files.

Compatibility

The project is compatible with all the supported versions of the Aurora OS. Aurora 4 has validator restrictions for installing packages; it is recommended to disable package validation.

Screenshots

screenshots

This document in Russian / Перевод этого документа на русский язык