-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'ypid/getclient' into dev
- Loading branch information
Showing
5 changed files
with
118 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
## @licence AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html> | ||
## @author Copyright (C) 2015 Robin Schneider <[email protected]> | ||
|
||
if [ -z "$OPENVPN" ]; then | ||
export OPENVPN="$PWD" | ||
fi | ||
if ! source "$OPENVPN/ovpn_env.sh"; then | ||
echo "Could not source $OPENVPN/ovpn_env.sh." | ||
exit 1 | ||
fi | ||
if [ -z "$EASYRSA_PKI" ]; then | ||
export EASYRSA_PKI="$OPENVPN/pki" | ||
fi | ||
|
||
pushd "$EASYRSA_PKI" | ||
for name in issued/*.crt; do | ||
name=${name%.crt} | ||
name=${name#issued/} | ||
if [ "$name" != "$OVPN_CN" ]; then | ||
ovpn_getclient "$name" separated | ||
ovpn_getclient "$name" combined-save | ||
fi | ||
done | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Advanced client management | ||
|
||
## Client configuration mode | ||
|
||
The [`ovpn_getclient`](/bin/ovpn_getclient) can produce two different versions of the configuration. | ||
|
||
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. | ||
|
||
Note that some client software might be picky about which configuration format it accepts. | ||
|
||
## Batch mode | ||
|
||
If you have more than a few clients, you will want to generate and update your client configuration in batch. For this task the script [`ovpn_getclient_all`](/bin/ovpn_getclient_all) was written, which writes out the configuration for each client to a separate directory called `clients/$cn`. | ||
|
||
Execute the following to generate the configuration for all clients: | ||
|
||
docker run --rm -t -i -v /tmp/openvpn:/etc/openvpn kylemanna/openvpn ovpn_getclient_all | ||
|
||
After doing so, you will find the following files in each of the `$cn` directories: | ||
|
||
ca.crt | ||
dh.pem | ||
$cn-combined.ovpn # Combined configuration file format. If your client recognices this file then only this file is needed. | ||
$cn.ovpn # Separated configuration. This configuration file requires the other files ca.crt dh.pem $cn.crt $cn.key ta.key | ||
$cn.crt | ||
$cn.key | ||
ta.key |