Skip to main content

Fenix fenix-checker

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

Dependencies

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

Installation

$ 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:

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

GUnicorn:

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

Usage

GET /
-> 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. "127.0.0.1'); DROP TABLE networks;"
-> 400
  {"error": "Invalid IP"}

Development

Starting server with auto reload on file changes:

$ FLASK_APP=fenix_checker/server.py FLASK_DEBUG=1 flask run

Linting Python code:

$ flake8 --config=.flake8rc *py

License

GPLv3

Metadata

Release files for fenix-checker 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fenix-checker 0.1.4
File Size Uploaded Provenance Actions
fenix-checker-0.1.4.tar.gz 16.5 kB Without provenance Details for fenix-checker-0.1.4.tar.gz

Release files / fenix-checker-0.1.4.tar.gz

Download URL fenix-checker-0.1.4.tar.gz
Size 16.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7f90595107bb09bc23e233753a6ce9909e2dc849e810721c758fd011db4b8d40
BLAKE2b-256 checksum
How to use checksums
9baa6876e84f82b891cd64a94a3cd7cdee2cd62d01cdd1f38f6b86ae48cbf32c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.12

Security for fenix-checker 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page