From f1cf5237cdfbbe5f815789ba543e1e291b0fc742 Mon Sep 17 00:00:00 2001 From: Otto Seiskari Date: Sat, 8 Sep 2018 10:32:08 +0300 Subject: [PATCH] Shared dir. Support for other starting points than Firefox --- .gitignore | 2 +- Dockerfile | 1 + README.md | 6 +++--- files/start.sh | 4 +++- run.sh | 4 +++- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 617b4b2..ff4fad8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ openvpn -local +shared *~ diff --git a/Dockerfile b/Dockerfile index 6333a0d..84a3333 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,3 +24,4 @@ COPY files/start-openvpn-blocking.sh /home/user/ ENV HOME /home/user ENTRYPOINT ["/bin/bash", "/home/user/start.sh"] +CMD ['firefox'] diff --git a/README.md b/README.md index fc7cb5a..a42188d 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,10 @@ without any cookies, history or such. 2. (optional) Create a directory `openvpn` and put your `openvpn.conf` there. Make sure it's called `openvpn.conf` and all extra files it may need are also in the `openvpn/` directory (this will be mounted in the container) - 3. Start container `./run.sh` + 3. Start container `./run.sh firefox` - Also `ASSERT_COUNTRY=Finland ./run.sh` to check that ifconfig.co thinks that - the your IP address is in a given country before starting Firefox. +Also `ASSERT_COUNTRY=Finland ./run.sh firefox` to check that ifconfig.co thinks +that the your IP address is in a given country before starting Firefox. ### Disclaimer diff --git a/files/start.sh b/files/start.sh index 3e501b6..afa7548 100644 --- a/files/start.sh +++ b/files/start.sh @@ -1,5 +1,7 @@ #!/bin/bash set -e +COMMAND="$1" +echo "$COMMAND" # If no profile ... if [ ! -d "$HOME/.mozilla" ]; then @@ -30,4 +32,4 @@ if [ ! -z ${ASSERT_COUNTRY+x} ]; then fi # Start firefox -firefox +$COMMAND diff --git a/run.sh b/run.sh index a5c5bfd..ccbbb8b 100755 --- a/run.sh +++ b/run.sh @@ -4,6 +4,8 @@ docker run -ti --rm -e DISPLAY \ --cap-add=NET_ADMIN --device /dev/net/tun \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -v `pwd`/openvpn:/etc/openvpn \ + -v `pwd`/shared:/home/user/Downloads \ -e ASSERT_COUNTRY \ --dns 1.1.1.1 \ - docker-vpn-browser + docker-vpn-browser \ + "$@"