This is the desktop client for the Kyn VPN service. It consists of an unprivileged thin GUI client (the "client") and a privileged background service/daemon (the "daemon"). The daemon runs a single instance on the machine and is responsible for not only network configuration but also settings and account handling, talking to Kyn VPN servers as necessary. The client meanwhile runs in each active user's desktop and consists almost entirely of presentation logic. No matter how many users are active on a machine, they control the same single VPN instance and share a single Kyn VPN account.
Kyn VPN Desktop is a fork of the Private Internet Access Desktop Client, released under the GPLv3. The upstream copyright notices are retained in the source files.
The project uses Qt 6.12 for cross-platform development, both in the client and daemon. The client GUI is based on Qt Quick, which uses declarative markup language and JavaScript and offers hardware accelerated rendering when available. Qt and Qt Quick tend to be more memory and CPU efficient compared to web-based UI frameworks like Electron or NW.js.
Each release has a
SHA256SUMS file signed with the Kyn VPN release key,
docs/kynvpn-release.pub. To check an installer,
download it with SHA256SUMS and SHA256SUMS.sig, then:
> openssl pkeyutl -verify -pubin -inkey kynvpn-release.pub -rawin -in SHA256SUMS -sigfile SHA256SUMS.sig
Signature Verified Successfully
> sha256sum --check --ignore-missing SHA256SUMSThe client verifies its updates the same way (see Building for distribution).
The client is intended to be built on the target platform; Windows builds are built on Windows, macOS builds on macOS, and Linux builds on Linux. GitHub Actions builds every platform.
The entire product is built using rake, using the supporting framework in the rake/ directory.
Dependencies such as OpenVPN and the Windows TAP driver are included as precompiled binaries under the deps directory in this project for convenience. To recompile any of these, please refer to their corresponding directories and/or repositories for build instructions.
Before cloning the Git repository, first make sure Git LFS is installed and initialized:
> git lfs version
git-lfs/2.3.4 (GitHub; windows amd64; go 1.8.3; git d2f6752f)
> git lfs install
Updated git hooks.
Git LFS initialized.After this, cloning the repository normally should also fetch the precompiled binaries:
> git clone https://github.com/Shells-com/kynvpn-desktop.git
...
Filtering content: 100% (24/24), 17.13 MiB | 1.89 MiB/s, done.The client uses Qt 6.12. Linux and macOS builds use the open source Qt builds from Shells-com/kynvpn-qt; Windows builds use the official Qt binaries. rake/model/qt.rb finds Qt under C:/Qt*/6.* (Windows), /opt/Qt*/6.* or $HOME/Qt*/6.*; set QTROOT (e.g. C:\Qt\6.12.0) to pick one explicitly.
- On Windows (x86_64, arm64):
- Using git from git bash instead of powershell is recommended, due to some knows bugs in Windows built-in openssh service in regards to git-lfs.
- Use chocolatey from an admin powershell session chocolatey.org/install running:
choco install ruby 7Zip git git-lfs
- Qt 6.12.0 for MSVC 2022 (
msvc2022_64ormsvc2022_arm64), with the Qt Image Formats module:- Either the Qt online installer (needs a Qt account; select "Custom installation" and add Sources and Qt Debug Information Files to debug into Qt)
- Or, without an account:
python .github/scripts/install-qt-official.py windows_x86 6.12.0 win64_msvc2022_64 C:/Qt qtimageformats(usewindows_arm64/win64_msvc2022_arm64on arm64), the same script CI uses
- Visual Studio 2022 or newer, with the C++ desktop workload
- Can install with choco with
choco install visualstudio2022community - The VS installer doesn't include the Console Debugger (CDB), which is needed to debug in Qt Creator. More info: Setting Up Debugger
- Can install with choco with
- On macOS:
- Qt 6.12.0 universal build from kynvpn-qt releases (
qt-6.12.0-kynvpn-macos-universal.run)- It can be used for universal or single-architecture builds.
- If you want Qt Creator, also install Qt from qt.io
- Xcode 16 or newer (macOS 15 SDK); the app requires macOS 14.4 or newer, like Qt 6.12
- Ruby, can be installed using Homebrew with
brew install ruby - Install rake:
sudo gem install rake
- Qt 6.12.0 universal build from kynvpn-qt releases (
- On Linux:
- A distribution with glibc 2.34 or newer (the kynvpn-qt packages are built on AlmaLinux 9) and clang 13 or newer
- Supported architectures: x86_64, arm64
- Qt 6.12.0 from kynvpn-qt releases (
qt-6.12.0-kynvpn-linux-<arch>.run)- If you want Qt Creator, also install Qt from qt.io
- Host build (Debian 12+ and derivatives):
sudo apt install build-essential rake clang llvm mesa-common-dev libgl-dev libnl-3-dev libnl-route-3-dev libnl-genl-3-dev git git-lfs zip
- Host build (Arch and derivatives):
sudo pacman -S base-devel git-lfs ruby-rake clang llvm libnl zip
- Published releases are built in an AlmaLinux 9 container, see Building for Distribution
Each platform requires additional installation steps in order for the client to be usable (e.g. the Windows TAP adapter needs to be installed).
The easiest way to perform these steps is to build and run an installer, after which you can stop and run individual executables in a debugger instead.
To debug your own daemon, the installed daemon must first be stopped:
- Windows: Run
services.mscand stop the Kyn VPN Service. Set it to manual - macOS: Run
sudo launchctl unload /Library/LaunchDaemons/com.kynvpn.vpn.daemon.plist - Linux: Run
sudo systemctl stop kynvpn
The daemon must run as root. Consult your IDE/debugger documentation for how to safely run the debugger target as root.
Windows only:
- If Qt is not in your PATH, add
C:\Qt\6.12.0\msvc2022_64\binto your user environment variable path.
This is needed if you want to runkyn-client.exeorkyn-service.exevia command line. - To run the kyn-daemon, execute
.\kyn-service.exe runin Powershell with admin privileges
To check Kyn VPN logs, go to your *installation_path*\data (The default path on Windows is C:\Program Files\Kyn VPN\data).
In order to enable all the logs, in the Kyn VPN app Settings page go to Help and select Enable Debug Logging.
- To build the final installer for the host OS and architecture:
rake installer- Produced in
out/kyn_debug_<arch>/installer
- Produced in
- To build all artifacts for the host OS and architecture:
rake all- Artifacts go to
out/kyn_debug_<arch>/artifacts
- Artifacts go to
- To build just the staged installation for development:
rake- Staged installation is in
out/kyn_debug_<arch>/stage- run the client or daemon from here
- Staged installation is in
- To run tests:
rake test - To build for release instead of debug, set
VARIANT=releasewith any of the above
Linux: check that the symbolic links are correct using ls -lah -R deps/built/linux/.
If they are not, create them using ln -sf libfile linkname.
The following targets can be passed to rake. The default target is stage, which stages the built client, daemon, and dependencies for local testing (but does not build installers, tests, etc.)
| Target | Explanation |
|---|---|
| (default) | Builds the client and daemon; stages executables with dependencies in out/kyn_debug_x86_64/stage for local testing. |
test |
Builds and runs unit tests; produces code coverage artifacts if possible on the current platform (requires clang 6+) |
installer |
Builds the final installer artifact, including code signing if configured. |
export |
Builds extra artifacts needed from CI but not part of any deployable artifact (currently translation exports) |
libs |
Builds the dtop libraries and development artifact (see DTOP-LIBS.md) |
tools |
Builds extra tools for development purposes that are not used as part of the build process or as part of any shipped artifact. |
artifacts |
Builds all artifacts and copies to out/kyn_debug_x86_64/artifacts (depends on most other targets, execpt test when coverage measurement isn't possible) |
all |
All targets. |
The build system has several properties that can be configured, either in the environment or by passing the appropriate variables to rake.
These are implemented in rake/build.rb. The output directory name includes the current brand, variant, and architecture.
| Variable | Values | Default | Explanation |
|---|---|---|---|
VARIANT |
debug, release |
debug |
Create a debug build (unoptimized, some compression levels reduced for speed), or release build (optimized, maximum compression). |
ARCHITECTURE |
x86_64, x86, arm64, arm64e, armhf, universal |
Host architecture | Select an alternate architecture. Architecture support varies by platform. |
PLATFORM |
windows, macos, linux, android, ios, iossim |
Host platform | Select an alternate platform. Android and iOS targets only build core libraries and tests. Android builds can be performed from macOS or Linux hosts. iOS and iOS Simulator builds can be performed from macOS hosts. |
BRAND |
(directories in brands/) |
kyn |
Build an alternate brand. |
Some additional environment variables can be configured:
| Variable | Example | Explanation |
|---|---|---|
QTROOT |
/opt/Qt/6.12.0 | Path to the installed Qt version, if qt.rb can't find it or you want to force a specific version |
Installation on Mac uses SMJobBless to install a privileged helper that does the installation.
Mac OS requires the app to be signed in order to install and use the helper. If the app is not signed, it will not be able to install or uninstall itself (you can still install or uninstall manually by running the install script with sudo.)
PIA_CODESIGN_CERT must be set to the full common name of the certificate to sign with. (codesign allows a partial match, but the full CN is needed for various Info.plist files.)
To test installation, you can generate a self-signed certificate and sign with that.
- Open Keychain Access
- Create a new keychain
- Right-click in the Keychains pane and select "New Keychain..."
- Give it a name (such as "Kyn codesign") and password
- Generate a self-signed code signing certificate
- Select your new keychain
- In the menu bar, select Keychain Access > Certificate Assistant > Create a Certificate...
- Enter a name, such as "Kyn codesign", it does not have to match the keychain name
- Keep the default identity type "Self Signed Root"
- Change the certificate type to "Code Signing"
- Click Create, then Continue
- Optional - disable "lock after inactivity" for your keychain
- Right-click on the keychain and select "Change Settings for Keychain"
- Turn off locking options as desired
- Use the certificate to sign your build
- Qt Creator:
- Select Projects on the left sidebar, and go to the build settings for your current kit
- Expand "Build Environment"
- Add a new variable named
PIA_CODESIGN_CERT, and set the value to the common name for your certificate
- Manual builds with
build-macos.sh- Just set
PIA_CODESIGN_CERTto the common name you gave the certificate when building
- Just set
- Qt Creator:
Note: building for android and ios is deprecated and unsupported at the time.
Some core libraries can be built targeting Android and iOS for use in our mobile clients.
- For Android targets:
- Linux or macOS host. Windows hosts are not currently supported for Android builds.
- Ruby and Rake:
- Debian:
sudo apt install rake - Arch:
sudo pacman -S ruby-rake - macOS Homebrew:
brew install ruby(includes Rake)
- Debian:
- Android NDK 21.0.6113669 (preferred) or any later version
- You can install this from Android Studio or using the command-line SDK tools
- For iOS targets:
- macOS host, up-to-date version of Xcode
- Ruby and Rake:
- macOS Homebrew:
brew install ruby(includes Rake)
- macOS Homebrew:
Invoke rake with PLATFORM=android or PLATFORM=ios to target a mobile platform.
You can also set ARCHITECTURE to one of arm64, armhf, x86_64, or x86 - the host architecture is the default.
If you do this a lot, you can place overrides in your environment or .buildenv to use these by default.
(Qt does not need to be installed for mobile targets.)
The same rake-based build system is used, but the available targets differ.
| Target | Explanation |
|---|---|
| (default) | Stages core libraries with dependencies in out/kyn_debug_<platform>_<arch>/dtop-libs for local testing. |
libs_archive |
Builds the library SDK ZIP containing the built libraries and headers. |
tools |
Builds libraries and internal test harnesses used to test them. |
artifacts |
Builds all artifacts and copies to out/kyn_debug_<platform>_<arch>/artifacts (depends on most other targets) |
all |
All targets. |
In the headless_tests directory you will find a suite of tests written in ruby with the help of RSpec.
They use kynctl in the background to manipulate the state of the daemon and run diverse tests.
The advantage of testing in ruby is mainly simplicity, where doing things like calling API endpoints is much simpler than from C++ code.
With these almost end to end tests we hope to drastically reduce manual testing for releases to the point that we can release more frequently.
Use bundle install from the headless_tests directory to ensure you get all the dependencies.
Run the tests from within the headless_tests to pick up configuration in .rspec and spec_helper.
Run all tests locally using bundle exec rspec ..
Add C:\Program Files\Kyn VPN to your user environment variable Path in order to be able to run kynctl from the command line. (You can still run kynctl using the full path, but the headless tests won't work).
By contributing to this project you are agreeing to the terms stated in the Contributor License Agreement. For more details please see CONTRIBUTING.
Unless otherwise noted, original source code is licensed under the GPLv3. See LICENSE for more information.