docker-openvpn icon indicating copy to clipboard operation
docker-openvpn copied to clipboard

opvn_getclients second variable not passing through

Open NAL100 opened this issue 4 years ago • 3 comments

Hi, I am trying to run this one:

docker run -v $OVPN_PKI:/etc/openvpn --rm -it kylemanna/openvpn ovpn_getclient $DEVICE > "/volume2/folder name/$DEVICE.ovpn"

However I keep getting as an output in the folder the message that there are two parameters (three really), combined, combined-save or separate.

This script can produce the client configuration in two formats: 1. combined (default): All needed configuration and cryptographic material is in one file (Use "combined-save" to write the configuration file in the same path as the separated parameter does). 2. separated: Separated files. Please specify one of those options as second parameter.

So I append "combined" to the end of that line:

docker run -v $OVPN_PKI:/etc/openvpn --rm -it kylemanna/openvpn ovpn_getclient $DEVICE > "/volume2/folder name/$DEVICE.ovpn" combined

And I get the same thing happening. I've tried -combined, --combined, -combined-save, you name it. I tried assigning the path to variables and running it that way, but getting the same message, or other odd messages. I've been trying to follow this faq however when I get to generating the OpenVPN client file, that's where it stalls so I can't move further.

Also, second issue, I decided that might be too much trouble and was trying to follow this katacoda scenario for docker-compose, and ran into this error:

bash-4.3# docker-compose run --rm openvpn \
>     ovpn_genconfig -u udp://example.com
Creating network "openvpn_default" with the default driver
Error response from daemon: Bind mount failed: '/volume2/docker/openVPN/openvpn-data/conf' does not exists

Any help would be great. Thanks.

NAL100 avatar Nov 01 '20 07:11 NAL100

if you use docker desktop in windows, you should do it like this: docker run -v $OVPN_PKI:/etc/openvpn --rm -it kylemanna/openvpn ovpn_getclient $DEVICE > "c:\$DEVICE.ovpn"

biner avatar Nov 06 '20 03:11 biner

if you use docker desktop in windows, you should do it like this: docker run -v $OVPN_PKI:/etc/openvpn --rm -it kylemanna/openvpn ovpn_getclient $DEVICE > "c:\$DEVICE.ovpn"

I'm SSHing into my Synology NAS so it wouldn't be a drive letter type of deal.

NAL100 avatar Nov 06 '20 04:11 NAL100

try this: docker run -v $OVPN_PKI:/etc/openvpn --rm -it kylemanna/openvpn ovpn_getclient $DEVICE combined

combined is already saving to file you do not need to redirect.

you put combined after > (redirect) and therefore it is not pass as argument to script

tvojacek avatar Jan 06 '21 16:01 tvojacek