From ceab5c54b7d0b5c6711d5be0b5bcb609f2e60ff9 Mon Sep 17 00:00:00 2001
From: Matthew Lopez <73856503+MatthewL246@users.noreply.github.com>
Date: Sat, 16 Dec 2023 15:43:11 -0500
Subject: [PATCH] Update the readme with instructions for the published image
---
.gitignore | 4 +--
readme.md => README.md | 70 ++++++++++++++++++++++++++----------------
start-docker.sh | 3 +-
3 files changed, 48 insertions(+), 29 deletions(-)
rename readme.md => README.md (76%)
diff --git a/.gitignore b/.gitignore
index b107508..6d62816 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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/
diff --git a/readme.md b/README.md
similarity index 76%
rename from readme.md
rename to README.md
index 523ce0a..b4c07db 100644
--- a/readme.md
+++ b/README.md
@@ -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 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
+ 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
@@ -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
diff --git a/start-docker.sh b/start-docker.sh
index e7b1504..10eb790 100755
--- a/start-docker.sh
+++ b/start-docker.sh
@@ -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