kylemanna / docker-openvpn

🔒 OpenVPN server in a Docker container complete with an EasyRSA PKI CA
https://hub.docker.com/r/kylemanna/openvpn/
MIT License
8.62k stars 2.37k forks source link

Automatic answer for "Enter pass phrase for" #646

Closed Whisper40 closed 3 years ago

Whisper40 commented 3 years ago

Hello, i don't understand why we are forced to put something, i would like to let this empty.. Because i would like to automate this, but i don't arrive to delete a cert automatically.

echo "yes\npassword\n" docker-compose run --rm openvpn ovpn_revokeclient "ovpn-"$1 remove

is not working :(

Does someone have an idea for that ? Thanks

kimsyversen commented 3 years ago

I tried to use except to automate creating new certificates. I know I got it working, but it's a while since i used this code. This should give you an idea of what to do.

expect <<END
    spawn docker exec -it openvpn easyrsa build-client-full ${USERNAME} 
    expect "Enter PEM pass phrase:"
    send ${USERPASS}\r
    expect "Verifying - Enter PEM pass phrase:"
    send ${USERPASS}\r
    expect "Enter pass phrase for /etc/openvpn/pki/private/ca.key:"
    send ${CAPASS}\r
    expect "Data Base Updated"  
END
Whisper40 commented 3 years ago

Thanks for your purpose but i changed of project to another one based on this but without any interaction that are not at all useful.. We should not set passphrase ourself..