{ "info": { "author": "Adriano Di Luzio", "author_email": "adrianodl@hotmail.it", "bugtrack_url": null, "classifiers": [ "Development Status :: 6 - Mature", "Environment :: Other Environment", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "Intended Audience :: Information Technology", "License :: OSI Approved :: MIT License", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Internet :: Name Service (DNS)", "Topic :: System :: Operating System", "Topic :: Utilities" ], "description": "# uWSGI-local-DNS-resolver\nuWSGI-local-DNS-resolver (from now on __uWSGI-DNS__) is a DNS server that resolves to `localhost` each request directed to a uWSGI-subscribed domain.\n\n# Why?\nOur main intent is to let users transparently connect to their local development instances handled through a uWSGI HTTP subscription server.\n\n## Project status\nuWSGI-DNS is still a work in progress. As a consequence, its APIs could be subject to changes.\n\n## Features\n- Python 2 & Python 3 compatibility.\n- UNIX/Linux systems compatibility.\n- Automatic domain refresh on new uWSGI subscriptions.\n- Failed nodes detection and handling.\n\n## Installation\nUntil uWSGI-DNS lands on PyPi you can install it as follows:\n```bash\n$ git clone https://github.com/20tab/uwsgi-local-dns-resolver.git\n$ cd uwsgi-local-dns-resolver\n$ python setup.py install # you could need sudo here\n```\n\nAnd if you want, you can test the server with:\n```bash\n$ sudo uwsgidns # we need sudo to bind on reserved port 53\n```\n\nOnce started, you should have a DNS server running on `localhost:53`.\n\nNote: installing uWSGI-DNS inside a virtualenv is obviously possible, but you should use particular care while integrating it into uWSGI configuration files.\n\n## Configuration\n```bash\n$ uwsgidns -h\nusage: uwsgidns [-h] [-l {CRITICAL,ERROR,WARNING,INFO,DEBUG,NOTSET}] [-p]\n [-u upstream DNS server URI] [-s uwsgi-HTTP-stats-URI]\n\nDNS server that resolves to localhost uWSGI HTTP subscribed domains.\n\noptional arguments:\n -h, --help show this help message and exit\n -l {CRITICAL,ERROR,WARNING,INFO,DEBUG,NOTSET}, --logging {CRITICAL,ERROR,WARNING,INFO,DEBUG,NOTSET}\n set the logging level\n -p, --proxy proxy other requests to upstream DNS server\n (--upstream)\n -u upstream DNS server URI, --upstream upstream DNS server URI\n the URI to the upstream DNS server (with --proxy),\n defaults to 8.8.8.8:53\n -s uwsgi-HTTP-stats-URI, --stats uwsgi-HTTP-stats-URI\n the URI (remote:port) to the uWSGI HTTP subscription\n stats server\n```\n\n### Non-local requests\nuWSGI-DNS can act as a DNS proxy (`-p`), forwarding each non-local request to the upstream server specified with the `-u` flag;\notherwise, it simply drops such requests and let the OS fallback DNS server handle them.\n\n### uWSGI stats\nSetting the `-s` will let uWSGI-DNS poll the uWSGI subscription server periodically.\nIn this way uWSGI-DNS will notice failed/disappeared HTTP nodes and will remove them from the local domains.\n\n## uWSGI (Emperor) integration\nThe integration with the uWSGI emperor is simple and straightforward.\nWe assume you use the uWSGI HTTP subscription server.\nTo integrate uWSGI-DNS you can edit the configuration file of your emperor/subscription server as follows:\n\n```ini\n; uWSGI subscription server - ini configuration file\nhttp = :80\nhttp-subscription-server = 127.0.0.1:5005\nhttp-stats-server = 127.0.0.1:5004\n\n; resubscribe let uWSGI-DNS know about new HTTP nodes\nhttp-resubscribe = 127.0.0.1:9696\n\n; launch the uWSGI-DNS with the HTTP subscription server\n; you can tweak the command line arguments and the path here\nattach-daemon = uwsgidns\n```\nAnytime you'll launch the subscription system, the uWSGI-DNS server will launch with it.\n\nPlease note that in the following section we provide some more OS-specific examples.\n\n## OS integration\nTODO: other OSs integration.\n\nThe OS integration largely varies with each platforms.\nWe provide here just a few examples, adapt them to your needs.\n\n### OS X integration\nYou can use LaunchD to automatically launch a uWSGI emperor instance on startup.\nTo do so, create the file `it.unbit.uwsgi.emperor.plist` in the `/Library/LaunchDaemons/` directory and make sure it has the following content.\nThe same example can also be found in this repository.\n\n```plist\n\n\n\n\n RunAtLoad\n \n Disabled\n \n KeepAlive\n \t\n \tSuccessfulExit\n \t\n \t \n Label\n it.unbit.uwsgi.emperor\n ProgramArguments\n \n /usr/local/bin/uwsgi\n --master\n --die-on-term\n \n --plugin\n syslog\n --logger\n syslog:\n --emperor\n /Users/*/*/vassals/*.ini\n --emperor\n /Users/*/vassals/*.ini\n --emperor-tyrant\n --http\n :80\n --http-subscription-server\n 127.0.0.1:5005\n --http-resubscribe\n 127.0.0.1:9696\n --http-stats-server\n 127.0.0.1:5004\n --emperor-stats-server\n 127.0.0.1:5000\n --attach-daemon\n /usr/local/bin/uwsgidns -p\n \n\n\n```\nPut the vassals configuration files in your home folder and then start the uWSGI emperor with the command:\n```bash\n$ sudo launchctl load /Library/LaunchDaemons/it.unbit.uwsgi.emperor.plist\n```\n\nYou can finally edit your connection parameters and set the [custom DNS server](https://support.apple.com/kb/PH14159) pointing to `127.0.0.1`.\nThe DNS resolver will try to solve local requests and then will proxy to upstream the others.\nThe default upstream is `8.8.8.8:53` and you can customize it with the `-u UPSTREAM_ADDRESS:PORT` flag.\n\n_Bonus_: before editing your network settings, you can create a new [Network Location](https://support.apple.com/en-us/HT202480) to be specifically used while developing and edit its DNS settings.\n\n## Tests\nTODO: add tests.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/20tab/uwsgi-local-dns-resolver", "keywords": "uwsgi,dns,uwsgidns,localhost", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "uwsgidns", "package_url": "https://pypi.org/project/uwsgidns/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/uwsgidns/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/20tab/uwsgi-local-dns-resolver" }, "release_url": "https://pypi.org/project/uwsgidns/1.0.1/", "requires_dist": null, "requires_python": null, "summary": "Dinamically route to localhost request for uWSGI locally subscribed domains.", "version": "1.0.1" }, "last_serial": 1579712, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "bdbac66f662d46f86cd33dd9f648249b", "sha256": "316c7cd703abc5037455af857fdfdeda8e3b5cb337e5ecdc037a4b715b026939" }, "downloads": -1, "filename": "uwsgidns-1.0.1.tar.gz", "has_sig": false, "md5_digest": "bdbac66f662d46f86cd33dd9f648249b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11696, "upload_time": "2015-06-05T11:21:00", "url": "https://files.pythonhosted.org/packages/95/59/2ff40627dc8a7eb193113890ee1d7bfdaaafb1ddee190ade43421979a61b/uwsgidns-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bdbac66f662d46f86cd33dd9f648249b", "sha256": "316c7cd703abc5037455af857fdfdeda8e3b5cb337e5ecdc037a4b715b026939" }, "downloads": -1, "filename": "uwsgidns-1.0.1.tar.gz", "has_sig": false, "md5_digest": "bdbac66f662d46f86cd33dd9f648249b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11696, "upload_time": "2015-06-05T11:21:00", "url": "https://files.pythonhosted.org/packages/95/59/2ff40627dc8a7eb193113890ee1d7bfdaaafb1ddee190ade43421979a61b/uwsgidns-1.0.1.tar.gz" } ] }