mitmproxy / docker-releases

🗃️ This repository has been integrated into mitmproxy/mitmproxy.
52 stars 26 forks source link

Permission denied: '/home/mitmproxy/.mitmproxy/mitmproxy-ca.pem' #6

Closed kuba-orlik closed 7 years ago

kuba-orlik commented 8 years ago

I'm trying to run mitmproxy with the following command:

docker run --rm -it -v ~/.mitmproxy:/home/mitmproxy/.mitmproxy -p 8080:8080 mitmproxy/releases

This is the output I get:

Traceback (most recent call last):
  File "/usr/bin/mitmproxy", line 11, in <module>
    sys.exit(mitmproxy())
  File "/usr/lib/python2.7/site-packages/mitmproxy/main.py", line 56, in mitmproxy
    proxy_config = process_proxy_options(parser, options)
  File "/usr/lib/python2.7/site-packages/mitmproxy/proxy/config.py", line 229, in process_proxy_options
    add_upstream_certs_to_client_chain=options.add_upstream_certs_to_client_chain,
  File "/usr/lib/python2.7/site-packages/mitmproxy/proxy/config.py", line 100, in __init__
    CONF_BASENAME
  File "/usr/lib/python2.7/site-packages/netlib/certutils.py", line 209, in from_store
    key, ca = cls.create_store(path, basename)
  File "/usr/lib/python2.7/site-packages/netlib/certutils.py", line 233, in create_store
    with open(os.path.join(path, basename + "-ca.pem"), "wb") as f:
IOError: [Errno 13] Permission denied: '/home/mitmproxy/.mitmproxy/mitmproxy-ca.pem'

How can I fix it? :)

Matthalp-zz commented 8 years ago

+1 I am able to repeat the issue too

mhils commented 8 years ago

The problem here is that the Docker container does not have permissions to write to your ~/. mitmproxy. A simple hacky workaround is to chmod a+wr your .mitmproxy folder. If you have a good - less hacky - solution, I'm happy to include that in the docs. :)

On Mon, 29 Aug 2016, 14:06 Matthew Halpern, notifications@github.com wrote:

I am able to repeat the issue too

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mitmproxy/docker-releases/issues/6#issuecomment-243256222, or mute the thread https://github.com/notifications/unsubscribe-auth/AA-NPtQ3PYxzGQzeEO-qm5OkDIpwyBtIks5qk0nBgaJpZM4JeeUm .

mhils commented 7 years ago

Fixed by #8. Thanks again, @maxcnunes! :smiley: