# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['src', 'src.pynx']

package_data = \
{'': ['*']}

install_requires = \
['gixy>=0.1.20,<0.2.0', 'texttable>=1.6.3,<2.0.0']

setup_kwargs = {
    'name': 'pynx',
    'version': '0.1.0',
    'description': 'CLI tool for managing nginx daemon, sites and associated wsgi services',
    'long_description': "## `pynx` - CLI tool for managing nginx daemon, sites and associated wsgi services\n\nManaging `nginx` instances, the activation, deactivation of sites and associated `wsgi` processes can be a bit cumbersome with the number of commands required to manage and analyze.\n\nThis tool is designed to allow a user to manage `nginx` daemon status, start, stop, reload etc; `nginx` website, enable, disable, start, stop, status and also `wsgi` process status, start, stop, restart etc; from one CLI utility\n\nThis project is still in alpha stage but should be usable.\n\n\n## Installation\nFor now, the tool requires to be run from source. Download from github and place in an appropriate 'app' directory and create an appropriate script to invoke that allows it to be run as root (as required by nginx).\n\nIts suggested to use the new (py_src_run)[https://github.com/JavaScriptDude/py_src_run] tool to aid in this process and the file `pynx_install.sh` file in the root of this project is tooled to use `py_src_run`. `py_src_run` has been developed and tested to work with running as root, which is required fo this tool. Deploying a python app that runs as root and does not interfere with the OS's built in python can be tricky and is beyond the experience of the author at this time.\n\n\n## systemd\nAs the main developer works primarily in `debian` environments, this tool was developed to work with `systemd`. This tool could be adjusted in the future to work with non-systemd environments but additional developers will be needed to develop and test as such environments will not be focus of the main developer who is sticking with `debian` as main `*nix` development and production environment.\n\n\n## Dependencies\nLinux environments that utilize `systemd`. Python 3.7.9+ environment. Root access.\n\n\n\n## nginx server management (pynx \\<cmd\\>):\n\n### pynx `status`\nShow status of nginx daemon\n```\n[sudo] password for <user>: \n◦ nginx status:\n◦   status: active (running) since Fri 2022-10-07 20:17:26 EDT; 1 day 4h ago\n◦      pid: 3007225\n◦   memory: 31.5M\n◦    tasks: 25 (limit: 115744)\n◦      cli: /usr/sbin/nginx -g daemon on; master_process on;\n\n```\n\n### pynx `list`\nList all available and enabled sites\n```\n    Site     | Enabled |     Name      |        Listens         | Notes\ndev_testsite |    x    | dev_testsite2 | 29990                  | -    \ndev_biztools |    x    | dev_biztools  | 9101                   | -    \ndefault      |    -    | _             | 80 default_server      | -    \n             |         |               | [::]:80 default_server |      \n\n```\n\n### pynx `test`\nVerify site configs\n```\nPass - nginx and site configs ok\n```\n\n### pynx `start`\nStart nginx daemon\n```\ndone - active (running) since Sun 2022-10-09 00:35:10 EDT; 10ms ago\n-or-\nServer already running (active (running) since Sun 2022-10-09 00:35:10 EDT; 22s ago)\n```\n\n### pynx `stop`\nStop nginx daemon\n```\ndone - inactive (dead) since Sun 2022-10-09 00:34:35 EDT; 10ms ago\n-or-\nServer already inactive (inactive (dead) since Sun 2022-10-09 00:35:56 EDT; 1s ago)\n```\n\n### pynx `reload`\nReload nginx daemon\n```\ndone - active (running) since Sun 2022-10-09 00:36:58 EDT; 12ms ago\n-or-\nServer is inactive (inactive (dead) since Sun 2022-10-09 00:37:25 EDT; 1s ago)\nPlease use `pynx start`\n```\nNotes:\n* Tool is coded to be aware of segfault issue with perl and nginx in Ubuntu 20.04 and will prompt user to restart instead\n* Will not restart if the server is stopped. Prompts user in such a case\n\n\n### pynx `restart`\nRestart nginx daemon\n```\ndone - active (running) since Sun 2022-10-09 00:39:36 EDT; 10ms ago\n-or-\nServer is inactive (inactive (dead) since Sun 2022-10-09 00:37:25 EDT; 1s ago)\nPlease use `pynx start`\n```\n\n\n## nginx site management (pynx \\<site\\> \\<cmd\\>):\n\n### pynx dev_testsite `status`\nShow status for site\n```\n◦       Site     | Enabled |     Name      | Listens | Notes\n◦   dev_testsite |    x    | dev_testsite2 | 29990   | -    \n```\n\n### pynx dev_testsite `start`\nEnables site if not enabled an reload nginx\n```\n◦ nginx reloaded\n◦ site dev_testsite started\n◦       Site     | Enabled |     Name      | Listens | Notes\n◦   dev_testsite |    x    | dev_testsite2 | 29990   | -   \n# -or-\n◦ Site is already started:\n◦       Site     | Enabled |     Name      | Listens | Notes\n◦   dev_testsite |    x    | dev_testsite2 | 29990   | -    \n◦ run `pynx reload` if site is not running\n\n```\n\n### pynx dev_testsite `stop`\nDisables site if enabled an reload nginx\n```\n◦ nginx reloaded\n◦ site dev_testsite stopped\n◦       Site     | Enabled |     Name      | Listens | Notes\n◦   dev_testsite |    -    | dev_testsite2 | 29990   | -    \n```\n\n### pynx dev_testsite `enable`\nEnables site if not enabled. Will prompt for reload\n```\n◦ site dev_testsite enabled\n◦       Site     | Enabled |     Name      | Listens | Notes\n◦   dev_testsite |    x    | dev_testsite2 | 29990   | -    \n```\n\n### pynx dev_testsite `disable`\nDisables site if enabled. Will prompt for reload\n```\n◦ site dev_testsite disabled\n◦       Site     | Enabled |     Name      | Listens | Notes\n◦   dev_testsite |    -    | dev_testsite2 | 29990   | -    \n```\n\n### pynx dev_testsite `config`\nPrints config summary for site\n```\n◦ Config for site default:\n◦   server {\n◦     listen 80 default_server;\n◦     listen [::]:80 default_server;\n◦     root /var/www/html;\n◦     index index.html index.htm index.nginx-debian.html;\n◦     server_name _;\n◦     location / {\n◦       try_files $uri $uri/ =404;\n◦     }\n◦   }\n```\n\n\n## WSGI commands (pynx wsgi:\\<site\\> \\<cmd\\>):\n\n### pynx wsgi:dev_testsite `status`\nShow status for site wsgi\n```\nactive - (dev_testsite - active (running) since Fri 2022-10-07 19:59:30 EDT; 1 day 4h ago)\n```\n\n### pynx wsgi:dev_testsite `start`\nStarts site wsgi if stopped\n```\nWSGI started (dev_testsite - active (running) since Sun 2022-10-09 00:47:24 EDT; 11ms ago)\n```\n\n### pynx wsgi:dev_testsite `stop`\nStops site wsgi if started\n```\nWSGI stopped (dev_testsite - inactive (dead) since Sun 2022-10-09 00:47:04 EDT; 13ms ago)\n```\n\n### pynx wsgi:dev_testsite `restart`\nRestart site wsgi\n```\nWSGI restarted (dev_testsite - active (running) since Sun 2022-10-09 00:47:56 EDT; 10ms ago)\n```\n\n\n## Request for assistance\nI am wide open for suggestions on how to improve the API and output. Please give this tool a run and pass along ideas.\nIf any python deveopers can assist with packaging this more formally to make it easier to deploy as a proper PyPi installed project, it would be greatly appreciated. I don't have experience with packaging cli apps on PyPi and need the help! I did do alot of testing to get proper installs working but ran out of time and decided to get the tried tested and trued `run from source` method working for the time being.\n\n\n\n## Python Code Styling notes\nMy code styling may look quite different from python developers but its based on many years of experience developing systems in many other langages over my career. Over my time developing applications, I have swayed heavily to towards `fail fast` design principles, developing methods for early assertions of data and parameters which makes the development process much smoother as errors are easier to trace with the first exception rather than having `null pointer` type exceptions burried down the callstacks requiring back tracking to find the source of bad data. I will streamline the code in the future to be a bit faster and concise but for now its a slow and steady design approach.",
    'author': 'Timothy C. Quinn',
    'author_email': None,
    'maintainer': None,
    'maintainer_email': None,
    'url': 'https://pypi.org/project/pynx',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>=3.7.9,<4.0.0',
}


setup(**setup_kwargs)
