Skip to main content

A small server which checks if user's IP is in a trusted Fenix network.

Project description

Fenix fenix-checker

A small server which checks if user's IP is in a trusted Fenix network. Used by ipv6widget and


  • Python >= 3.6
  • pyaml >= 17
  • psycopg2 >= 2.7.4


$ virtualenv -p `which python3.6` .venv
$ source .venv/bin/activate
$ pip install fenix_checker
$ cp config.example.yml config.yml
$ $EDITOR config.yml # set DB credentials

Running in production


$ uwsgi --master --single-interpreter --threads 2 --http :5000 -H .venv -w fenix_checker.server


$ gunicorn -w 2 -k gevent --timeout 160 -n netmetr-proxy fenix_checker:server:app


-> 200
   {"result": 1}

Result is:

  • 0 for non-Fenix networks
  • >= 1 for Fenix networks

IP is validated with Python's ipaddress module before passing it to DB:

GET /  # with client IP somehow spoofed to eg. "'); DROP TABLE networks;"
-> 400
  {"error": "Invalid IP"}


Starting server with auto reload on file changes:

$ FLASK_APP=fenix_checker/ FLASK_DEBUG=1 flask run

Linting Python code:

$ flake8 --config=.flake8rc *py



Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fenix-checker-0.1.3.tar.gz (16.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page