From 464650e6774863310bce63ada9dc94d8ddc4b4a8 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Mon, 31 Oct 2022 18:10:00 +0100 Subject: [PATCH 1/9] downgrade pyinstaller, fix #5699 (#5701) --- CHANGELOG.md | 4 +++- setup.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64d70370f..c9fb64e53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,9 @@ ## Unreleased: mitmproxy next -* Hard exit when mitmproxy cannot write logs, fixes endless loop when parent process exits +* Temporarily downgrade PyInstaller to fix standalone Linux binaries. + ([#5699](https://github.com/mitmproxy/mitmproxy/issues/5699), @mhils)) +* Hard exit when mitmproxy cannot write logs, fixes endless loop when parent process exits. ([#4669](https://github.com/mitmproxy/mitmproxy/issues/4669), @Prinzhorn)) diff --git a/setup.py b/setup.py index 3dd603556..eab22dead 100644 --- a/setup.py +++ b/setup.py @@ -108,7 +108,7 @@ setup( "hypothesis>=5.8,<7", "parver>=0.1,<2.0", "pdoc>=4.0.0", - "pyinstaller==5.6.1", + "pyinstaller==5.5", "pytest-asyncio>=0.17,<0.21", "pytest-cov>=2.7.1,<4.1", "pytest-timeout>=1.3.3,<2.2", From 597eaf41488027c95d51833efc56113a316d9742 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Mon, 31 Oct 2022 18:16:00 +0100 Subject: [PATCH 2/9] properly assume Docker permissions, fix #5700 (#5702) --- CHANGELOG.md | 2 ++ release/docker/docker-entrypoint.sh | 17 ++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9fb64e53..a9a2a3893 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ ([#5699](https://github.com/mitmproxy/mitmproxy/issues/5699), @mhils)) * Hard exit when mitmproxy cannot write logs, fixes endless loop when parent process exits. ([#4669](https://github.com/mitmproxy/mitmproxy/issues/4669), @Prinzhorn)) +* Fix an permission error affecting the Docker images. + ([#5700](https://github.com/mitmproxy/mitmproxy/issues/5700), @mhils)) ## 28 October 2022: mitmproxy 9.0.0 diff --git a/release/docker/docker-entrypoint.sh b/release/docker/docker-entrypoint.sh index 93449c066..0cf853da6 100755 --- a/release/docker/docker-entrypoint.sh +++ b/release/docker/docker-entrypoint.sh @@ -7,14 +7,17 @@ set -o nounset MITMPROXY_PATH="/home/mitmproxy/.mitmproxy" +if [ -f "$MITMPROXY_PATH/mitmproxy-ca.pem" ]; then + f="$MITMPROXY_PATH/mitmproxy-ca.pem" +else + f="$MITMPROXY_PATH" +fi +usermod -o \ + -u $(stat -c "%u" "$f") \ + -g $(stat -c "%g" "$f") \ + mitmproxy + if [[ "$1" = "mitmdump" || "$1" = "mitmproxy" || "$1" = "mitmweb" ]]; then - mkdir -p "$MITMPROXY_PATH" - if [ -f "$MITMPROXY_PATH/mitmproxy-ca.pem" ]; then - usermod -o \ - -u $(stat -c "%u" "$MITMPROXY_PATH/mitmproxy-ca.pem") \ - -g $(stat -c "%g" "$MITMPROXY_PATH/mitmproxy-ca.pem") \ - mitmproxy - fi gosu mitmproxy "$@" else exec "$@" From da6b04a47b07326507f95d9c74ec7fd2d806958f Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Tue, 1 Nov 2022 13:05:28 +0100 Subject: [PATCH 3/9] remove unnecessary parentheses --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9a2a3893..5af0babd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,11 +3,11 @@ ## Unreleased: mitmproxy next * Temporarily downgrade PyInstaller to fix standalone Linux binaries. - ([#5699](https://github.com/mitmproxy/mitmproxy/issues/5699), @mhils)) + ([#5699](https://github.com/mitmproxy/mitmproxy/issues/5699), @mhils) * Hard exit when mitmproxy cannot write logs, fixes endless loop when parent process exits. - ([#4669](https://github.com/mitmproxy/mitmproxy/issues/4669), @Prinzhorn)) -* Fix an permission error affecting the Docker images. - ([#5700](https://github.com/mitmproxy/mitmproxy/issues/5700), @mhils)) + ([#4669](https://github.com/mitmproxy/mitmproxy/issues/4669), @Prinzhorn) +* Fix a permission error affecting the Docker images. + ([#5700](https://github.com/mitmproxy/mitmproxy/issues/5700), @mhils) ## 28 October 2022: mitmproxy 9.0.0 From 3fe3d4f47a964b11ec33baef3ef62fa27581ed84 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Wed, 2 Nov 2022 00:49:47 +0000 Subject: [PATCH 4/9] update changelog, bump pyinstaller --- CHANGELOG.md | 5 ++++- setup.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5af0babd1..63f62de4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,10 @@ ## Unreleased: mitmproxy next -* Temporarily downgrade PyInstaller to fix standalone Linux binaries. +* The precompiled binaries now ship with OpenSSL 3.0.7, which resolves CVE-2022-3602 and CVE-2022-3786. +* Performance and stability improvements for WireGuard mode. + ([#5694](https://github.com/mitmproxy/mitmproxy/issues/5694), @mhils, @decathorpe) +* Fix a bug where the standalone Linux binaries would require libffi to be installed. ([#5699](https://github.com/mitmproxy/mitmproxy/issues/5699), @mhils) * Hard exit when mitmproxy cannot write logs, fixes endless loop when parent process exits. ([#4669](https://github.com/mitmproxy/mitmproxy/issues/4669), @Prinzhorn) diff --git a/setup.py b/setup.py index eab22dead..94ef426ed 100644 --- a/setup.py +++ b/setup.py @@ -108,7 +108,7 @@ setup( "hypothesis>=5.8,<7", "parver>=0.1,<2.0", "pdoc>=4.0.0", - "pyinstaller==5.5", + "pyinstaller==5.6.2", "pytest-asyncio>=0.17,<0.21", "pytest-cov>=2.7.1,<4.1", "pytest-timeout>=1.3.3,<2.2", From 5205d25a1665b938d70df6752a27a7137d94d114 Mon Sep 17 00:00:00 2001 From: mitmproxy release bot Date: Wed, 2 Nov 2022 11:13:57 +0000 Subject: [PATCH 5/9] mitmproxy 9.0.1 --- CHANGELOG.md | 4 ++++ mitmproxy/version.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63f62de4b..0edba889a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased: mitmproxy next + + +## 02 November 2022: mitmproxy 9.0.1 + * The precompiled binaries now ship with OpenSSL 3.0.7, which resolves CVE-2022-3602 and CVE-2022-3786. * Performance and stability improvements for WireGuard mode. ([#5694](https://github.com/mitmproxy/mitmproxy/issues/5694), @mhils, @decathorpe) diff --git a/mitmproxy/version.py b/mitmproxy/version.py index d1405ffe1..6a3372c66 100644 --- a/mitmproxy/version.py +++ b/mitmproxy/version.py @@ -2,7 +2,7 @@ import os import subprocess import sys -VERSION = "10.0.0.dev" +VERSION = "9.0.1" MITMPROXY = "mitmproxy " + VERSION # Serialization format version. This is displayed nowhere, it just needs to be incremented by one From 9da97d6db4877d2396f9bb9f01b1cd55f0ea9929 Mon Sep 17 00:00:00 2001 From: mitmproxy release bot Date: Wed, 2 Nov 2022 11:13:57 +0000 Subject: [PATCH 6/9] reopen main for development --- mitmproxy/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mitmproxy/version.py b/mitmproxy/version.py index 6a3372c66..d1405ffe1 100644 --- a/mitmproxy/version.py +++ b/mitmproxy/version.py @@ -2,7 +2,7 @@ import os import subprocess import sys -VERSION = "9.0.1" +VERSION = "10.0.0.dev" MITMPROXY = "mitmproxy " + VERSION # Serialization format version. This is displayed nowhere, it just needs to be incremented by one From cf27d0af732301b0f3c6f003025654f72eba8945 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Wed, 2 Nov 2022 11:40:24 +0000 Subject: [PATCH 7/9] add `mode` change to CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0edba889a..6b8b6af0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,12 @@ * Deprecate `mitmproxy.ctx.log` in favor of Python's builtin `logging` module. See [the docs](https://docs.mitmproxy.org/dev/addons-api-changelog/) for details and upgrade instructions. ([#5590](https://github.com/mitmproxy/mitmproxy/pull/5590), @mhils) + +### Breaking Changes + + * The `mode` option is now a list of server specs instead of a single spec. + The CLI interface is unaffected, but users may need to update their `config.yaml`. + ([#5393](https://github.com/mitmproxy/mitmproxy/pull/5393), @mhils) ### Full Changelog From c9ccd6f4b3917b33300d8d187bb7eee4d1a5b41e Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Thu, 3 Nov 2022 17:47:27 +0000 Subject: [PATCH 8/9] wireguard: create confdir on startup, fix #5715 --- mitmproxy/proxy/mode_servers.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mitmproxy/proxy/mode_servers.py b/mitmproxy/proxy/mode_servers.py index ca00d4389..b3ee87271 100644 --- a/mitmproxy/proxy/mode_servers.py +++ b/mitmproxy/proxy/mode_servers.py @@ -308,6 +308,7 @@ class WireGuardServerInstance(ServerInstance[mode_specs.WireGuardMode]): try: if not conf_path.exists(): + conf_path.parent.mkdir(parents=True, exist_ok=True) conf_path.write_text(json.dumps({ "server_key": wg.genkey(), "client_key": wg.genkey(), From 77ed92d26976c4f332d8383a7380606a1d4e09f2 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Thu, 3 Nov 2022 17:51:59 +0000 Subject: [PATCH 9/9] add WireGuard docs, fix #5706 --- mitmproxy/options.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mitmproxy/options.py b/mitmproxy/options.py index bf21823ab..4b2f0e9cd 100644 --- a/mitmproxy/options.py +++ b/mitmproxy/options.py @@ -103,8 +103,9 @@ class Options(optmanager.OptManager): The proxy server type(s) to spawn. Can be passed multiple times. Mitmproxy supports "regular" (HTTP), "transparent", "socks5", "reverse:SPEC", - and "upstream:SPEC" proxy servers. For reverse and upstream proxy modes, SPEC - is host specification in the form of "http[s]://host[:port]". + "upstream:SPEC", and "wireguard[:PATH]" proxy servers. For reverse and upstream proxy modes, SPEC + is host specification in the form of "http[s]://host[:port]". For WireGuard mode, PATH may point to + a file containing key material. If no such file exists, it will be created on startup. You may append `@listen_port` or `@listen_host:listen_port` to override `listen_host` or `listen_port` for a specific proxy mode. Features such as client playback will use the first mode to determine