File tree Expand file tree Collapse file tree 2 files changed +14
-13
lines changed
Expand file tree Collapse file tree 2 files changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -8,11 +8,13 @@ RUN apt-get update && \
88
99# HACK: the security context of the injected pod could be run as any user, therefore
1010# all users must be able to write to the directory.
11- RUN chmod -R 777 /home/mitmproxy/.mitmproxy/
11+ # Ensure the directory exists and is world-writable
12+ RUN mkdir -p /home/mitmproxy/.mitmproxy && \
13+ chmod -R 777 /home/mitmproxy/.mitmproxy/
1214
1315# Hijack the mitmproxy entrypoint (docker-entrypoint.sh) so that
1416# configuration can be built from within the container using the
1517# kubetap binary.
1618
1719COPY kubetap-entrypoint.sh /usr/local/bin/
18- ENTRYPOINT ["kubetap-entrypoint.sh" ]
20+ ENTRYPOINT ["kubetap-entrypoint.sh" ]
Original file line number Diff line number Diff line change @@ -4,18 +4,17 @@ set -o errexit
44set -o pipefail
55set -o nounset
66
7- # HACK: this fixes permission issues
8- # Ensure the .mitmproxy directory exists and is writable
9- if [ -d /home/mitmproxy/.mitmproxy ] && [ -w /home/mitmproxy/.mitmproxy ]; then
10- # Only copy the config file if it exists and we have read access
11- if [ -f /home/mitmproxy/config/config.yaml ] && [ -r /home/mitmproxy/config/config.yaml ]; then
12- cp /home/mitmproxy/config/config.yaml /home/mitmproxy/.mitmproxy/config.yaml
13- echo " Config file copied to /home/mitmproxy/.mitmproxy/config.yaml" >&2
14- else
15- echo " Warning: Config file not found or not readable at /home/mitmproxy/config/config.yaml" >&2
16- fi
7+ # Ensure the .mitmproxy directory exists with proper permissions
8+ mkdir -p /home/mitmproxy/.mitmproxy
9+ chmod 777 /home/mitmproxy/.mitmproxy
10+
11+ # Copy the config file if it exists and is readable
12+ if [ -f /home/mitmproxy/config/config.yaml ] && [ -r /home/mitmproxy/config/config.yaml ]; then
13+ cp /home/mitmproxy/config/config.yaml /home/mitmproxy/.mitmproxy/config.yaml
14+ chmod 666 /home/mitmproxy/.mitmproxy/config.yaml
15+ echo " Config file copied to /home/mitmproxy/.mitmproxy/config.yaml" >&2
1716else
18- echo " Warning: .mitmproxy directory not found or not writable " >&2
17+ echo " Warning: Config file not found or not readable at /home/mitmproxy/config/config.yaml " >&2
1918fi
2019
2120prog=" ${1} "
You can’t perform that action at this time.
0 commit comments