container-openvpn/bin/ovpn_copy_server_files
Robin Schneider 3d2d839d0b
Wrote script to copy only the needed files to the docker host which runs the docker openvpn server.
* For the truly paranoid users, never keep any keys (i.e. client and
  certificate authority) in the docker container to begin with :).
2015-03-08 22:40:08 +01:00

25 lines
667 B
Bash
Executable File

#!/bin/bash
## @licence AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>
## @author Copyright (C) 2015 Robin Schneider <ypid@riseup.net>
source "$OPENVPN/ovpn_env.sh"
TARGET="/tmp/openvpn_${OVPN_CN}"
if [ -n "$1" ]; then
TARGET="$1"
fi
rsync --recursive --verbose --prune-empty-dirs \
--include "*/" \
--include "/pki/private/${OVPN_CN}.key" \
--include "/pki/ca.crt" \
--include "/pki/issued/${OVPN_CN}.crt" \
--include "/pki/dh.pem" \
--include "ta.key" \
--include "/openvpn.conf" \
--include "/ovpn_env.sh" \
--exclude="*" \
"$OPENVPN/" "$TARGET"
echo "Created the openvpn configuration for the server: $TARGET"