{ "info": { "author": "Benjamin Le Forestier", "author_email": "benjamin@leforestier.org", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Systems Administration" ], "description": "Parse and edit your FreeBSD jail.conf file with python.\n\nInstallation\n~~~~~~~~~~~~\n\nTo install jailconf, simply:\n\n.. code-block:: console\n\n pip3 install jailconf\n \njailconf requires Python 3.\n\nExamples\n~~~~~~~~\n\n.. code:: python\n\n import jailconf\n \nLoad the configuration from a path\n\n.. code:: python\n \n conf = jailconf.load('/etc/jail.conf')\n \nLoad the configuration from a string \n \n.. code:: python \n \n conf = jailconf.loads(open('/etc/jail.conf').read())\n \nCreate an empty configuration\n\n.. code:: python\n \n conf = jailconf.JailConf()\n \nThe configuration is represented as a dictionnary (actually a subclass of OrderedDict).\n \nLet's modify some settings.\n\nThe quoted strings in the configuration should be passed with the quotes.\nFor example, to obtain the setting:\n\n.. code:: sh\n \n path = \"/var/jail/$name\";\n\nyou write:\n\n.. code:: python\n \n conf['path'] = '\"/var/jail/$name\"'\n \nThe string should be exactly what you want to appear on the right side of the\nparameter name in the configuration file.\nIf you want the value of a parameter to be a quoted string, you pass\na string containing a quoted string.\nThis allows you to specify what kind of quotes you want to see in the output configuration \nfile (single quotes, double quotes, or no quote at all).\n\n.. code:: python\n \n conf['exec.start'] = '\"/bin/sh /etc/rc\"'\n conf['exec.stop'] = '\"/bin/sh /etc/rc.shutdown\"'\n \nBoolean parameters. To obtain:\n\n.. code:: sh\n\n exec.clean;\n mount.devfs;\n\nyou write:\n\n.. code:: python\n \n conf['exec.clean'] = True\n conf['mount.devfs'] = True\n \nAdd a jail:\n\n.. code:: python\n \n conf['myjail'] = jailconf.JailBlock([\n ('host.hostname', '\"example.com\"'),\n ('ip4.addr', ['10.1.1.1', '10.1.1.2', '10.1.1.3']) \n ])\n \nModify a jail\n\n.. code:: python\n \n conf['myjail']['ip4.addr'] = '192.168.1.2' # this will be rendered as the line: ip4.addr = 192.168.1.2\n \n # To set multiple ips, use a list:\n \n conf['myjail']['ip4.addr'] = ['192.168.1.2', '192.168.1.3']\n \nDelete a jail\n\n.. code:: python\n \n del conf['uselessjail']\n \nIterate over jails\n\n.. code:: python\n \n for name, jail_block in conf.jails():\n jail_block['host.hostname'] = '\"%s\"' % name\n \nOutput the configuration as a string\n\n.. code:: python\n \n >>> print(conf.dumps())\n\n.. code::\n\n path = \"/var/jail/$name\";\n exec.start = \"/bin/sh /etc/rc\";\n exec.stop = \"/bin/sh /etc/rc.shutdown\";\n exec.clean;\n mount.devfs;\n myjail {\n\t host.hostname = \"myjail\";\n\t ip4.addr = 192.168.1.2, 192.168.1.3;\n }\n \nWrite the configuration to a file\n\n.. code:: python\n \n conf.write('/etc/jail.conf')\n\n\nGitHub repo: https://github.com/leforestier/jailconf\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/leforestier/jailconf", "keywords": "jail.conf", "license": "", "maintainer": "", "maintainer_email": "", "name": "jailconf", "package_url": "https://pypi.org/project/jailconf/", "platform": "", "project_url": "https://pypi.org/project/jailconf/", "project_urls": { "Homepage": "https://github.com/leforestier/jailconf" }, "release_url": "https://pypi.org/project/jailconf/0.2.1/", "requires_dist": null, "requires_python": "", "summary": "Parse and edit your FreeBSD jail.conf file", "version": "0.2.1" }, "last_serial": 5425818, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "3d876f6fa152230cf58a0ac48f9094e3", "sha256": "233253b32c208283cc037a59ed7f30298d97651fc14ff94ec759448b81600eeb" }, "downloads": -1, "filename": "jailconf-0.1.0.tar.gz", "has_sig": false, "md5_digest": "3d876f6fa152230cf58a0ac48f9094e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4960, "upload_time": "2017-05-18T14:49:58", "url": "https://files.pythonhosted.org/packages/87/12/36bcb8872588d0f9f3ff4775c0b2e0d3b5719d11f43bdc888d2256a5563d/jailconf-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "faeda56b838875141a2c8a250c7a0642", "sha256": "98ac5cc6f806dfef3c1b4678e9b5ff07838eb80c8a4569c6bcc0d19940f5c740" }, "downloads": -1, "filename": "jailconf-0.2.0.tar.gz", "has_sig": false, "md5_digest": "faeda56b838875141a2c8a250c7a0642", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5325, "upload_time": "2017-05-20T12:40:15", "url": "https://files.pythonhosted.org/packages/5e/18/ed199e9b4f6caddeeeb24a78bd3a0531fe2a70c3f791a09b289468f9a111/jailconf-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "b85acb046b98783bd82200c866a2ba57", "sha256": "ac2ca09a5f07dca7b7dcc421363a732f7dd7c214bf2f34dda9f59ba8c1d1f49a" }, "downloads": -1, "filename": "jailconf-0.2.1.tar.gz", "has_sig": false, "md5_digest": "b85acb046b98783bd82200c866a2ba57", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5314, "upload_time": "2019-06-20T12:56:00", "url": "https://files.pythonhosted.org/packages/c1/9d/16450b3306eca97b5d15ccd96fa7096c5e5aff90552aef39d90079289039/jailconf-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b85acb046b98783bd82200c866a2ba57", "sha256": "ac2ca09a5f07dca7b7dcc421363a732f7dd7c214bf2f34dda9f59ba8c1d1f49a" }, "downloads": -1, "filename": "jailconf-0.2.1.tar.gz", "has_sig": false, "md5_digest": "b85acb046b98783bd82200c866a2ba57", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5314, "upload_time": "2019-06-20T12:56:00", "url": "https://files.pythonhosted.org/packages/c1/9d/16450b3306eca97b5d15ccd96fa7096c5e5aff90552aef39d90079289039/jailconf-0.2.1.tar.gz" } ] }