Set up the mitmproxy config as a symlink

This allows the mitmproxy configuration directory to be saved as a Docker volume so that its certificates are not regenerated every time the container is run. If the config file is directly included in the volume, then new changes to it will not be copied over during the image build because the volume mount (which is using the old config version) overwrites the whole directory. Using a symlink allows modifying the config without modifying anything in the configuration directory.
This commit is contained in:
Matthew Lopez 2023-12-15 22:16:52 -05:00
parent d1f48199ba
commit 1d253796b1
No known key found for this signature in database
GPG Key ID: 302A6EE3D63B7E0E
5 changed files with 11 additions and 8 deletions

9
.gitignore vendored
View File

@ -1,6 +1,9 @@
# Files generated by mitmproxy but not the configuration
configuration/*
!configuration/config.yaml
# Files generated by mitmproxy, except for the main configuration
.mitmproxy/*
!.mitmproxy/config.yaml
# Python virtual environment
/venv/
# Python cache
__pycache__

View File

@ -1 +0,0 @@
configuration/

1
.mitmproxy/config.yaml Symbolic link
View File

@ -0,0 +1 @@
../mitmproxy-config.yaml

2
launch
View File

@ -1,4 +1,4 @@
#!/bin/bash
cd "$(realpath --no-symlinks "$(dirname "$0")")"
$(basename "$0") --set confdir="./configuration" "$@"
$(basename "$0") --set confdir="./.mitmproxy" "$@"

View File

@ -3,10 +3,10 @@
listen_port: 8080
web_port: 8081
# This makes sure that the right configuration files and certs are loaded.
# Make sure that the right configuration files and certs are loaded
client_certs: ./client-certificates/WiiU-common.pem
confdir: ./configuration
confdir: ./.mitmproxy
# This enables the Pretendo redirection script.
# Enable the Pretendo redirection script
scripts: ["../pretendo_addon.py"]
pretendo_redirect: true