fenix-checker-0.1.4
توضیحات
A small server which checks if user's IP is in a trusted Fenix network.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | fenix-checker-0.1.4 |
| نام | fenix-checker |
| نسخه کتابخانه | 0.1.4 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Jiri Helebrant |
| ایمیل نویسنده | jiri.helebrant@nic.cz |
| آدرس صفحه اصلی | https://gitlab.nic.cz/websites/fenix-checker |
| آدرس اینترنتی | https://pypi.org/project/fenix-checker/ |
| مجوز | - |
# [](https://fe.nix.cz/) `fenix-checker`
A small server which checks if user's IP is in a trusted [Fenix](https://fe.nix.cz/) network. Used by [`ipv6widget`](https://gitlab.nic.cz/labs/ipv6widget) and [standard-konektivity.cz](https://www.standardkonektivity.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`](https://docs.python.org/3/library/ipaddress.html) 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
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl fenix-checker-0.1.4:
pip install fenix-checker-0.1.4.whl
نصب پکیج tar.gz fenix-checker-0.1.4:
pip install fenix-checker-0.1.4.tar.gz