Skip to content

Commit

Permalink
Merge branch 'mitmproxy:main' into multicast-windivert-exclude
Browse files Browse the repository at this point in the history
  • Loading branch information
Osherz5 authored Nov 6, 2024
2 parents cb9e0e7 + f6b796f commit fa22fdc
Show file tree
Hide file tree
Showing 73 changed files with 3,176 additions and 1,489 deletions.
27 changes: 27 additions & 0 deletions .github/scripts/release
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env -S python3 -u
import logging

from releasetool import branch
from releasetool import get_next_dev_version
from releasetool import git_commit
from releasetool import git_push
from releasetool import git_tag
from releasetool import status_check
from releasetool import update_changelog
from releasetool import update_rust_version

logger = logging.getLogger(__name__)

if __name__ == "__main__":
status_check()
update_changelog()
update_rust_version()
git_commit()
git_tag()

if branch == "main":
update_rust_version(version=get_next_dev_version())
git_commit(message="reopen main for development")

git_push()
logger.info("✅ All done. 🥳")
8 changes: 4 additions & 4 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
cancel-in-progress: true

env:
rust_clippy: "1.74" # MSRV
rust_clippy: "1.80" # MSRV

jobs:
protobuf:
Expand All @@ -24,7 +24,7 @@ jobs:
--prost_out=./src/ipc/
--swift_out=./mitmproxy-macos/redirector/ipc
- run: cargo fmt --all
- uses: autofix-ci/action@d3e591514b99d0fca6779455ff8338516663f7cc
- uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a

rustfmt:
runs-on: ${{ matrix.os }}
Expand All @@ -38,7 +38,7 @@ jobs:
- uses: actions/checkout@v4
- run: rustup toolchain install ${{ env.rust_clippy }} --profile minimal --component rustfmt --component clippy
- run: rustup default ${{ env.rust_clippy }}
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
- uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
timeout-minutes: 2
continue-on-error: true
# PyO3 wants recent Python on Windows.
Expand All @@ -50,4 +50,4 @@ jobs:
- run: cargo fmt --all
- run: git checkout src/ipc/mitmproxy_ipc.rs

- uses: autofix-ci/action@d3e591514b99d0fca6779455ff8338516663f7cc
- uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- main
tags:
- "*"
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:

permissions:
Expand All @@ -22,10 +22,10 @@ jobs:
matrix:
include:
- os: windows-latest
rust: "1.74" # MSRV
rust: "1.80" # MSRV
args: --exclude macos-certificate-truster
- os: macos-latest
rust: "1.74"
rust: "1.80"
args: --exclude windows-redirector
- os: ubuntu-latest
rust: stable
Expand All @@ -34,7 +34,7 @@ jobs:
- uses: actions/checkout@v4
- name: Set up Rust toolchain
run: rustup toolchain install ${{ matrix.rust }} --profile minimal
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
- uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
timeout-minutes: 2
continue-on-error: true
# PyO3 wants recent Python on Windows.
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
- if: matrix.target
run: rustup target add ${{ matrix.target }}
- run: rustup show
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
- uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
timeout-minutes: 2
continue-on-error: true
- uses: actions/setup-python@v5
Expand All @@ -92,10 +92,10 @@ jobs:

- if: runner.os == 'Linux'
name: Install maturin[zig] from PyPI
uses: install-pinned/maturin-with-zig@99ca9e7f6388283533da289b033822f9997d583c
uses: install-pinned/maturin-with-zig@4804d730717f28b7565e71e68e5c9fe8c4f9b089
- if: runner.os != 'Linux'
name: Install maturin from PyPI
uses: install-pinned/maturin@9ef429e73235cb3ab68a9f8677ca10a189592a5e
uses: install-pinned/maturin@ab13013f30551a87b56c6a9c2bdd7b6287581def

- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: python .github/scripts/pin-versions.py
Expand Down Expand Up @@ -152,7 +152,7 @@ jobs:
- uses: actions/checkout@v4

# Build Rust
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
- uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
timeout-minutes: 2
continue-on-error: true
- run: rustup toolchain install stable --profile minimal
Expand Down Expand Up @@ -180,7 +180,7 @@ jobs:
with:
python-version-file: .github/python-version.txt
- name: Install build from PyPI
uses: install-pinned/build@0308e579e8aad0c0efc2da421dd2a682abdaf3db
uses: install-pinned/build@fd74312bf8fa4a8e5db75511358065e3d99b17b0
- run: python -m build --wheel ./mitmproxy-${{ matrix.os }} --outdir target/wheels/
- uses: actions/upload-artifact@v4
with:
Expand All @@ -198,7 +198,7 @@ jobs:
jobs: ${{ toJSON(needs) }}

deploy:
uses: mhils/workflows/.github/workflows/python-deploy.yml@v5
uses: mhils/workflows/.github/workflows/python-deploy.yml@v11
needs: check
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
- uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
timeout-minutes: 2
continue-on-error: true
- name: Install maturin[zig] from PyPI
uses: install-pinned/maturin-with-zig@99ca9e7f6388283533da289b033822f9997d583c
uses: install-pinned/maturin-with-zig@4804d730717f28b7565e71e68e5c9fe8c4f9b089
- name: Install mypy from PyPI
uses: install-pinned/mypy@2eabe14b1638b48be440607da1cfb5c3e9be3d4d
uses: install-pinned/mypy@15172e0901cf7045a4181d12138212867fb66389
- name: Install pdoc from PyPI
uses: install-pinned/pdoc@f2fbf58d572a8f3db623e6abd97d3ec3054aeb1a
uses: install-pinned/pdoc@e84522771f760a774c423ce40c9bb9844f843825

- run: maturin build
working-directory: ./mitmproxy-rs
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
description: 'Version (major.minor.patch)'
required: true
type: string
skip-branch-status-check:
description: 'Skip CI status check.'
default: false
required: false
type: boolean

permissions: {}

jobs:
release:
environment: deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PUSH_TOKEN }} # this token works to push to the protected main branch.
- uses: mhils/releasetool@v1
- run: ./.github/scripts/release
env:
PROJECT_VERSION: ${{ inputs.version }}
STATUS_CHECK_SKIP_GIT: ${{ inputs.skip-branch-status-check }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
__pycache__/
*.xcuserstate
editable.marker
*.DS_Store
92 changes: 90 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,92 @@
## 0.5.1
## Unreleased: mitmproxy_rs next


## 28 October 2024: mitmproxy_rs 0.10.7

- tun mode: disable rp_filter, remove debug logging.

## 28 October 2024: mitmproxy_rs 0.10.6

- tun mode: re-add debug logging.

## 27 October 2024: mitmproxy_rs 0.10.5

- tun mode: add default netmask

## 27 October 2024: mitmproxy_rs 0.10.4

- Remove superfluous debug logs.

## 27 October 2024: mitmproxy_rs 0.10.3

- Add more debug info.

## 27 October 2024: mitmproxy_rs 0.10.2

- Add debug info.

## 27 October 2024: mitmproxy_rs 0.10.1

- Assign a local IP address to our `tun` interface for Linux compatibility.

## 27 October 2024: mitmproxy_rs 0.10.0

- Add `tun` mode.

## 18 October 2024: mitmproxy_rs 0.9.3

- Improve error messages for better debugging.

## 02 October 2024: mitmproxy_rs 0.9.2

- Improve error messages for better debugging.

## 06 September 2024: mitmproxy_rs 0.9.1

- Actually better speculative fix.

## 05 September 2024: mitmproxy_rs 0.9.0

- Better speculative fix.

## 04 September 2024: mitmproxy_rs 0.8.1

- Speculative fix for stack overflows on Windows.

## 04 September 2024: mitmproxy_rs 0.8.0

- Move functionality into submodules.

## 0.7.2

- Make `active_executables` raise for invalid paths on Windows.

## 0.7.1

- Make DnsResolver.lookup_* methods return error numbers matching `getaddrinfo`.

## 0.7.0

- Set IPV6_V6ONLY flag for UDP sockets

## 0.6.3

- Fix a bug when initializing local redirect mode on macOS.

## 0.6.2

- Handle errors when remote host has closed UDP socket

## 0.6.1

- Add dedicated IPv4/IPv6 resolution methods to the DNS resolver.

## 0.6.0

- Change intercept spec syntax.
- Add DNS resolver.

## 0.5.2

- Dependency updates.

Expand Down Expand Up @@ -143,7 +231,7 @@

## 0.1.7

- Do not exit the network task when a draining TcpStream is already closed.
- Do not exit the network task when a draining TcpStream is already closed.
- Make log messages for "no current WireGuard session" more user-friendly.
- Attempt to build binary wheels for `aarch64-unknown-linux-gnu` for Raspberry
Pi support.
Expand Down
13 changes: 4 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,7 @@ be no busy waiting.
If you are the current maintainer of mitmproxy_rs,
you can perform the following steps to ship a release:

1. Make sure that...
- you are on the `main` branch with a clean working tree.
- `cargo test` is passing without errors.
2. Bump the version in [`Cargo.toml`](Cargo.toml).
3. Run `cargo update --workspace` to update the lockfile with the new version.
4. Update [`CHANGELOG.md`](./CHANGELOG.md).
5. Commit the changes and tag them.
- Convention: Tag name is simply the version number, e.g. `1.0.1`.
6. Manually confirm the CI deploy step on GitHub.
1. Make sure that CI is passing without errors.
2. Make sure that CHANGELOG.md is up-to-date with all entries in the "Unreleased" section.
3. Invoke the release workflow from the GitHub UI: https://github.com/mitmproxy/mitmproxy_rs/actions/workflows/release.yml
4. The spawned workflow run will require manual deploy confirmation on GitHub: https://github.com/mitmproxy/mitmproxy/actions
Loading

0 comments on commit fa22fdc

Please sign in to comment.