cs.app.portfwd


Namecs.app.portfwd JSON
Version 20221228 PyPI version JSON
download
home_pagehttps://bitbucket.org/cameron_simpson/css/commits/all
SummaryManage persistent ssh tunnels and port forwards.
upload_time2022-12-28 01:48:52
maintainer
docs_urlNone
authorCameron Simpson
requires_python
licenseGNU General Public License v3 or later (GPLv3+)
keywords python2 python3
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Manage persistent ssh tunnels and port forwards.

*Latest release 20221228*:
get_ssh_options: be quiet.

Portfwd runs a collection of ssh tunnel commands persistently,
each in its own `cs.app.svcd <https://pypi.org/project/cs.app.svcd>`_ instance
with all the visibility and process control that SvcD brings.

It reads tunnel preconditions from special comments within the ssh config file.
It uses the configuration options from the config file
as the SvcD signature function
thus restarting particular ssh tunnels when their specific configuration changes.
It has an "automatic" mode (the -A option)
which monitors the desired list of tunnels
from statuses expressed via `cs.app.flag <https://pypi.org/project/cs.app.flag>`_
which allows live addition or removal of tunnels as needed.

## Function `Condition(portfwd, op, invert, *args)`

Factory to construct a condition from a specification.

## Class `FlagCondition(_PortfwdCondition)`

A flag based condition.

## Function `main(argv=None, environ=None)`

Command line main programme.

## Class `PingCondition(_PortfwdCondition)`

A ping based condition.

## Class `Portfwd(cs.app.flag.FlaggedMixin)`

An ssh tunnel built on a SvcD.

*Method `Portfwd.__init__(self, target, ssh_config=None, conditions=(), test_shcmd=None, trace=False, verbose=False, flags=None)`*:
Initialise the Portfwd.

Parameters:
* `target`: the tunnel name, and also the name of the ssh configuration used
* `ssh_config`: ssh configuration file if not the default
* `conditions`: an iterable of `Condition`s
  which must hold before the tunnel is set up;
  the tunnel also aborts if these cease to hold
* `test_shcmd`: a shell command which must succeed
  before the tunnel is set up;
  the tunnel also aborts if this command subsequently fails
* `trace`: issue tracing messages; default `False`
* `verbose`: be verbose; default `False`
* `flags`: optional preexisting `Flags` instance

## Class `Portfwds`

A collection of `Portfwd` instances and associated control methods.

*Method `Portfwds.__init__(self, ssh_config=None, environ=None, target_list=None, auto_mode=None, trace=False, verbose=False, flags=None)`*:
Initialise the `Portfwds` instance.

Parameters:
* `ssh_config`: the ssh configuration file if not the default
* `environ`: the environment mapping to use;
  default: `os.environ`
* `target_list`: an iterable of `Portfwd` target names
* `auto_mode`: also derive target names
  from the set of true `PORTFWD_`*name*`_AUTO` flags
* `trace`: trace mode, default `False`
* `verbose`: verbose mode, default `False`
* `flags`: the `cs.app.flags.Flags` instance to use,
  default is to construct a new one

# Release Log



*Release 20221228*:
get_ssh_options: be quiet.

*Release 20210316*:
* Portfwds: accept any iterable for target_list.
* Portability fix.

*Release 20190602*:
* Support alert groups.
* ssh_argv no longer a property in order to support `bare` param.
* New method `ssh_options` to wrap ssh_argv.
* Drop sig_func, use ssh_options instead.
* Remove local UNIX domain socket forward endpoints before starting ssh tunnel.
* Improve option parse.

*Release 20170906*:
Initial PyPI release.

            

Raw data

            {
    "_id": null,
    "home_page": "https://bitbucket.org/cameron_simpson/css/commits/all",
    "name": "cs.app.portfwd",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "python2,python3",
    "author": "Cameron Simpson",
    "author_email": "Cameron Simpson <cs@cskk.id.au>",
    "download_url": "https://files.pythonhosted.org/packages/0c/fe/5ee50de690e15fb44c709688e78879f6fc42f4a518a442277654d37d7524/cs.app.portfwd-20221228.tar.gz",
    "platform": null,
    "description": "Manage persistent ssh tunnels and port forwards.\n\n*Latest release 20221228*:\nget_ssh_options: be quiet.\n\nPortfwd runs a collection of ssh tunnel commands persistently,\neach in its own `cs.app.svcd <https://pypi.org/project/cs.app.svcd>`_ instance\nwith all the visibility and process control that SvcD brings.\n\nIt reads tunnel preconditions from special comments within the ssh config file.\nIt uses the configuration options from the config file\nas the SvcD signature function\nthus restarting particular ssh tunnels when their specific configuration changes.\nIt has an \"automatic\" mode (the -A option)\nwhich monitors the desired list of tunnels\nfrom statuses expressed via `cs.app.flag <https://pypi.org/project/cs.app.flag>`_\nwhich allows live addition or removal of tunnels as needed.\n\n## Function `Condition(portfwd, op, invert, *args)`\n\nFactory to construct a condition from a specification.\n\n## Class `FlagCondition(_PortfwdCondition)`\n\nA flag based condition.\n\n## Function `main(argv=None, environ=None)`\n\nCommand line main programme.\n\n## Class `PingCondition(_PortfwdCondition)`\n\nA ping based condition.\n\n## Class `Portfwd(cs.app.flag.FlaggedMixin)`\n\nAn ssh tunnel built on a SvcD.\n\n*Method `Portfwd.__init__(self, target, ssh_config=None, conditions=(), test_shcmd=None, trace=False, verbose=False, flags=None)`*:\nInitialise the Portfwd.\n\nParameters:\n* `target`: the tunnel name, and also the name of the ssh configuration used\n* `ssh_config`: ssh configuration file if not the default\n* `conditions`: an iterable of `Condition`s\n  which must hold before the tunnel is set up;\n  the tunnel also aborts if these cease to hold\n* `test_shcmd`: a shell command which must succeed\n  before the tunnel is set up;\n  the tunnel also aborts if this command subsequently fails\n* `trace`: issue tracing messages; default `False`\n* `verbose`: be verbose; default `False`\n* `flags`: optional preexisting `Flags` instance\n\n## Class `Portfwds`\n\nA collection of `Portfwd` instances and associated control methods.\n\n*Method `Portfwds.__init__(self, ssh_config=None, environ=None, target_list=None, auto_mode=None, trace=False, verbose=False, flags=None)`*:\nInitialise the `Portfwds` instance.\n\nParameters:\n* `ssh_config`: the ssh configuration file if not the default\n* `environ`: the environment mapping to use;\n  default: `os.environ`\n* `target_list`: an iterable of `Portfwd` target names\n* `auto_mode`: also derive target names\n  from the set of true `PORTFWD_`*name*`_AUTO` flags\n* `trace`: trace mode, default `False`\n* `verbose`: verbose mode, default `False`\n* `flags`: the `cs.app.flags.Flags` instance to use,\n  default is to construct a new one\n\n# Release Log\n\n\n\n*Release 20221228*:\nget_ssh_options: be quiet.\n\n*Release 20210316*:\n* Portfwds: accept any iterable for target_list.\n* Portability fix.\n\n*Release 20190602*:\n* Support alert groups.\n* ssh_argv no longer a property in order to support `bare` param.\n* New method `ssh_options` to wrap ssh_argv.\n* Drop sig_func, use ssh_options instead.\n* Remove local UNIX domain socket forward endpoints before starting ssh tunnel.\n* Improve option parse.\n\n*Release 20170906*:\nInitial PyPI release.\n",
    "bugtrack_url": null,
    "license": "GNU General Public License v3 or later (GPLv3+)",
    "summary": "Manage persistent ssh tunnels and port forwards.",
    "version": "20221228",
    "split_keywords": [
        "python2",
        "python3"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "0106a0b0af9f2a17baa65eb8813011c3",
                "sha256": "611d5885593e05e98484957fffeaca43f962b8ec91bd25d445d562dce7ad0dfc"
            },
            "downloads": -1,
            "filename": "cs.app.portfwd-20221228-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0106a0b0af9f2a17baa65eb8813011c3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 9584,
            "upload_time": "2022-12-28T01:48:50",
            "upload_time_iso_8601": "2022-12-28T01:48:50.800798Z",
            "url": "https://files.pythonhosted.org/packages/9a/39/13b0922efa68c44826d4d27de521704f32e0f84beeae51a188cb5b96b477/cs.app.portfwd-20221228-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "94119fca1d705e460ecd2ecc31f80b9c",
                "sha256": "32eb8ea3619d333ef59aa85a190e4523eeca728f9eed66d13730dd31d2a2ddb2"
            },
            "downloads": -1,
            "filename": "cs.app.portfwd-20221228.tar.gz",
            "has_sig": false,
            "md5_digest": "94119fca1d705e460ecd2ecc31f80b9c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 10103,
            "upload_time": "2022-12-28T01:48:52",
            "upload_time_iso_8601": "2022-12-28T01:48:52.386526Z",
            "url": "https://files.pythonhosted.org/packages/0c/fe/5ee50de690e15fb44c709688e78879f6fc42f4a518a442277654d37d7524/cs.app.portfwd-20221228.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-28 01:48:52",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "cs.app.portfwd"
}
        
Elapsed time: 0.02298s