dlactin / contile

This is the back-end server for the Mozilla Tile Service (MTS)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Contile graphic

Contile Tile Server

This is the back-end server for the Mozilla Tile Service (MTS).

The goal of this service is to pass tiles from partners along to Firefox for display while ensuring customer privacy and choice as discussed in the support article "Sponsored tiles on the New Tab page".

Supports the TopSites feature within Firefox.

See also:

Requirements

This system uses Actix web, and Google Cloud APIs (currently vendored).

Setting Up

Contile uses Rust, and requires the latest stable iteration. See rustup.rs for how to install this application.

Once Rust is installed you can compile using cargo build. This will create a development release.

Running

Contile is configured via environment variables. To see the complete list of available settings in contile::settings::Settings (note, you can use cargo doc --open to generate documentation.) In general, we have tried to provide sensible default values for most of these, however you may need to specify the following:

CONTILE_ADM_ENDPOINT_URL={Your ADM endpoint} \
    cargo run

Please note that the {} indicate a variable replacement and should not be included, for example, a real environmet variable would look like: CONTILE_ADM_ENDPOINT_URL=https://example.com/

Testing

Unit tests

To run Contile's unit tests, run

cargo test

This will test everything, except for Google Storage for images. In order to test that, you will need to include the following:

GOOGLE_APPLICATION_CREDENTIALS={path to your credential.json file} \
    CONTILE_TEST_PROJECT={GCP Project name} \
    CONTILE_TEST_BUCKET={GCP Bucket name} \
    cargo test

Integration tests

Integration tests are currently run using Docker images. This is so that they can be run as part of our automated continuous integration (CI) testing. Running these tests outside of Docker is possible, but requires some additional work. See Contile Integration Tests for details.

Why "Contile"?

It's a portmanteau of "Context" and "Tile", which turns out to be the name of a small village in the Parma region of Italy. So it's pronounced "kon tē`"

About

This is the back-end server for the Mozilla Tile Service (MTS)

License:Mozilla Public License 2.0


Languages

Language:Rust 86.9%Language:Python 7.9%Language:Shell 4.7%Language:Dockerfile 0.5%