Skip to content

Commit c3f5b30

Browse files
committed
Fix bashrc path in kubetap-entrypoint.sh to ensure proper auto-attach for mitmproxy tmux session
1 parent 7fbce66 commit c3f5b30

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

proxies/mitmproxy/kubetap-entrypoint.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,16 @@ if [[ "${1}" == 'mitmdump' || "${1}" == 'mitmproxy' || "${1}" == 'mitmweb' ]]; t
3838
fi
3939

4040
# Create a bashrc file that auto-attaches to tmux on interactive shell
41-
cat > /root/.bashrc << 'BASHRC_EOF'
41+
# Write to the mitmproxy user's home directory
42+
cat > /home/mitmproxy/.bashrc << 'BASHRC_EOF'
4243
# Auto-attach to mitmproxy tmux session if it exists and we're in an interactive shell
4344
if [[ $- == *i* ]] && [ -z "$TMUX" ]; then
4445
if tmux has-session -t mitmproxy 2>/dev/null; then
4546
exec tmux attach-session -t mitmproxy
4647
fi
4748
fi
4849
BASHRC_EOF
50+
chmod 644 /home/mitmproxy/.bashrc
4951

5052
# Keep the container running - sleep indefinitely
5153
# This allows users to attach via: kubectl exec -it <pod> -- tmux attach-session -t mitmproxy

0 commit comments

Comments
 (0)