diff --git a/Dockerfile b/Dockerfile index 7f27e3d1..3dd988e3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,8 @@ RUN apk add -q --progress --no-cache --update openvpn ca-certificates iptables i unzip -q openvpn-tcp.zip -d /openvpn-tcp-normal && \ unzip -q openvpn-strong-tcp.zip -d /openvpn-tcp-strong && \ apk del -q --progress --purge build-dependencies && \ - rm -rf /*.zip /var/cache/apk/* /etc/unbound/unbound.conf + rm -rf /*.zip /var/cache/apk/* /etc/unbound/unbound.conf && \ + addgroup -S nonrootusers && adduser -S nonrootuser -G nonrootusers COPY unbound.conf /etc/unbound/unbound.conf COPY entrypoint.sh / ENTRYPOINT /entrypoint.sh \ No newline at end of file diff --git a/README.md b/README.md index 56da2430..9641d809 100644 --- a/README.md +++ b/README.md @@ -226,4 +226,5 @@ For more containers, add more `--link pia:xxx` and modify *nginx.conf* according - More iptables restrictions - Rework readme with unbound required for VPN -- Block malicious websites with Unbound \ No newline at end of file +- Block malicious websites with Unbound +- Add checks when launching PIA $? \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 3388c12d..f32d4d18 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -84,17 +84,19 @@ printf "DONE" ############################################ # SUMMARY ############################################ -printf "\n * Starting OpenVPN using the following parameters:" -printf "\n * Domain: $PIADOMAIN" -printf "\n * Port: $PORT" -printf "\n * Protocol: $PROTOCOL" -printf "\n * Encryption: $ENCRYPTION\n" +printf "\nStarting OpenVPN using the following parameters:" +printf "\n * Domain: $PIADOMAIN" +printf "\n * Port: $PORT" +printf "\n * Protocol: $PROTOCOL" +printf "\n * Encryption: $ENCRYPTION" ############################################ # OPENVPN LAUNCH ############################################ -# RUN AS OTHER USER TODO cd /openvpn-$PROTOCOL-$ENCRYPTION +printf "\nSwitching from root to nonrootuser..." +su -l nonrootuser +printf "DONE\n" openvpn --config "$REGION.ovpn" --auth-user-pass /auth.conf ############################################