Commit Graph

246 Commits

Author SHA1 Message Date
Maximilian Hils 99aa0a70af
Docker: use latest python and debian (#7242)
* docker: use latest python and debian

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-13 18:21:57 +02:00
Jason S 4087b2105d
added chown for .mitmproxy volume (#7168)
* added chown for .mitmproxy volume

* corrected chown I think

* one more try, this time with some feeling
2024-09-09 14:08:03 +02:00
Maximilian Hils 1a547d2da8
CI: Deploy to GitHub Container Registry, streamline builds (#7061) 2024-07-29 18:11:41 +00:00
Maximilian Hils fcce334fce
Update README.md 2024-07-25 16:27:25 +02:00
Maximilian Hils b646b7ee9d
fixup release script 2024-07-05 17:54:55 +02:00
Maximilian Hils 249eb8c735
release script: add one less newline 2024-06-13 11:19:23 +02:00
Alexander Prinzhorn 14d5fa0474
Update PyInstaller spec to set the u (unbuffered) flag (#6821)
* Update PyInstaller spec to set the u (unbuffered) flag
* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-04-28 10:25:51 +02:00
Maximilian Hils 2c96c96e75
prefix version tags with 'v' (#6810) 2024-04-19 21:28:05 +02:00
dependabot[bot] a91989b7ba
Bump the github-actions group with 3 updates (#6701)
Bumps the github-actions group with 3 updates:
[install-pinned/ruff](https://github.com/install-pinned/ruff),
[apple-actions/import-codesign-certs](https://github.com/apple-actions/import-codesign-certs)
and
[docker/setup-buildx-action](https://github.com/docker/setup-buildx-action).

Updates `install-pinned/ruff` from
fe472defb50a6a2c00ea3a3982534e86e69991e8 to
38b373a3a8635c2be31d92314e816a491fda910a
<details>
<summary>Commits</summary>
<ul>
<li><a
href="38b373a3a8"><code>38b373a</code></a>
update README.md (ruff 0.3.0)</li>
<li><a
href="06af3ea1c3"><code>06af3ea</code></a>
update pins (ruff 0.3.0)</li>
<li><a
href="be1c354876"><code>be1c354</code></a>
update README.md (ruff 0.2.2)</li>
<li><a
href="c9779bbd5b"><code>c9779bb</code></a>
update pins (ruff 0.2.2)</li>
<li><a
href="48831a86ce"><code>48831a8</code></a>
update README.md (ruff 0.2.1)</li>
<li><a
href="6775b5f352"><code>6775b5f</code></a>
update pins (ruff 0.2.1)</li>
<li><a
href="bc12a64c2f"><code>bc12a64</code></a>
update README.md (ruff 0.2.0)</li>
<li><a
href="3b8cceff45"><code>3b8ccef</code></a>
update pins (ruff 0.2.0)</li>
<li>See full diff in <a
href="fe472defb5...38b373a3a8">compare
view</a></li>
</ul>
</details>
<br />

Updates `apple-actions/import-codesign-certs` from
5565bb656f60c98c8fc515f3444dd8db73545dc2 to
493007ed063995cf2d4fbca064704150548f8bb5
<details>
<summary>Commits</summary>
<ul>
<li><a
href="493007ed06"><code>493007e</code></a>
Merge pull request <a
href="https://redirect.github.com/apple-actions/import-codesign-certs/issues/62">#62</a>
from himself65/patch-1</li>
<li><a
href="2e5aa07267"><code>2e5aa07</code></a>
Update README.md</li>
<li>See full diff in <a
href="5565bb656f...493007ed06">compare
view</a></li>
</ul>
</details>
<br />

Updates `docker/setup-buildx-action` from 3.0.0 to 3.1.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/docker/setup-buildx-action/releases">docker/setup-buildx-action's
releases</a>.</em></p>
<blockquote>
<h2>v3.1.0</h2>
<ul>
<li><code>cache-binary</code> input to enable/disable caching binary to
GHA cache backend by <a
href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in <a
href="https://redirect.github.com/docker/setup-buildx-action/pull/300">docker/setup-buildx-action#300</a></li>
<li>build(deps): bump <code>@​babel/traverse</code> from 7.17.3 to
7.23.2 in <a
href="https://redirect.github.com/docker/setup-buildx-action/pull/282">docker/setup-buildx-action#282</a></li>
<li>build(deps): bump <code>@​docker/actions-toolkit</code> from 0.12.0
to 0.17.0 in <a
href="https://redirect.github.com/docker/setup-buildx-action/pull/281">docker/setup-buildx-action#281</a>
<a
href="https://redirect.github.com/docker/setup-buildx-action/pull/284">docker/setup-buildx-action#284</a>
<a
href="https://redirect.github.com/docker/setup-buildx-action/pull/299">docker/setup-buildx-action#299</a></li>
<li>build(deps): bump uuid from 9.0.0 to 9.0.1 in <a
href="https://redirect.github.com/docker/setup-buildx-action/pull/271">docker/setup-buildx-action#271</a></li>
<li>build(deps): bump undici from 5.26.3 to 5.28.3 in <a
href="https://redirect.github.com/docker/setup-buildx-action/pull/297">docker/setup-buildx-action#297</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/docker/setup-buildx-action/compare/v3.0.0...v3.1.0">https://github.com/docker/setup-buildx-action/compare/v3.0.0...v3.1.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="0d103c3126"><code>0d103c3</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/setup-buildx-action/issues/300">#300</a>
from crazy-max/cache-binary</li>
<li><a
href="f19477aacd"><code>f19477a</code></a>
chore: update generated content</li>
<li><a
href="a4180f835d"><code>a4180f8</code></a>
cache-binary input to enable/disable caching binary to GHA cache
backend</li>
<li><a
href="524315340d"><code>5243153</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/setup-buildx-action/issues/299">#299</a>
from docker/dependabot/npm_and_yarn/docker/actions-to...</li>
<li><a
href="3679a54023"><code>3679a54</code></a>
chore: update generated content</li>
<li><a
href="37a22a2fb2"><code>37a22a2</code></a>
build(deps): bump <code>@​docker/actions-toolkit</code> from 0.14.0 to
0.17.0</li>
<li><a
href="65afe610a1"><code>65afe61</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/setup-buildx-action/issues/297">#297</a>
from docker/dependabot/npm_and_yarn/undici-5.28.3</li>
<li><a
href="fcb8f722fd"><code>fcb8f72</code></a>
chore: update generated content</li>
<li><a
href="f62b9a17c0"><code>f62b9a1</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/setup-buildx-action/issues/298">#298</a>
from crazy-max/bump-gha</li>
<li><a
href="74c5b717e5"><code>74c5b71</code></a>
bump codecov/codecov-action from 3 to 4</li>
<li>Additional commits viewable in <a
href="f95db51fdd...0d103c3126">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

---------

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>
2024-03-06 21:54:11 +01:00
Maximilian Hils 6e38a56f4c
implement UDP streams (#6557)
based on https://github.com/mitmproxy/mitmproxy_rs/pull/127
2024-01-04 10:53:13 +01:00
Maximilian Hils e992d82f7d
unify download filenames (#6487)
refs https://github.com/mitmproxy/www/issues/57
2023-12-14 10:27:42 +01:00
Maximilian Hils 3828373e91
macOS: Use correct entitlements for binary distribution (#6480)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-11-13 13:52:55 +01:00
Maximilian Hils d6986d43cd
Update release/README.md 2023-11-04 12:29:59 +01:00
Maximilian Hils 3470473e4b
build macOS app bundle (#6447) 2023-11-03 11:21:55 +00:00
Maximilian Hils b331ac2520 ensure that we trigger the tag workflow 2023-08-04 11:23:44 +02:00
Maximilian Hils b14f9611f2
fix #6267 (#6270) 2023-07-20 10:45:43 +00:00
Maximilian Hils 1cb0cb1afd release ci: upload binaries to r2 2023-07-02 22:19:58 +02:00
Maximilian Hils 077c771ae9 installbuilder: use own mirror (#6173)
The official download server is notoriously unreliable, so we just host a copy now.
2023-06-14 14:29:08 +02:00
Vadim 2261346334
DockerHub-README.md: reword ambiguous command (#6080)
* DockerHub-README.md: reword ambiguous command

Being unfamiliar with the docker options, I thought the square brackets could be part of the command.

Instead, they refer to the sentence *after* the command, that is, they meant "optionally".

To remove the ambiguity, I put into onto different lines with an explanation.

* DockerHub-README.md: reword again, -v by default

- only leave the command with -v as an example
- grammar
- httpS link
2023-04-27 08:49:15 +00:00
Maximilian Hils c38c01fa4f
Switch to pyproject.toml (#6016)
* switch to pyproject.toml

* fix mypy

* fix pyinstaller
2023-03-26 17:40:32 +00:00
autofix-ci[bot] 51670861e6 [autofix.ci] apply automated fixes 2023-02-27 08:37:11 +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
autofix-ci[bot] 8c2428c9d3
[autofix.ci] apply automated fixes 2022-11-29 13:28:41 +00:00
Aldo Cortesi 0bbb0215c1
more mypy (#5724)
Co-authored-by: requires.io <support@requires.io>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2022-11-13 18:04:34 +00:00
Maximilian Hils f8bd7516cc unbreak docker ci 2022-11-10 17:28:45 +01:00
Maximilian Hils 3b8e1f6e2a skip self-test for console ui 2022-11-10 13:23:10 +01:00
Maximilian Hils 0ad8630487 add self-test addon for binaries 2022-11-04 10:41:46 +00:00
Maximilian Hils 597eaf4148
properly assume Docker permissions, fix #5700 (#5702) 2022-10-31 18:16:00 +01:00
Maximilian Hils f3f9df9b63
fix filenames, test final Windows installer (#5691) 2022-10-29 15:11:54 +00:00
Maximilian Hils 34b0600ef8
fix windows installer build (#5690) 2022-10-29 14:12:16 +00:00
Maximilian Hils 36dcc2ca0e
ci: simplify release script (#5688) 2022-10-28 17:02:12 +02:00
Maximilian Hils 8a79f61790 ci: fixup release permissions 2022-10-28 14:39:57 +02:00
Maximilian Hils 420d7f1cea ci: add option to skip status checks for releases 2022-10-28 14:39:57 +02:00
Maximilian Hils b5302ab522
Upgrade to Python 3.11 (#5678)
* upgrade to Python 3.11

* compatibility fixes
2022-10-26 11:13:37 +00:00
Maximilian Hils 58863cfb62
add more release automation (#5674) 2022-10-24 17:06:40 +02:00
Maximilian Hils 839115df8e
separate snapshot and release deploy jobs (#5669) 2022-10-22 14:09:44 +02:00
Maximilian Hils 8023b22498
Docker: assume uid of who holds permissions (#5550)
* Docker: assume uid of who holds permissions

* add docs
2022-09-08 17:42:09 +00:00
Manuel Meitinger e11626395e
Fix running hook issue and signal proxyserver updates. (#5512)
* add startup hook

* remove StartupHook

* add instance state reports

* make server stop log entries clearer

* fix default param issue

* add SyncSignal and AsyncSignal

* fix signal issues

* simpler update handling

* fix coverage

* minor change to better reflect server update state

* fix reuse tests on linux/wsl

* exterminate `mitmproxy.exceptions.TypeError`

Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2022-08-14 00:11:01 +02:00
Maximilian Hils 5df703cc42 ci: don't build installers for PRs 2022-07-29 13:42:42 +02:00
Maximilian Hils f94951c52f fix msix builds 2022-07-28 16:16:24 +02:00
Maximilian Hils 01254fd424 revise display names 2022-07-25 14:38:21 +02:00
Maximilian Hils 7a4fdb70e8 app manifest: remove optional port declarations 2022-07-25 14:14:05 +02:00
Maximilian Hils 3872d33111 simplify ci build script, add MSIX installer and Microsoft store. 2022-07-25 01:22:57 +02:00
Maximilian Hils 8ffd2dcaaa windows installer: use 64bit builds 2022-06-28 14:18:40 +02:00
Maximilian Hils 87d3d1cb88 pyinstaller: move hooks into package 2022-06-28 14:18:40 +02:00
Maximilian Hils b3587b52b2 make it black! 2022-04-28 19:11:10 +02:00
Maximilian Hils b31ad66225 `autoflake --in-place **/*.py` 2022-04-26 13:52:46 +02:00
Maximilian Hils 9d1e3107e8 `pyupgrade --keep-runtime-typing --py38-plus` 2022-03-29 15:29:37 +02:00
Maximilian Hils 7352811eef bump to 8.0.0 2022-03-19 17:20:32 +01:00
Maximilian Hils 218c942808 docker: use Python 3.10 2022-03-19 15:38:30 +01:00