Docker: assume uid of who holds permissions (#5550)
* Docker: assume uid of who holds permissions * add docs
This commit is contained in:
parent
891dae031c
commit
8023b22498
|
@ -45,6 +45,7 @@ Proxy server listening at http://*:8080
|
||||||
[...]
|
[...]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If `~/.mitmproxy/mitmproxy-ca.pem` is present in the container, mitmproxy will assume uid and gid from the file owner.
|
||||||
For further details, please consult the mitmproxy [documentation](http://docs.mitmproxy.org/en/stable/).
|
For further details, please consult the mitmproxy [documentation](http://docs.mitmproxy.org/en/stable/).
|
||||||
|
|
||||||
## Tags
|
## Tags
|
||||||
|
|
|
@ -9,7 +9,12 @@ MITMPROXY_PATH="/home/mitmproxy/.mitmproxy"
|
||||||
|
|
||||||
if [[ "$1" = "mitmdump" || "$1" = "mitmproxy" || "$1" = "mitmweb" ]]; then
|
if [[ "$1" = "mitmdump" || "$1" = "mitmproxy" || "$1" = "mitmweb" ]]; then
|
||||||
mkdir -p "$MITMPROXY_PATH"
|
mkdir -p "$MITMPROXY_PATH"
|
||||||
chown -R mitmproxy:mitmproxy "$MITMPROXY_PATH"
|
if [ -f "$MITMPROXY_PATH/mitmproxy-ca.pem" ]; then
|
||||||
|
usermod -o \
|
||||||
|
-u $(stat -c "%u" "$MITMPROXY_PATH/mitmproxy-ca.pem") \
|
||||||
|
-g $(stat -c "%g" "$MITMPROXY_PATH/mitmproxy-ca.pem") \
|
||||||
|
mitmproxy
|
||||||
|
fi
|
||||||
gosu mitmproxy "$@"
|
gosu mitmproxy "$@"
|
||||||
else
|
else
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
Loading…
Reference in New Issue