• Stars
    star
    462
  • Rank 94,832 (Top 2 %)
  • Language
    C++
  • License
    Other
  • Created over 4 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A fast, secure and easy to use VPN. Built by the makers of Firefox.

Mozilla VPN

One tap to privacy Surf, stream, game, and get work done while maintaining your privacy online. Whether you’re traveling, using public WiFi, or simply looking for more online security, we will always put your privacy first.

See: https://vpn.mozilla.org

Getting Involved

We encourage you to participate in this open source project. We love Pull Requests, Bug Reports, ideas, (security) code reviews, or any other kind of positive contribution.

Before you attempt to make a contribution please read the Community Participation Guidelines.

Here are some useful links to start:

Dev Setup

Docs for building the client

Pre-commit formatting hook

If you want to submit a pull-request, please, install the clang format pre-commit hook that lints code.

  1. The standard conda environment includes the required clang-format libraries. If the conda environment is not being used, a clang-format library will need to manually installed. (For example, using Homebrew on macOS: brew install clang-format.)

  2. The linter will need to know where to find the clang-format-diff.py file, so CLANG_FORMAT_DIFF must be exported. On a standard conda installation: export CLANG_FORMAT_DIFF=$(find ~/miniconda3/pkgs -name clang-format-diff.py)

  3. Install the pre-commit hook: ./scripts/git-pre-commit-format install

Testing

Unit tests

When built for any one of the desktop platforms, this project will also generate a suite of unit tests.

The tests are built manually specifying the build_tests target.

cmake --build build --target build_tests -j $(nproc)

Once built, you can run them with ctest as follows:

ctest --test-dir build -j $(nproc) --output-on-failure

Running the functional tests

New build required: Functional tests require a dummy build of the application, which is not built by default. To build the dummyvpn target, in the root folder of this repository run:

cmake --build build -j$(nproc) --target dummyvpn

This will create a dummy build under the tests/dummyvpn folder. To run the functional tests against this build, make sure the MVPN_BIN environment variable is set:

export MVPN_BIN=$(pwd)/build/tests/dummyvpn/dummyvpn

Other dependencies:

  • Install node (if needed) and then npm install to install the testing dependencies
  • Compile the testing addons: ./scripts/addon/generate_all_tests.py
  • Make a .env file and place it in the root folder for the repo. It should include:
  • MVPN_BIN (location of compiled mvpn binary. This must be a dummy binary, see note above.)
  • ARTIFACT_DIR - optional (directory to put screenshots from test failures)
  • Sample .env file:
export PATH=$PATH:~/Qt/6.2.4/macos/bin:$PATH
export QT_MACOS_BIN=~/Qt/6.2.4/macos/bin
MVPN_API_BASE_URL=http://localhost:5000
MVPN_BIN=dummybuild/src/mozillavpn
ARTIFACT_DIR=tests/artifact

To run a test: from the root of the project: npm run functionalTest path/to/testFile.js. To run, say, the authentication tests: npm run functionalTest tests/functional/testAuthenticationInApp.js.

Developer Options and staging environment

To enable the staging environment, open the Get Help window, and click on the Get Help text 6 times within 10 seconds to unlock the Developer Options menu. On this menu, you can enable on the Staging Server checkbox to switch to the staging environment. A full restart of the VPN will be required for this option to take effect.

Inspector

The inspector is a debugging tool available only when the staging environment is activated. When running MozillaVPN, go to the inspector page to interact with the app. Connect the inspector to the app using the web-socket interface. On desktop, use ws://localhost:8765.

The inspector offers a number of tools to help debug and navigate through the VPN client:

  • Shell: By default the inspector link will take you to the Shell. From there type help to see the list of available commands.
  • Logs: Will constantly output all the app activities happening in real time. This information includes the timestamp, component and message. From the left column you can select which component(s) you'd like to monitor.
  • Network Inspector: Includes a list of all incoming and outgoing network requests. This is especially helpful when debugging network related issues or monitoring how the app communicates with external components such as the Guardian.
  • QML Inspector: Allows you to identify and inspect all QML components in the app by mirroring the local VPN client running on your machine and highlighting components by clicking on the QML instance on the right.

inspector_snapshot

Glean

Glean is a Mozilla analytics & telemetry solution that provides a consistent experience and behavior across all of Mozilla products.

When the client is built in debug mode, pings will have the app channel set to debug. Additionally, ping contents will be logged to the client logs.

When the client is in staging mode, but not debug mode, pings will have the app channel set to staging which allows for filtering between staging and production pings through the client_info.app_channel metric present in all pings.

A note on Glean embedding

Qt only accepts major.minor versions for importing. So if, for example, you're embedding glean v0.21.2 then it will still, for Qt's purpose, be v0.21.

Working on tickets with new Glean instrumentation

If you are responsible for a piece of work that adds new Glean instrumentation you will need to do a data review. Following is the recommended process along with some pointers.

The data review process is also described here: https://wiki.mozilla.org/Data_Collection

The basic process is this:

  • Implement the new instrumentation. Refer to the Glean book on how to do that.
  • When adding or updating new metrics or pings, the Glean YAML files might need to be updated. When that is the case a new data-review must be requested and added to the list of data-reviews for the updated/added instrumentation. When updating data-review links on the YAML files, these are the things to keep in mind:
    • Include a link to the GitHub bug that describes the work, this must be a public link;
    • Put "TBD" in the data_reviews entry, that needs to be updated before releasing the new instrumentation and ideally before merging it;
    • Think about whether the data you are collecting is technical or interaction, sometimes it's both. In that case pick interaction which is a higher category of data. (See more details on https://wiki.mozilla.org/Data_Collection);
  • Open a draft PR on GitHub;
  • Fill out the data-review1 form and request a data-review from one of the Mozilla Data Stewards2. That can be done by opening a Bugzilla ticket or more easily by attaching the questionnaire as a comment on the PR that implements the instrumentation changes. For Bugzilla, there is a special Bugzilla data review request option and for GitHub it's enough to add the chosen data steward as a reviewer for the PR.
  • The data-review questionnaire will result in a data review response. The link to that response is what should be added to the data_review entry on the Glean YAML files. It must be a public link.

Note:

  • It is ok for a reviewer to review and approve your code while you're waiting for data review.
  • It is not ok to release code that contains instrumentation changes without a data review r+. It is good practice not to merge code that does not have a data review r+.

Status

Unit Tests Lottie Tests Linters (clang, l10n) Linux Packages WebAssembly

Footnotes

  1. The data-review questionnaire can be found at https://github.com/mozilla/data-review/blob/main/request.md. That can be copy pasted and filled out manually. However, since the VPN application uses Glean for data collection developers can also use the glean_parser data-review command, which generates a mostly filled out data-review questionnaire for Glean users. The questionnaire can seem quite intimidating, but don't panic. First, look at an old data-review such as https://github.com/mozilla-mobile/mozilla-vpn-client/pull/4594. Questions 1, 2, 3 an 10 are the ones that require most of your attention and thought. If you don't know the answers to these questions, reach out to Sarah Bird or the product manager so you can answer these with full confidence. ↩

  2. Feel free to ping any of the data-stewards. If the collection is time sensitive consider pinging all data-stewards directly on the data-stewards matrix channel. ↩

More Repositories

1

firefox-ios

Firefox for iOS
Swift
12,203
star
2

fenix

⚠️ Fenix (Firefox for Android) moved to a new repository. It is now developed and maintained as part of: https://github.com/mozilla-mobile/firefox-android
Kotlin
6,473
star
3

focus-android

⚠️ Firefox Focus (Android) moved to a new repository. It is now developed and maintained as part of: https://github.com/mozilla-mobile/firefox-android
Kotlin
2,109
star
4

android-components

⚠️ This project moved to a new repository. It is now developed and maintained at: https://github.com/mozilla-mobile/firefox-android
Kotlin
2,019
star
5

firefox-android

⚠️ This repository hosts the Firefox for Android (Fenix), Focus for Android, and Mozilla Android Components projects. It is now developed and maintained as part of Mozilla Central. See the announcement here: https://github.com/mozilla-mobile/firefox-android/wiki#upcoming-migration-to-mozilla-central. ”
Kotlin
1,718
star
6

focus-ios

⚠️ Firefox Focus (iOS) has moved to a new repository. It is now developed and maintained as part of: https://github.com/mozilla-mobile/firefox-ios
Swift
1,259
star
7

reference-browser

A full-featured browser reference implementation using Mozilla Android Components.
Kotlin
567
star
8

FirefoxLite

Emerging Market Experiment
Java
282
star
9

firefox-tv

Firefox for Amazon's Fire TV
Kotlin
252
star
10

webxr-ios

An iOS app for testing WebXR
Swift
210
star
11

guardian-vpn-android

DEPRECATED - Mozilla VPN for Android
Kotlin
52
star
12

guardian-vpn-ios

Mozilla VPN for iOS
Swift
52
star
13

ios-l10n-scripts

Python
45
star
14

firefox-ios-open-in-client

INACTIVE - http://mzl.la/ghe-archive - Reference client for opening links in Firefox for iOS.
Swift
43
star
15

ScrollingCardView

INACTIVE - http://mzl.la/ghe-archive - A card view widget for iOS that will grow with its content, enabling scrolling when the content is larger than the view.
Swift
43
star
16

FirefoxData-android

DEPRECATED - A library for accessing a user's Firefox data: history, bookmarks, etc.
Java
39
star
17

shared-docs

⚠️ shared-docs moved to a new repository. It is now developed and maintained as part of: https://github.com/mozilla-mobile/firefox-android
34
star
18

telemetry-ios

A generic library for sending telemetry pings from iOS applications to Mozilla's telemetry service.
Swift
28
star
19

firefox-echo-show

Firefox for Amazon's Echo Show
Java
25
star
20

android-automation-tools

INACTIVE - http://mzl.la/ghe-archive - Tools for automating tasks in Android projects
Kotlin
23
star
21

prox

[INACTIVE] A search and discovery app for the "here & now". We're experimenting with ideas on mobile that can better surface content from the open web.
Swift
22
star
22

android-permission-handler

INACTIVE - http://mzl.la/ghe-archive - A permission helper systemizing runtime permission handling on Android devices
Java
21
star
23

MappaMundi

A declarative Don't Repeat Yourself tool for XCUITesting and screenshots.
Swift
19
star
24

AutocompleteTextField

An iOS text field that autocompletes text with the supplied list of words.
Swift
18
star
25

telemetry-android

A generic library for generating and sending telemetry pings from Android applications to Mozilla's telemetry service.
Java
18
star
26

gradle-apilint

Gradle Plugin that tracks the API of an Android library and helps maintain backward compatibility.
Python
8
star
27

outreachy-UX-2020

INACTIVE - http://mzl.la/ghe-archive - A place to document UX contributions for the summer 2020 Outreachy program.
8
star
28

perf-tools

Tools for the performance team that don't fit into other repositories
Python
7
star
29

fretboard

A simple A/B testing framework for mobile applications
Kotlin
6
star
30

relbot

Python
6
star
31

mozilla-mobile.github.io

INACTIVE - http://mzl.la/ghe-archive - Mozilla Mobile Blog
Ruby
6
star
32

buddybuild

INACTIVE - http://mzl.la/ghe-archive - Instructions on how to install an iOS app via BuddyBuild
5
star
33

testapp

Page for testing web page controls
JavaScript
5
star
34

prox-server

[INACTIVE] Server & data scripts for the Prox client.
Python
5
star
35

fenix-beta-version

GitHub Action that discovers the current Fenix Beta version
Python
5
star
36

web_metadata_ios

INACTIVE - http://mzl.la/ghe-archive - Client side web page metadata extraction
Swift
4
star
37

perf-frontend-issues

A repository to hold issues related to front-end mobile application performance.
4
star
38

fennec-profile-manager

Fennec Profile Manager (Backup / Restore)
Kotlin
4
star
39

test-dashboard

Python
3
star
40

nmx-video-prototypes

INACTIVE - http://mzl.la/ghe-archive - A collection of NMX prototypes for video-related topics
Kotlin
3
star
41

fenix-nightly-perftest-results

INACTIVE - http://mzl.la/ghe-archive - Fenix nightly performance test results
3
star
42

focus_foxfooding_campaign

3
star
43

onyx_ios

iOS Client for the Onyx link server https://github.com/mozilla/onyx
Swift
3
star
44

sync-strings-action

Sync Strings GitHub Action
Python
3
star
45

mobile-test-eng

Task tracking for Mobile Test Engineering Team
2
star
46

focus-ios-open-in-client

INACTIVE - http://mzl.la/ghe-archive - Reference client for opening links in Focus for iOS.
2
star
47

ac-version-for-fenix-beta

⚠️ This GitHub action is now developed and maintained as part of: https://github.com/mozilla-mobile/fenix-beta-version
Python
2
star
48

qt_static_windows

2
star
49

ndhook

INACTIVE - http://mzl.la/ghe-archive - A server that answers webhook calls from Github and instantiates Nimbledroid profiles
Rust
2
star
50

prox-explorer

[INACTIVE] A web-based exploration of event APIs for Project Prox.
JavaScript
2
star
51

FNPRMS

"funperms": Fenix Nightly Performance Regression Measurement System used by the Android FE perf team to measure cold startup. Please file issues in perf-frontend-issues
Python
1
star
52

testops-looker

LookML
1
star
53

qt_static_macos

This repo is needed to compile MozillaVPN on macOS as artifact
1
star
54

testops-tools

Home for Mobile cross-project CI tasks
Python
1
star
55

data-sync-user-testing

test repo for smoketesting the sync bot
1
star
56

strbot

String Bot - To sync strings to release branches (Fenix, A-C)
Python
1
star
57

mobile-test-priority-messaging

A Slack monitoring/message high priority messaging delegation application specific for the needs of the Mobile Test Engineering team
Python
1
star
58

LocalizationTools

Swift
1
star
59

ff-test-buddybuild

INACTIVE - http://mzl.la/ghe-archive - BuddyBuild - Test App
Swift
1
star
60

nimbledroidrs

INACTIVE - http://mzl.la/ghe-archive - A Rust library for interacting with Nimbledroid.
Rust
1
star
61

whatsnew

INACTIVE - http://mzl.la/ghe-archive - Update the Firefox for iOS info on iTunes Connect
Python
1
star