Commit Graph

10273 Commits

Author SHA1 Message Date
Maximilian Hils 46bfb35488 drop support for Python 3.9 2023-02-27 08:37:11 +01:00
WenzelTian 5259d1e31a
add the architecture determination when running the wireguard test (#5953) 2023-02-26 15:25:10 +01:00
James O'Claire 01c1090ec1
Was pointing to issue on archived mitmweb issue, instead point to active mitmproxy issue (#5951) 2023-02-25 10:29:26 +01:00
Maximilian Hils 244ff35e60
fix usage of `asyncio.create_task` (#5928)
this fixes #5926
2023-02-13 21:45:02 +00:00
Jurrie Overgoor 7e3380e628
Add a section on using Magisk and Magisk modules in the Android howto (#5924)
* Add a section on using Magisk and Magisk modules in the Android howto

This allows you to use Google Play builds with mitmproxy.

* [autofix.ci] apply automated fixes

* Explain how to get the Magisk module from mitmweb

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-02-13 17:07:24 +01:00
konradh 09a83a89b2
console: fix bug that caused wrong direction indicators in message stream flow view (#5923) 2023-02-10 14:22:05 +01:00
Maksym Medvied 5969f25db4
pass signals to mitmproxy in docker-entrypoint.sh (#5920)
Current docker-entrypoint.sh [0][1] runs

    gosu mitmproxy "$@"

for mitmproxy, mitmdump and mitmweb. There is a problem with this
approach: bash becomes a parent process for mitmproxy [2][3], but when
signals are sent by docker-compose to mitmproxy container they are sent
to bash, but they are not delivered to mitmproxy [4]. This leads to a
slow shutdown of the container, because by default docker sends SIGTERM,
waits for 10 seconds and then sends SIGKILL if the container is still
alive [5].

This patch solves the issue by replacing bash process with mitmproxy
entirely using "exec" - this way the signals are delivered to mitmproxy
directly.

To test the patch a Dockerfile [6] that applies the patch to the release
image from the dockerhub could be used along with slighly modified
compose.yml [7]. With the patch bash is no longer running inside the
container [8] and the `docker compose down` time on my machine drops
from 10.3s to 0.5s [9].

0. https://github.com/mitmproxy/mitmproxy/blob/main/release/docker/docker-entrypoint.sh
1. To confirm that this is what's actually in the image:
    ```
    > docker run mitmproxy/mitmproxy grep gosu /usr/local/bin/docker-entrypoint.sh
      gosu mitmproxy "$@"
    ```
2. compose.yaml
    ```
    services:
      mitmproxy-test:
        image: mitmproxy/mitmproxy
        command: ["mitmweb"]
        # https://github.com/mitmproxy/mitmproxy/issues/5727
        stdin_open: true
        tty: true
    ```
3. We can see that the parent PID for mitmweb is the pid of bash.
    ```
    > docker compose up -d
    [+] Running 2/2
     ⠿ Network mitmproxy_default             Created           0.1s
     ⠿ Container mitmproxy-mitmproxy-test-1  Started           0.5s
    > docker compose top
    mitmproxy-mitmproxy-test-1
    UID    PID     PPID    C    STIME   TTY     TIME       CMD
    root   31227   31202   0    16:12   pts/0   00:00:00   /bin/bash /usr/local/bin/docker-entrypoint.sh mitmweb
    root   31314   31227   1    16:12   pts/0   00:00:01   /usr/local/bin/python /usr/local/bin/mitmweb
    ```
4. https://unix.stackexchange.com/a/196053
5. https://docs.docker.com/compose/faq/#why-do-my-services-take-10-seconds-to-recreate-or-stop
6. Dockerfile:
    ```
    FROM mitmproxy/mitmproxy

    RUN sed -i 's/^  gosu mitmproxy/  exec gosu mitmproxy/' /usr/local/bin/docker-entrypoint.sh
    ```
7. compose.yaml to build an image from Dockerfile and use it:
    ```
    services:
      mitmproxy-test:
        build:
          dockerfile: Dockerfile
          context: .
        command: ["mitmweb"]
        # https://github.com/mitmproxy/mitmproxy/issues/5727
        stdin_open: true
        tty: true
    ```
8. With the patch:
    ```
    > docker compose top
    mitmproxy-mitmproxy-test-1
    UID    PID    PPID   C    STIME   TTY     TIME       CMD
    root   4994   4970   50   17:00   pts/0   00:00:02   /usr/local/bin/python /usr/local/bin/mitmweb
     ```
9. Without the patch:
    ```
    > docker compose down
    [+] Running 2/2
     ⠿ Container mitmproxy-mitmproxy-test-1  Removed          10.2s
     ⠿ Network mitmproxy_default             Removed           0.1s
    ```
   With the patch:
    ```
    > docker compose down
    [+] Running 2/2
     ⠿ Container mitmproxy-mitmproxy-test-1  Removed           0.4s
     ⠿ Network mitmproxy_default             Removed           0.1s
    ```
2023-02-09 11:43:47 +01:00
Pradyot Ranjan 41555edab9
Reformatted list (#5919)
* Reformatted list

* [autofix.ci] apply automated fixes

* Reformatted list

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-02-09 11:38:27 +01:00
Maximilian Hils 8f78052493
update to mypy 1.0 (#5918) 2023-02-07 10:35:11 +00:00
Maximilian Hils 7da3a8e871
treat multipart as bytes, not str. fixes #5148 (#5917) 2023-02-07 10:29:08 +00:00
Xiao Wang 430833e3d9
Fix server addr issue in tls_passthrough example. (#5904)
* fix server peername is None issue

peername would be None, we should use other not None property as key.

* Update tls_passthrough.py

---------

Co-authored-by: Maximilian Hils <github@maximilianhils.com>
2023-02-07 09:57:24 +01:00
Sujal Singh b9f3574728
fix `Host` and `:authority` header not being updated on changes to host or port (#5908)
* fix map remote addon not setting `Host` header correctly

* fix failing tests

* fix coverage

* fix host and authority headers

* raise error when port is not of type int

* fix nits

* [autofix.ci] apply automated fixes

* coverage++

---------

Co-authored-by: Maximilian Hils <git@maximilianhils.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-02-06 17:35:16 +01:00
Maximilian Hils 54185c2c8d
Add experimental Windows OS proxy mode (#5912)
* add experimental Windows OS proxy mode

this is merely a proof-of-concept now, but works under the most ideal circumstances.
2023-02-06 17:34:48 +01:00
Maximilian Hils a7e50c793e
mitmproxy-wireguard -> mitmproxy_rs (#5909)
mitmproxy-rs includes all the fantastic WireGuard work,
but will add more non-WireGuard stuff. :)
2023-02-04 22:28:15 +01:00
Maximilian Hils 977385ceab
docs: `Server.peername` may be None, refs #5904 2023-02-04 01:01:01 +01:00
dependabot[bot] dfeddcf4ad
Bump install-pinned/black from 9101a4d68e870eaaaae21c412d1d879b93c9afcb to 13c8a20eb904ba800c87f0b34ccfd932ac2ff81d (#5899)
* Bump install-pinned/black

Bumps [install-pinned/black](https://github.com/install-pinned/black) from 9101a4d68e870eaaaae21c412d1d879b93c9afcb to 13c8a20eb904ba800c87f0b34ccfd932ac2ff81d.
- [Release notes](https://github.com/install-pinned/black/releases)
- [Commits](9101a4d68e...13c8a20eb9)

---
updated-dependencies:
- dependency-name: install-pinned/black
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* [autofix.ci] apply automated fixes

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-02-01 23:08:09 +00:00
dependabot[bot] 317b7a2be2
Bump install-pinned/yesqa (#5903)
Bumps [install-pinned/yesqa](https://github.com/install-pinned/yesqa) from a1262fbe567d4c0b3445afade67b90f3bba2c9a2 to 4af1e53e86a56db346a03ece9e89c19bfd0e5d0e.
- [Release notes](https://github.com/install-pinned/yesqa/releases)
- [Commits](a1262fbe56...4af1e53e86)

---
updated-dependencies:
- dependency-name: install-pinned/yesqa
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-01 22:20:13 +00:00
dependabot[bot] 985a77e77d
Bump install-pinned/reorder_python_imports (#5901)
Bumps [install-pinned/reorder_python_imports](https://github.com/install-pinned/reorder_python_imports) from 515035fd9eb355713f61dee238b17a04ce01f4d2 to 946c8bbd8fe048a3bee76063c90c938d5a59a9aa.
- [Release notes](https://github.com/install-pinned/reorder_python_imports/releases)
- [Commits](515035fd9e...946c8bbd8f)

---
updated-dependencies:
- dependency-name: install-pinned/reorder_python_imports
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-01 22:18:07 +00:00
dependabot[bot] 5859d998f3
Bump docker/setup-buildx-action (#5902)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 165fe681b849eec43aaa64d786b9ec53e690475f to 11e8a2e2910826a92412015c515187a2d6750279.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](165fe681b8...11e8a2e291)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-01 22:18:02 +00:00
dependabot[bot] 8683f8392c
Bump install-pinned/autoflake (#5900)
Bumps [install-pinned/autoflake](https://github.com/install-pinned/autoflake) from 1a248450153f02b75d051acf6c2a05df8c797666 to 19ecc14a8688d57cca9dc6cfd705f16f200ff097.
- [Release notes](https://github.com/install-pinned/autoflake/releases)
- [Commits](1a24845015...19ecc14a86)

---
updated-dependencies:
- dependency-name: install-pinned/autoflake
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-01 22:14:05 +00:00
Sujal Singh 89d688e9fc
temporary fix for unhandled AlternativeServiceAvailable event (#5898)
* temporary fix for unhandled AlternativeServiceAvailable event

* [autofix.ci] apply automated fixes

* better log message for AlternativeServiceAvailable service

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-02-01 18:05:09 +01:00
Sujal Singh e3a7941913
add delete shortcut to delete flows in mitmweb (#5896) 2023-01-30 13:59:21 +01:00
stephenspol 849a3c33cb
Removed escaping string to get real raw view (#5894)
* Removed escaping string to get real raw view

* [autofix.ci] apply automated fixes

* Updated changelog

* extend tests

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2023-01-29 10:56:39 +00:00
Maximilian Hils 0c4549f4cc
fix lint errors 2023-01-25 02:15:48 +01:00
Maximilian Hils 83c57dc53e
fix `timestamp_start` docstring, refs #5884 2023-01-25 01:40:48 +01:00
Sujal Singh 4ebccfa236
add fedora certificate installation instructions (#5885) 2023-01-19 10:43:39 +01:00
Sean Flanigan 5df439b7e8
Add enhancements for contrib/mitmproxywrapper.py (#5883)
* Add options for mitmweb and random port

* Clean up proxy settings on ^C

* [autofix.ci] apply automated fixes

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-01-18 09:02:04 +01:00
Maximilian Hils 121368654f
Adopt Dependabot (#5879) 2023-01-15 22:31:10 +00:00
Maximilian Hils 3cdb8efc5e add all-greens 2023-01-15 23:22:11 +01:00
Maximilian Hils f0fbaf3bd8 use reusable tox workflow 2023-01-15 23:22:11 +01:00
Maximilian Hils 3b35b5d675
clarify license for vendored code (#5872) 2023-01-15 17:13:48 +00:00
Maximilian Hils 8801bdd28b
urwid -> urwid-mitmproxy (#5871) 2023-01-15 16:46:55 +00:00
Maximilian Hils 47e0695069
Remove workaround for tornado 6.1 (#5870)
* remove workaround for tornado 6.1

* remove patch references
2023-01-15 17:36:32 +01:00
Sean Flanigan 2bf96678ae
Adapt contrib/mitmproxywrapper.py to Python 3 strings (#5866)
* Adapt mitmproxywrapper.py to Python 3 strings

This fixes errors like this one: 

`TypeError: memoryview: a bytes-like object is required, not 'str'`

* [autofix.ci] apply automated fixes

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-01-13 10:04:13 +01:00
Bernhard M. Wiedemann d06afcc1f9
Fix tests after 2037 (#5852)
Background:
As part of my work on reproducible builds for openSUSE, I check that software still gives identical build results in the future.
The usual offset is +16 years, because that is how long I expect some software will be used in some places.
This showed up failing tests in our package build.
See https://reproducible-builds.org/ for why this matters.
2023-01-06 22:37:55 +01:00
Igor Talankin 385633874c
Added a command for appending flows to server replay list (#5851)
* Added a command to append flows to replay server list

* Added changelog entry for `replay.server.add`

* Update CHANGELOG.md

Co-authored-by: Maximilian Hils <github@maximilianhils.com>
2023-01-06 15:49:54 +00:00
dependabot[bot] e3f5897400
Bump install-pinned/pyupgrade from 847ef2b8aa35a3817372540b887f4130d864d6b7 to 423622e7c2088eeba495a591385ec22074284f90 (#5840)
* Bump install-pinned/pyupgrade

Bumps [install-pinned/pyupgrade](https://github.com/install-pinned/pyupgrade) from 847ef2b8aa35a3817372540b887f4130d864d6b7 to 423622e7c2088eeba495a591385ec22074284f90.
- [Release notes](https://github.com/install-pinned/pyupgrade/releases)
- [Commits](847ef2b8aa...423622e7c2)

---
updated-dependencies:
- dependency-name: install-pinned/pyupgrade
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* [autofix.ci] apply automated fixes

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-01-02 22:23:55 +01:00
dependabot[bot] e640fdfa23
Bump install-pinned/reorder_python_imports (#5842)
Bumps [install-pinned/reorder_python_imports](https://github.com/install-pinned/reorder_python_imports) from 7365755886d8ef6679e1b77457975a8698842af6 to 515035fd9eb355713f61dee238b17a04ce01f4d2.
- [Release notes](https://github.com/install-pinned/reorder_python_imports/releases)
- [Commits](7365755886...515035fd9e)

---
updated-dependencies:
- dependency-name: install-pinned/reorder_python_imports
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-02 22:20:26 +01:00
dependabot[bot] 979e789928
Bump install-pinned/yesqa (#5841)
Bumps [install-pinned/yesqa](https://github.com/install-pinned/yesqa) from cf847492077eea907797bac45e68f87801d4de31 to a1262fbe567d4c0b3445afade67b90f3bba2c9a2.
- [Release notes](https://github.com/install-pinned/yesqa/releases)
- [Commits](cf84749207...a1262fbe56)

---
updated-dependencies:
- dependency-name: install-pinned/yesqa
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-02 22:20:14 +01:00
dependabot[bot] f0650a6694
Bump install-pinned/black (#5839)
Bumps [install-pinned/black](https://github.com/install-pinned/black) from 70a27391ba5875c09596f067be1e331d0e81947b to bcf144213c4943c1f2078a257fa566cebec36107.
- [Release notes](https://github.com/install-pinned/black/releases)
- [Commits](70a27391ba...bcf144213c)

---
updated-dependencies:
- dependency-name: install-pinned/black
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-02 22:20:05 +01:00
Maximilian Hils 2a3eca2589
use latest codecov uploader (#5845) 2023-01-02 22:13:12 +01:00
gpiechnik2 12960c0494
har: don't set `pages` 2022-12-17 14:32:38 +01:00
Maximilian Hils 1536e537ad
readme: fix nits 2022-12-15 17:50:43 +01:00
Sabin Dcoster bbb5080e98
Add loop as a parameter in DumpMaster (#5790)
* Add loop as a parameter in DumpMaster

* [autofix.ci] apply automated fixes

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2022-12-03 16:33:36 +00:00
dependabot[bot] 689ca0c1b5
Bump install-pinned/autoflake (#5785)
Bumps [install-pinned/autoflake](https://github.com/install-pinned/autoflake) from 32877f5112ce1c5b8b30cf57d70593a53d5fca87 to 95c53f821b204037c1be14d45d810032e8ddfdcb.
- [Release notes](https://github.com/install-pinned/autoflake/releases)
- [Commits](32877f5112...95c53f821b)

---
updated-dependencies:
- dependency-name: install-pinned/autoflake
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-02 09:43:41 +01:00
dependabot[bot] 4099822e49
Bump install-pinned/black (#5784)
Bumps [install-pinned/black](https://github.com/install-pinned/black) from dde5aed720bc458e86d99144d4d0c1f6c8e08844 to 70a27391ba5875c09596f067be1e331d0e81947b.
- [Release notes](https://github.com/install-pinned/black/releases)
- [Commits](dde5aed720...70a27391ba)

---
updated-dependencies:
- dependency-name: install-pinned/black
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-02 09:43:31 +01:00
dependabot[bot] daa703c740
Bump TrueBrain/actions-flake8 from 2.1 to 2.2 (#5783)
Bumps [TrueBrain/actions-flake8](https://github.com/TrueBrain/actions-flake8) from 2.1 to 2.2.
- [Release notes](https://github.com/TrueBrain/actions-flake8/releases)
- [Commits](c2deca24d3...c120815866)

---
updated-dependencies:
- dependency-name: TrueBrain/actions-flake8
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-02 09:43:17 +01:00
dependabot[bot] f3ba7ce33c
Bump install-pinned/reorder_python_imports (#5782)
Bumps [install-pinned/reorder_python_imports](https://github.com/install-pinned/reorder_python_imports) from 97c3e89c53ae5513cc41716e876e26daff8bbdd6 to 7365755886d8ef6679e1b77457975a8698842af6.
- [Release notes](https://github.com/install-pinned/reorder_python_imports/releases)
- [Commits](97c3e89c53...7365755886)

---
updated-dependencies:
- dependency-name: install-pinned/reorder_python_imports
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-02 09:43:01 +01:00
dependabot[bot] ef1a03181b
Bump install-pinned/yesqa (#5781)
Bumps [install-pinned/yesqa](https://github.com/install-pinned/yesqa) from b7b1c5e133f5f516905ae35645a082f751ffa216 to cf847492077eea907797bac45e68f87801d4de31.
- [Release notes](https://github.com/install-pinned/yesqa/releases)
- [Commits](b7b1c5e133...cf84749207)

---
updated-dependencies:
- dependency-name: install-pinned/yesqa
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-02 09:42:49 +01:00
dependabot[bot] 55f7193936
Bump docker/setup-qemu-action from 1.2.0 to 2.1.0 (#5768)
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 1.2.0 to 2.1.0.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](27d0a4f181...e81a89b173)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-29 14:09:41 +00:00