Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging the changes from my fork #2

Merged
merged 75 commits into from
Jan 5, 2024

Conversation

MatthewL246
Copy link
Member

This PR contains all the changes I made in my fork, including Dockerization, functionality to redirect Pretendo requests to a local server, creating HAR network dumps, and an updated readme.

For PretendoNetwork/website#233.

Note that GitHub Actions is used to automatically build the Docker container and push it to the GitHub Container Registry.

This adds some issues that I faced into the "Known Issues" section of the readme. The solution for the client certificate failure is from the readme of superwhiskers/mitmproxy-nintendo, but it was removed in the Pretendo fork.
This greatly simplifies the config.yaml file by removing unnecessary default settings. It also contains some of my settings for convenience, some issue workarounds, and comments that better explain the purpose of each setting.
This replaces the simple "nintendo.net => pretendo.cc" substitution with a customized redirection for each Pretendo server.

This is necessary for several reasons:
 - The Grove server expects `eshop.pretendo.cc`, not `geisha-wup`...
 - Each server must be run on a different port. The port numbers must be configured manually for each Pretendo server.
This makes more sense than listening on port 7070 because the account server is the most important.
This creates a script for setting up the Pretendo network servers. Currently, it only downloads several relevant Git repositories and Go libraries and organizes them.
I plan to continue working on this script so it will be able to fully set up and configure all of the servers.
*facepalm*
Also, I improved the formatting a little.
Recent versions of mitmproxy deprecated these options or made them unnecessary.
It's better to use an actual reverse proxy like nginx instead of using mitmproxy.
This is necessary for distributions that install OpenSSL 3.x.x by default, which is too new for connecting to Nintendo's servers.
This reverse proxy listens on port 8888 and forwards all traffic to a local server running on port 81. TCP ports 80 and 443 should be forwarded to port 8888. This local server should be running a reverse proxy like nginx that will proxy requests based on the host header.
Use `pretty_host` instead of `host` because `pretty_host` takes the HTTP host header into account, not just the destination.
@jonbarrow
Copy link
Member

Looks good to me 👍 Dani is currently looking into a couple bugs with upstream mitmproxy, and after that we will likely continue work here as well for the docs. I'd like to credit you in the docs, would a GitHub mention be sufficient?

How does this PR look to you @DaniElectra, I know you use mitmproxy as your main proxy?

@jonbarrow jonbarrow requested a review from DaniElectra January 5, 2024 13:10
@MatthewL246
Copy link
Member Author

Thanks, a link to my GitHub sounds good.

README.md Outdated Show resolved Hide resolved
Copy link
Member

@jonbarrow jonbarrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple notes on stuff I missed earlier

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Member

@DaniElectra DaniElectra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only some little comments

config-3ds.yaml Outdated Show resolved Hide resolved
config-wiiu.yaml Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
config-local.yaml Outdated Show resolved Hide resolved
Copy link
Member

@DaniElectra DaniElectra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@jonbarrow jonbarrow merged commit 04828c4 into PretendoNetwork:master Jan 5, 2024
@MatthewL246 MatthewL246 deleted the upstream-merge branch January 5, 2024 18:29
@MatthewL246
Copy link
Member Author

MatthewL246 commented Jan 5, 2024

@jonbarrow It looks like the Docker image build succeeded but trying to pull it causes the error Error response from daemon: Head "https://ghcr.io/v2/pretendonetwork/mitmproxy-nintendo/manifests/local": unauthorized. I wonder if there is something in your organization settings making images private?

Update: This might help

@jonbarrow
Copy link
Member

Thanks for the update! I also noticed this, I've brought it up in our architecture channel on Discord so we can sort things out (as I'm currently unavailable)

@jonbarrow
Copy link
Member

jonbarrow commented Jan 11, 2024

@MatthewL246 I've never worked with the GitHub registry before (didn't even know it existed until now). You are correct that this is due to it being private. But it seems as if I am unable to make them public?

I have asked our lead architecture dev @SuperMarioDaBom to take a look at this and see about moving to the official Docker registry, as we have an org there as well, but due to lack of free time I am unsure when this will happen (truth be told, I am personally also fairly unfamiliar with Docker. It's something that's been on my TODO list but never got around to until recently)

EDIT: I believe I got it, @hauntii pointed out there's an org level permission I had to enable

Screenshot from 2024-01-11 15-04-48

@MatthewL246
Copy link
Member Author

MatthewL246 commented Jan 11, 2024

Moving to the Docker registry sounds totally reasonable. I just chose the GitHub registry because it's convenient to use with GitHub Actions and free for public repos. I think this post might relate to your issue.

Edit: Missed your edit, I see that you made it public and I can successfully pull the image now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants