Commit Graph

112 Commits

Author SHA1 Message Date
David Wilson fd5698c191 docs: 4kify images.
These commits were squashed to avoid repo size exploding.
2018-11-23 00:59:37 +00:00
David Wilson 8e4c164d93 issue #388: fix Sphinx markup 2018-11-02 15:14:00 +00:00
David Wilson 804bacdadb docs: move most remaining docstrings back into *.py; closes #388
The remaining ones are decorators which don't seem to have an autodoc
equivlent.
2018-11-02 15:14:00 +00:00
David Wilson a7ee23719a issue #388: move a ton of documentation back into the source 2018-11-01 11:54:22 +00:00
David Wilson fadb9181bc issue #410: support sudo --user and SELinux options, add stub test. 2018-10-31 15:46:59 +00:00
David Wilson 9ec360c26d core: split out & extend Broker.sync_call() 2018-10-26 13:58:12 +01:00
dw f3ee4011cc
Merge pull request #386 from moreati/doc-cleanups
Documentation cleanups
2018-10-03 00:34:49 +01:00
Alex Willmer bf34b383eb docs: Disambiguate references to Context
This addresses an error found while running tox -edocs

Warning, treated as error:
mitogen/docs/api.rst:469:more than one target found for cross-reference
u'Context': mitogen.core.Context, mitogen.parent.Context
2018-10-03 00:22:18 +01:00
David Wilson 4c81eba599 Merge commit 'refs/pull/377/head' of github.com:dw/mitogen into dmw
(Pull #377)

Changes:
- additional_parameters -> extra_args
- Merge with kubectl changes from dmw branch
- Update docs
- Remove unused username class member
- Avoid mutable kubectl_args class member
- Use six.iteritems
2018-10-02 20:00:00 +01:00
David Wilson f6b201bdfc docs: updates for #376 and #371 2018-10-02 19:19:30 +01:00
David Wilson dfc67b89fd docs: some more cleanups
- add faulthandler/thread stacks to changelog.
- various api.rst cleanups.
- docs: explain chain_id in howitworks.
2018-09-10 18:33:44 +01:00
David Wilson 2c0244eea7 docs: more tweaks 2018-09-09 23:51:48 +01:00
David Wilson 4d3873c784 core: call chains v3: abstract it into a new CallChain class. 2018-09-09 18:51:03 +01:00
David Wilson a3957d6aaf parent: add Context.forget_chain(). 2018-09-08 20:53:11 +01:00
David Wilson 42b1b3d286 core: support mitogen_chain dispatcher option. 2018-09-08 20:53:11 +01:00
David Wilson 7d62a53264 issue #337: ssh: disabling PTYs round 2: make it automatic. 2018-09-08 20:53:11 +01:00
David Wilson 5004207705 issue #337: ssh: support disabling PTY allocation
`.ssh(batch_mode=True)`
2018-09-08 20:53:11 +01:00
David Wilson 42f07466d2 setns: always assume a user identity, default to root.
Without this, an invocation like:

    sudo ansible-playbook foo.yml

Where foo.yml uses setns, could inherit the HOME environment variable
from the external non-root user, which broke /usr/bin/mysql_upgrade and
plenty more.
2018-09-08 20:53:11 +01:00
David Wilson c32b8d9728 docs: fix up doas documentation. 2018-09-08 20:53:11 +01:00
David Wilson bce4f59138 issue #345: disable IdentitiesOnly by default. 2018-08-19 22:13:30 +01:00
David Wilson 27b64a484b docs: document mitogen.core.CHUNK_SIZE. 2018-08-18 16:44:00 +01:00
David Wilson 442d88e3d7 docs: many more fixes/merges. 2018-08-18 16:44:00 +01:00
David Wilson a561fb79e5 docs: merge more docs back into mitogen/core.py. 2018-08-18 16:43:59 +01:00
David Wilson 81c8156965 Support LXD; closes #339. 2018-08-18 16:43:59 +01:00
David Wilson 196f76ff22 Remove staticmethod from docs.
Can re-add this later for 3.x, but it's pretty impossible in general for
2.x.

Closes #313.
2018-07-27 19:34:22 -07:00
David Wilson f977be2868 issue #291: permit supplying a full Python argv. 2018-07-22 16:24:42 -07:00
David Wilson 184104ce92 issue #303: add doas to the docs 2018-07-13 15:08:51 +01:00
David Wilson 0422a8c263 parent: python_path setting depends on local or remote
For local, we want to default to the same Python version as the current
process. For remote, we want whatever is on offer.
2018-07-07 14:55:47 +01:00
David Wilson 0eb77b5f7c utils: always enable microsecond logging.
It's too useful, and the logs are fairly out of control already, may as
well just capture everything in the first pass.
2018-07-07 14:55:47 +01:00
David Wilson 410016ff47 Initial Python 3.x port work.
* ansible: use unicode_literals everywhere since it only needs to be
  compatible back to 2.6.
* compat/collections.py: delete this entirely and rip out the parts of
  functools that require it.
* Introduce serializable Kwargs dict subclass that translates keys to
  Unicode on instantiation.
* enable_debug_logging() must set _v/_vv globals.
* cStringIO does not exist in 3.x.
* Treat IOLogger and LogForwarder input as latin-1.
* Avoid ResourceWarnings in first stage by explicitly closing fps.
* Fix preamble_size.py syntax errors.
2018-07-07 14:55:47 +01:00
David Wilson b58603c7a4 issue #278: ssh: support ssh_debug_level option and log TTY output.
Now debug logs may be captured all the way through the connection.
2018-06-22 16:30:51 +01:00
David Wilson 9e78c20eba core/parent: add Context.call_no_reply(). 2018-06-09 21:01:58 +01:00
David Wilson d2714752ee docs: tidy ups 2018-05-25 13:55:58 +01:00
David Wilson 61365236ad docs/select: fix up more references, fix headings. 2018-05-25 04:47:59 +01:00
David Wilson 4bf3d01104 select: add missing get(block=..) parameter. 2018-05-25 00:26:21 +01:00
David Wilson b0ce6eecd7 fork: support on_start= argument. 2018-05-23 16:25:17 +01:00
David Wilson 8a089e975d docs: Document Router.unidirectional. 2018-05-13 16:13:50 +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 3322eaef45 Basic "su" method. 2018-05-02 03:38:36 +01:00
David Wilson f5d22a3ca1 core: support deleting handlers, make Receiver.close() unregister 2018-04-29 19:41:23 +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 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 3196b6e7f7 Add FreeBSD jail support. 2018-04-27 06:14:52 +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 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 6670cba41c Introduce handler policy functions; closes #138.
Now you can specify a function to add_handler() that authenticates the
message header, with has_parent_authority() and is_immediate_child()
built in.
2018-03-29 21:40:33 +05:45
David Wilson 80a97fbc9b core: Rename Sender.put() to Sender.send().
Been annoying me for months.
2018-03-29 15:43:48 +05:45
David Wilson b48d63f33b docs: add to_sender() and update serialization notes 2018-03-29 15:38:44 +05:45