Merge pull request #3110 from cortesi/misc

Changelog, change meaning of --conf flag
This commit is contained in:
Aldo Cortesi 2018-05-12 10:43:48 +12:00 committed by GitHub
commit 30d11a5674
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 11 deletions

View File

@ -1,3 +1,30 @@
17 May 2018: mitmproxy 4.0
** Features **
* mitmproxy now requires Python 3.6!
* Moved the core to asyncio - which gives us a very significant performance boost!
* Reduce memory consumption by using `SO_KEEPALIVE` (#3076)
* Export request as httpie command (#3031)
* Configure mitmproxy console keybindings with the keys.yaml file. See docs for more.
** Breaking Changes **
* The --conf command-line flag is now --confdir, and specifies the mitmproxy configuration
directory, instead of the options yaml file (which is at `config.yaml` under the configuration directory).
* `allow_remote` got replaced by `block_global` and `block_private` (#3100)
* No more custom events (#3093)
* The `cadir` option has been renamed to `confdir`
* We no longer magically capture print statements in addons and translate
them to logs. Please use `ctx.log.info` explicitly.
** Bugfixes **
* Correctly block connections from remote clients with IPv4-mapped IPv6 client addresses (#3099)
* Expand `~` in paths during the `cut` command (#3078)
* Remove socket listen backlog constraint
* Improve handling of user script exceptions (#3050)
* Ignore signal errors on windows
* And lots of typos, docs improvements, revamped examples, and general fixes!
05 April 2018: mitmproxy 3.0.4 05 April 2018: mitmproxy 3.0.4
* Fix an issue that caused mitmproxy to not retry HTTP requests on timeout. * Fix an issue that caused mitmproxy to not retry HTTP requests on timeout.

View File

@ -1,3 +0,0 @@
graft mitmproxy
graft pathod
recursive-exclude * *.pyc *.pyo *.swo *.swp *.map

View File

@ -1,12 +1,8 @@
import argparse import argparse
import os
from mitmproxy.addons import core from mitmproxy.addons import core
CONFIG_PATH = os.path.join(core.CONF_DIR, "config.yaml")
def common_options(parser, opts): def common_options(parser, opts):
parser.add_argument( parser.add_argument(
'--version', '--version',
@ -25,10 +21,10 @@ def common_options(parser, opts):
help="Show all commands and their signatures", help="Show all commands and their signatures",
) )
parser.add_argument( parser.add_argument(
"--conf", "--confdir",
type=str, dest="conf", default=CONFIG_PATH, type=str, dest="confdir", default=core.CONF_DIR,
metavar="PATH", metavar="PATH",
help="Read options from a configuration file" help="Path to the mitmproxy config directory"
) )
parser.add_argument( parser.add_argument(
"--set", "--set",

View File

@ -23,6 +23,8 @@ from mitmproxy import proxy # noqa
from mitmproxy import log # noqa from mitmproxy import log # noqa
from mitmproxy.utils import debug, arg_check # noqa from mitmproxy.utils import debug, arg_check # noqa
OPTIONS_FILE_NAME = "config.yaml"
def assert_utf8_env(): def assert_utf8_env():
spec = "" spec = ""
@ -90,7 +92,11 @@ def run(
arg_check.check() arg_check.check()
sys.exit(1) sys.exit(1)
try: try:
unknown = optmanager.load_paths(opts, args.conf) opts.confdir = args.confdir
unknown = optmanager.load_paths(
opts,
os.path.join(opts.confdir, OPTIONS_FILE_NAME),
)
pconf = process_options(parser, opts, args) pconf = process_options(parser, opts, args)
server: typing.Any = None server: typing.Any = None
if pconf.options.server: if pconf.options.server: