GithubHelp home page GithubHelp logo

mythmon / classify-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mozilla/classify-client

0.0 3.0 0.0 224 KB

An optimized version of the classify client endpoint in Normandy

Dockerfile 2.88% Rust 97.12%

classify-client's Introduction

Classify Client

codecov

This is an optimized version of the classify client endpoint in Normandy.

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 be downloaded automatically during the build.

Note: It relies on curl and tar commands. See build.rs for insights about how to obtain the file manually in case the .mmdb file does not show up in the current folder.

Configuration

Via environment variables:

  • HOST: host (default: "localhost")
  • PORT: port number (default: "8000")
  • GEOIP_DB_PATH: path to GeoIP database (default: "./GeoLite2-Country.mmdb")
  • HUMAN_LOGS: set to true to use human readable logging (default: MozLog as JSON)
  • SENTRY_DSN: report errors to a Sentry instance (default: "")
  • VERSION_FILE: path to version.json file (default: "./version.json")
  • SENTRY_DSN: report errors to a Sentry instance (default: "")
  • DEBUG: A boolean that enables extra debugging options, such as a /debug endpoint that shows internal server state.
  • TRUSTED_PROXY_LIST: A comma-separated list of CIDR ranges that trusted proxies will be in. Supports both IPv4 and IPv6.

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:

  • Rustfmt
  • Clippy, using the clippy::all preset

classify-client's People

Contributors

mythmon avatar leplatrem avatar sciurus avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.