Commit Graph

280 Commits

Author SHA1 Message Date
David Wilson d1a22cb5d4 issue #186: parent: implement FORWARD_MODULE.
To support detach, we must be able to preload the target with every
module it will need prior to detachment. This implements the
intermediary part of the process (i.e. the Ansible fork parent) --
receiving LOAD_MODULE/FORWARD_MODULE pairs and ensuring they reach the
child.
2018-05-13 16:58:47 +01:00
David Wilson 8a089e975d docs: Document Router.unidirectional. 2018-05-13 16:13:50 +01:00
David Wilson 48535cc661 docs: more accurate bullet. 2018-05-08 04:28:39 +01:00
David Wilson d148e3db4e docs: move installation section above demo 2018-05-08 04:24:33 +01:00
David Wilson 9b761a2baf docs: initial contributors page 2018-05-06 08:33:07 +01:00
David Wilson cecef992b0 issue #218: core: add Secret and Blob types. 2018-05-04 21:34:11 +01:00
David Wilson 43e9e51ed6 docs: link signals into internals.rst. 2018-05-04 03:47:29 +01:00
David Wilson 3058efc80f docs: more updates.
- accurate description of Ansible timeouts
- rough detach() sketch
2018-05-03 17:37:24 +01:00
David Wilson 7f1060f54a issue #186: initial version of subtree detachment. 2018-05-03 01:11:14 +01:00
David Wilson 8fc1eac6ae utils: combine MITOGEN_LOG_LEVEL and MITOGEN_LOG_IO.
Saves lots of readline fiddling.
2018-05-02 20:35:17 +01:00
David Wilson f5238fe791 docs: update copyright 2018-05-02 20:03:00 +01:00
David Wilson d3fe24a4f6 docs: update connection delegation example 2018-05-02 18:58:10 +01:00
David Wilson 2ee727f5c0 docs: typos and clarifications 2018-05-02 18:44:34 +01:00
David Wilson 4d1c6d2101 issue #127: ssh: reasonable solution to host key checking.
Ideally it would be possible to specify a callback function, but this is
not possible for proxied connections. So simply provide the 3 most
useful modes, defaulting to the most secure.

Closes #127. Closes #134.
2018-05-02 17:47:06 +01:00
David Wilson 78c401ba4d ansible: support su become method. 2018-05-02 03:49:44 +01:00
David Wilson 3322eaef45 Basic "su" method. 2018-05-02 03:38:36 +01:00
David Wilson 187e3a3fc1 ansible: support 2.3 too. 2018-04-30 19:15:51 +01:00
David Wilson f5d22a3ca1 core: support deleting handlers, make Receiver.close() unregister 2018-04-29 19:41:23 +01:00
David Wilson 58eb9828b0 docs: remove limitation. 2018-04-29 19:35:43 +01:00
David Wilson ff7fb00569 parent: return latch to wait() caller to allow graceful timeout 2018-04-29 10:11:13 +01:00
David Wilson b0309b539c ansible: disable interpreter recycling for connections.
Must explicitly specify enable_lru=True in ContextService.get() to
trigger recycling.
2018-04-29 09:53:16 +01:00
David Wilson ec22fee7a7 docs: more ansible updates 2018-04-29 09:37:49 +01:00
David Wilson 79fd35092b docs: more links 2018-04-29 04:00:11 +01:00
David Wilson 65e6a44fe7 docs: add links. 2018-04-29 02:31:32 +01:00
David Wilson 29f6c46e97 docs: add file transfer safety section. 2018-04-29 02:14:29 +01:00
David Wilson bba2a42e44 ansible: add mitogen_sudo method, split out connection subclasses.
Slowly moving towards real implementations in those files.
2018-04-29 01:45:52 +01:00
David Wilson 7c5bbc5168 setns: support changing user.
To match existing third party plugin.
2018-04-29 00:38:53 +01:00
David Wilson 58d8f60f57 docs: better connection type docs 2018-04-28 21:36:51 +01:00
David Wilson e8b4c4e683 issue #223: implement setns connection type
machinectl does not support any sensible form of pipe to the child
process, so it is necessary to bypass it when talking to a systemd
container (see systemd/systemd#8850).

This can also form the basis for issue #223, where the post-fork
namespace switching dance required to connect to the Pythonless
container will be the same.
2018-04-28 06:41:34 +01:00
David Wilson 79c2d6c289 docs: links to Ansible docs 2018-04-27 06:50:03 +01:00
David Wilson 098995539d ansible: implement FreeBSD jail support. 2018-04-27 06:21:10 +01:00
David Wilson 3196b6e7f7 Add FreeBSD jail support. 2018-04-27 06:14:52 +01:00
David Wilson d8e71799e7 docs: typo 2018-04-27 05:01:59 +01:00
David Wilson b1563cd8c1 ansible: hijack lxd connections too. 2018-04-27 04:45:40 +01:00
David Wilson 131bc768c7 ansible: implement LXC support. 2018-04-27 04:40:56 +01:00
David Wilson b3d352c601 Add lxc container support. 2018-04-27 04:34:23 +01:00
David Wilson 1fc7df5be5 Move canonical library version to __init__.py. 2018-04-27 03:48:31 +01:00
David Wilson 6fb3a76e68 master: annotate LogForwarder messages.
mitogen/master.py:
    Annotate forwarded log entries with their original source, logger
    name, and message.

ansible:
    mark stderr in red with -vvv

    Tempting to make this appaer 100% of the time, but some crappy
    bashrcs may cause lots of junk to be printed.
2018-04-27 03:11:06 +01:00
David Wilson 9d0949eb99 docker: fixes & add username parameter. 2018-04-27 03:00:11 +01:00
David Wilson 823dea4bd0 docs: link ChangeLog. 2018-04-27 02:58:20 +01:00
David Wilson 02ce332b26 docs: show become_user example for connection delegation. 2018-04-27 01:40:17 +01:00
David Wilson 39f5aa76ae docs: add initial ChangeLog. 2018-04-27 01:33:07 +01:00
David Wilson 3ce6b36932 docs: major Ansible page update. 2018-04-27 01:32:51 +01:00
David Wilson d2345d11e9 docs: remove warning labels. 2018-04-22 02:53:14 +01:00
David Wilson 5913be64d7 docs: remove last remaining major risk :D 2018-04-22 02:50:04 +01:00
David Wilson 4c5e13bf87 core: add Stream.pending_bytes() accessor. 2018-04-22 02:17:09 +01:00
David Wilson 7c88e4d013 Move _DEAD into header, autogenerate dead messages
This change blocks off 2 common scenarios where a race condition is
upgraded to a hang, when the library could internally do better.

* Since we don't know whether the receiver of a `reply_to` is expecting
  a raw or pickled message, and since in the case of a raw reply, there
  is no way to signal "dead" to the receiver, override the reply_to
  field to explicitly mark a message as dead using a special handle.

  This replaces the serialized _DEAD sentinel value with a slightly
  neater interface, in the form of the reserved IS_DEAD handle, and
  enables an important subsequent change: when a context cannot route a
  message, it can send a generic 'dead' reply back towards the message
  source, ensuring any sleeping thread is woken with ChannelError.

  The use of this field could potentially be extended later on if
  additional flags are needed, but for now this seems to suffice.

* Teach Router._invoke() to reply with a dead message when it receives a
  message for an invalid local handle.

* Teach Router._async_route() to reply with a dead message when it
  receives an unroutable message.
2018-04-22 00:17:27 +01:00
David Wilson e43c6c531b Mostly implement hybrid TTY/socket mode for sudo and SSH.
Presently there is still no mechanism to add :attr:`tty_stream` to the
multiplexer after connection is successful, but for now it's not
expected that anything will be logged to it anyway.

Closes #148.
2018-04-18 21:40:24 +01:00
David Wilson 6aad45748b docs: typo 2018-04-13 15:18:30 +01:00
David Wilson 9f94fb78c8 issue #159: make LRU size configurable. 2018-04-13 15:16:54 +01:00