Skip to content

Commit

Permalink
Update the readme with instructions for the published image
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewL246 committed Dec 16, 2023
1 parent f9b7505 commit ceab5c5
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Files generated by mitmproxy, except for the main configuration
.mitmproxy/*
!.mitmproxy/config.yaml
/.mitmproxy/
!/.mitmproxy/config.yaml

# Python virtual environment
/venv/
Expand Down
70 changes: 44 additions & 26 deletions readme.md → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,41 @@ Pretendo Network server.

### All setups

1. Clone this repository to your computer
(`git clone https://github.com/MatthewL246/mitmproxy-pretendo.git`).
2. Choose a method below to run mitmproxy ([Docker](#running-with-docker) or
1. Choose a method below to run mitmproxy ([Docker](#running-with-docker) or
[local install](#running-locally)).
3. Install Pretendo Network patches on your console using
[the official guide](https://pretendo.network/docs/install):
- Download the patches for
[Wii U](https://github.com/PretendoNetwork/Inkay/releases) or
[3DS](https://github.com/PretendoNetwork/nimbus/releases).
- Skip creating a PNID on the official Pretendo server if you will be
hosting your own server.
- You'll need to recompile the patches with your custom certificate
([see below](#compiling-custom-pretendo-patches)).
4. Configure your console to connect to the proxy using its system settings. Set
the console's proxy server to your computer's IP address and the port
to 8080.
2. Set up your console to connect the the proxy ([see below](#console-setup)).

### Running with Docker

This is the recommended way to run mitmproxy-pretendo because it always uses the
latest mitmproxy and is already set up with OpenSSL 1.1.1.
latest image and is already set up with OpenSSL 1.1.1.

1. Install Docker using the
[official instructions](https://docs.docker.com/get-docker/).
2. Run `docker build . -t mitmproxy-pretendo` to build the Docker image. This
will take a few minutes the first time, but it will be cached.
3. Start the Docker container by using the build `mitmproxy-pretendo` image.
- If you're not familiar with Docker, use this script to get started:
`./start-docker.sh`. Then, open <http://127.0.0.1:8081/> in your browser
to access the `mitmweb` web interface for mitmproxy.
2. Run a new Docker container using the `ghcr.io/matthewl246/mitmproxy-pretendo`
image.
- If you're not familiar with Docker, copy the `docker run ...` command from
[this script](./start-docker.sh) to get started. Then, open
<http://127.0.0.1:8081/> in your browser to access the `mitmweb` web
interface for mitmproxy.
- Note that if you delete the `mitmproxy-pretendo-data` volume, the
mitmproxy server certificates will be regenerated and you will need to set
up the SSL patches with your custom certificates again.

#### Rebuilding the Docker image

If you want to make modifications to the image, you need to rebuild it locally.

1. Clone this repository to your computer
(`git clone https://github.com/MatthewL246/mitmproxy-pretendo.git`).
2. Use the `./start-docker.sh` script to build and run the container. This build
overwrites the version you downloaded from the container registry. This will
take a few minutes the first time, but it will be cached for future builds.
- You need to rebuild the container every time you change something here.

If you want to revert your local image to the published version, run
`docker pull ghcr.io/matthewl246/mitmproxy-pretendo`.

### Running locally

This method can be used if you don't want to install Docker or just generally
Expand All @@ -55,21 +56,38 @@ support TLSv1.2 or later. Because of this, HTTPS connections to the proxy will
fail if mitmproxy is using OpenSSL 3.0.0.

1. Install Python 3 and pip.
2. Create a virtual environment with `python3 -m venv venv`.
3. Activate the virtual environment with `. ./venv/bin/activate`.
4. Install [mitmproxy](https://mitmproxy.org/) with `pip install mitmproxy`.
2. Clone this repository to your computer
(`git clone https://github.com/MatthewL246/mitmproxy-pretendo.git`).
3. Create a virtual environment with `python3 -m venv venv`.
4. Activate the virtual environment with `. ./venv/bin/activate`.
5. Install [mitmproxy](https://mitmproxy.org/) with `pip install mitmproxy`.
- Test that mitmproxy is working by running `mitmproxy --version`.
- If the OpenSSL version is above 3.0.0, the console will fail to connect
via HTTPS. Consider using the Docker container instead, or compile a
custom version of OpenSSL and Python cryptography
([see below](#using-a-custom-version-of-openssl-with-mitmproxy)).
5. Run one of the launcher scripts (i.e. `./mitmproxy`) to launch the mitmproxy
6. Run one of the launcher scripts (i.e. `./mitmproxy`) to launch the mitmproxy
server.

Running the launcher script will now automatically load the Pretendo addon
script. This will add the custom `pretendo_redirect` and `pretendo_http` options
to mitmproxy.

## Console setup

1. Install Pretendo Network patches on your console using
[the official guide](https://pretendo.network/docs/install):
- Download the patches for
[Wii U](https://github.com/PretendoNetwork/Inkay/releases) or
[3DS](https://github.com/PretendoNetwork/nimbus/releases).
- Skip creating a PNID on the official Pretendo server if you will be
hosting your own server.
- You'll now need to recompile the patches with your custom certificate
([see below](#compiling-custom-pretendo-patches)).
2. Configure your console to connect to the proxy using its system settings. Set
the console's proxy server to your computer's IP address and the port
to 8080.

## Modifications

### Compiling custom Pretendo patches
Expand Down
3 changes: 2 additions & 1 deletion start-docker.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#! /bin/sh

docker run -it --rm -v mitmproxy-pretendo-data:/home/mitmproxy/.mitmproxy -p 8080:8080 -p 127.0.0.1:8081:8081 mitmproxy-pretendo mitmweb --web-host 0.0.0.0
docker build . -t ghcr.io/matthewl246/mitmproxy-pretendo
docker run -it --rm -v mitmproxy-pretendo-data:/home/mitmproxy/.mitmproxy -p 8080:8080 -p 127.0.0.1:8081:8081 ghcr.io/matthewl246/mitmproxy-pretendo mitmweb --web-host 0.0.0.0

0 comments on commit ceab5c5

Please sign in to comment.