mozilla-it / pocket-proxy-rs

Rust implementation of the Pocket sponsored content proxy
Mozilla Public License 2.0
2 stars 0 forks source link

Pocket Proxy server (Rust version)

This is an reimplementation of the original Pocket proxy server in Rust. The proxy server delivers sponsored content obtained from the Kevel API (formerly Adzerk), while preserving the privacy of Firefox users.

The code of https://github.com/mozilla/classify-client was used as a starting point of this implementation.

Dev instructions

This is a normal Cargo project, so after cloning the repository, you can build and run it with

$ cargo build
$ cargo run

This project should run on the latest stable version of Rust. Unstable features are not allowed.

GeoIP Database

A GeoIP database will need to be provided. By default it is expected to be found at ./GeoIP2-City.mmdb.

Configuration

Via environment variables:

Tests

Tests can be run with Cargo as well

$ cargo test

Linting

Linting is handled via Therapist. After installing it, enable the git hooks using either therapist install or therapist install --fix. The --fix variant will automatically format your code upon commit. The variant without --fix will simply show an error and ask you to reformat the code using other means before committing. Therapist runs in CI.

The checks Therapist runs are: