{ "info": { "author": "Robert Lechte", "author_email": "robert.lechte@digital.gov.au", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython" ], "description": "tunneler: Connect to databases via ssh tunnel\n=============================================\n\nA command tool and library to connect to databases with minimal fuss.\n\nTo install:\n\n.. code-block:: shell\n\n $ pip install tunneler\n\nYou will probably also need the database drivers for your preferred database. To install the postgres ones automatically when you install ``tunneler``, do this:\n\n.. code-block:: shell\n\n $ pip install tunneler[pg]\n\nTo run:\n\n.. code-block:: shell\n\n $ tunneler name_of_task name_of_connection\n\nAs the above command shows, there are two concepts to understand when running tunneler, ``connections`` and ``tasks``.\n\nDefine connections in a ``connections.yaml`` file in your current directory, as follows:\n\n.. code-block:: yaml\n\n prod:\n remote_host: publicjumpboxservername\n ssh_username: username\n ssh_pkey: |\n -----BEGIN RSA PRIVATE KEY-----\n .......................................\n .......................................\n -----END RSA PRIVATE KEY-----\n private_dburl: postgres://username:password@privatedbservername/databasename\n local_port: 5433\n\n dev:\n .....\n\nYou can also specify an ssh_config variable in the config. ``tunneler`` will then use the values from that hosts ssh config. An example:\n\n.. code-block:: yaml\n\n prod:\n ssh_config: prod-jumpbox\n private_dburl: postgres://username:password@privatedbservername/databasename\n local_port: 5433\n\n dev:\n .....\n\nThis will use the remote host/username/private key specified in your existing ssh config so you don't need to repeat them in the config file\n\nTunneler will use this information to set up a local tunneled post where you can access this database directly.\n\nA connection URL to this local port will then be provided to each ``task``.\n\nThere are three inbuilt tasks:\n\n - test_connection (run this one to check your config is correct)\n - do_full_pg_dump (assumes you have pg_dump installed)\n - do_schema_pg_dump (also assumes you have pg_dump installed)\n\nSo for example to dump the production schema we'd run the following command:\n\n.. code-block:: shell\n\n $ tunneler do_schema_pg_dump prod\n\nCustom tasks\n------------\n\nWant to define your own tasks? Simply create a tasks.py file (or module) in the current directory.\n\nDefine a top level method in this file that accepts a connection url, and that method name will be available as a task.\n\nFor instance, the test connection task could be re-implemented as follows:\n\n.. code-block:: python\n\n from sqlbag import S\n\n def test_connection_custom(dburl):\n with S(dburl) as s:\n s.execute('select 1')\n\nYou'd then run this as follows:\n\n.. code-block:: shell\n\n $ tunneler test_connection_custom prod\n\nPretty simple.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/govau/tunneler", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "tunneler", "package_url": "https://pypi.org/project/tunneler/", "platform": "", "project_url": "https://pypi.org/project/tunneler/", "project_urls": { "Homepage": "https://github.com/govau/tunneler" }, "release_url": "https://pypi.org/project/tunneler/0.1.1490760674/", "requires_dist": null, "requires_python": "", "summary": "Connect to databases via ssh tunnel", "version": "0.1.1490760674" }, "last_serial": 2737853, "releases": { "0.1.1490665985": [ { "comment_text": "", "digests": { "md5": "76f321d5c6ee7b9b89aedd4628a9cc3f", "sha256": "e0296e850cc0ccc982e9a46b3f91da3e3c5c0544dc90e249108d74ef2cdd7145" }, "downloads": -1, "filename": "tunneler-0.1.1490665985-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "76f321d5c6ee7b9b89aedd4628a9cc3f", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 6863, "upload_time": "2017-03-28T04:56:45", "url": "https://files.pythonhosted.org/packages/2c/d7/5660766e13708cdf4cf807ab01c3b60e2f34ded34430426658f1e608101d/tunneler-0.1.1490665985-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a37817aae508e2996d2c74d531df2cde", "sha256": "f9c58289d0725cfdcf2822fce75315a838fedfb14aa948a3193039ce12f37ebc" }, "downloads": -1, "filename": "tunneler-0.1.1490665985.tar.gz", "has_sig": false, "md5_digest": "a37817aae508e2996d2c74d531df2cde", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3834, "upload_time": "2017-03-28T04:56:41", "url": "https://files.pythonhosted.org/packages/c0/4c/e6f38fbfe05a130c98680d22321d23d8a6679be83f1f7f8886a68373c9c7/tunneler-0.1.1490665985.tar.gz" } ], "0.1.1490677240": [ { "comment_text": "", "digests": { "md5": "2f3324421baac6c450b3c14c043fc30b", "sha256": "f4580ea3a85973c5ce54d800c9260d98605ccbe5fd546e587a665a07110e7919" }, "downloads": -1, "filename": "tunneler-0.1.1490677240-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2f3324421baac6c450b3c14c043fc30b", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 6877, "upload_time": "2017-03-28T05:02:00", "url": "https://files.pythonhosted.org/packages/60/23/6c5289571bc42b5dcca5813a873f3648dfb07e0745db1de8933876aaed1c/tunneler-0.1.1490677240-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "aab54daaaf2bd923419a499bab56b64a", "sha256": "d957e79286b738f3142a9346f803114d758df47b83a08df0fab20880a7795ffc" }, "downloads": -1, "filename": "tunneler-0.1.1490677240.tar.gz", "has_sig": false, "md5_digest": "aab54daaaf2bd923419a499bab56b64a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3852, "upload_time": "2017-03-28T05:01:56", "url": "https://files.pythonhosted.org/packages/56/10/b80dedd6c5ce8d46bb069e0770b5b4e6e31bd5ab324f33c9d7fe1098443b/tunneler-0.1.1490677240.tar.gz" } ], "0.1.1490760674": [ { "comment_text": "", "digests": { "md5": "2ed9172a081f54290a4ee020a206fee5", "sha256": "5bc93dd2786f0cd4e61f6cbaedc92ffa83c45bbe0276862beb58344c1cb94f86" }, "downloads": -1, "filename": "tunneler-0.1.1490760674-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2ed9172a081f54290a4ee020a206fee5", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 7656, "upload_time": "2017-03-29T06:08:05", "url": "https://files.pythonhosted.org/packages/e4/33/b3ff64979e212877dad5fb9308c052295d18ea1e214d32dac2ea54da6a72/tunneler-0.1.1490760674-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "65490b5ad9a5675aa6578d1d1cfd43a8", "sha256": "15112345f167216891a9db4493ec298eab980558a47b48079614d4fb3fcec9d6" }, "downloads": -1, "filename": "tunneler-0.1.1490760674.tar.gz", "has_sig": false, "md5_digest": "65490b5ad9a5675aa6578d1d1cfd43a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4489, "upload_time": "2017-03-29T06:08:02", "url": "https://files.pythonhosted.org/packages/b1/6b/077a59c6532b948a4ccee815e52c93769e87c9a92e906c1ce8a707f3f536/tunneler-0.1.1490760674.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2ed9172a081f54290a4ee020a206fee5", "sha256": "5bc93dd2786f0cd4e61f6cbaedc92ffa83c45bbe0276862beb58344c1cb94f86" }, "downloads": -1, "filename": "tunneler-0.1.1490760674-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2ed9172a081f54290a4ee020a206fee5", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 7656, "upload_time": "2017-03-29T06:08:05", "url": "https://files.pythonhosted.org/packages/e4/33/b3ff64979e212877dad5fb9308c052295d18ea1e214d32dac2ea54da6a72/tunneler-0.1.1490760674-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "65490b5ad9a5675aa6578d1d1cfd43a8", "sha256": "15112345f167216891a9db4493ec298eab980558a47b48079614d4fb3fcec9d6" }, "downloads": -1, "filename": "tunneler-0.1.1490760674.tar.gz", "has_sig": false, "md5_digest": "65490b5ad9a5675aa6578d1d1cfd43a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4489, "upload_time": "2017-03-29T06:08:02", "url": "https://files.pythonhosted.org/packages/b1/6b/077a59c6532b948a4ccee815e52c93769e87c9a92e906c1ce8a707f3f536/tunneler-0.1.1490760674.tar.gz" } ] }