diff --git a/Dockerfile b/Dockerfile index a85cb24b..5f8d0ea8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ LABEL maintainer="Kyle Manna " # Testing: pamtester RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories && \ - apk add --update openvpn iptables bash easy-rsa openvpn-auth-pam google-authenticator pamtester && \ + apk add --update openvpn iptables bash easy-rsa openvpn-auth-pam google-authenticator pamtester libqrencode && \ ln -s /usr/share/easy-rsa/easyrsa /usr/local/bin && \ rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/* diff --git a/bin/ovpn_otp_user b/bin/ovpn_otp_user index 7af9c1ec..3538181e 100755 --- a/bin/ovpn_otp_user +++ b/bin/ovpn_otp_user @@ -24,10 +24,12 @@ fi # Binary is present in image, save an $user.google_authenticator file in /etc/openvpn/otp if [ "$2" == "interactive" ]; then + echo "google-authenticator --time-based --force -l \"${1}@${OVPN_CN}\" -s /etc/openvpn/otp/${1}.google_authenticator" # Authenticator will ask for other parameters. User can choose rate limit, token reuse policy and time window policy # Always use time base OTP otherwise storage for counters must be configured somewhere in volume google-authenticator --time-based --force -l "${1}@${OVPN_CN}" -s /etc/openvpn/otp/${1}.google_authenticator else + echo "google-authenticator --time-based --disallow-reuse --force --rate-limit=3 --rate-time=30 --window-size=3 -l \"${1}@${OVPN_CN}\" -s /etc/openvpn/otp/${1}.google_authenticator" google-authenticator --time-based --disallow-reuse --force --rate-limit=3 --rate-time=30 --window-size=3 \ - -l "${1}@${OVPN_CN}" -s /etc/openvpn/otp/${1}.google_authenticator -fi \ No newline at end of file + -l "${1}@${OVPN_CN}" -s /etc/openvpn/otp/${1}.google_authenticator --no-confirm +fi