Make $PWD/pki the default PKI location

This commit is contained in:
Olav Reinert committed 2017-06-05 23:41:14 +02:00
1 parent 5a429d22c7
commit 534f673459
2 files changed
+10 -7

No files matched your search

+2 -1
View File
@@ -34,6 +34,7 @@ Configuration Reference
1. File referenced by the --vars CLI option 1. File referenced by the --vars CLI option
2. The file referenced by the env-var named `EASYRSA_VARS_FILE` 2. The file referenced by the env-var named `EASYRSA_VARS_FILE`
3. The `EASYRSA_PKI` directory 3. The `EASYRSA_PKI` directory
4. The default PKI directory at $PWD/pki (usually will be the same as above)
4. The `EASYRSA` directory 4. The `EASYRSA` directory
5. The location of the easyrsa program (usually will be the same as above) 5. The location of the easyrsa program (usually will be the same as above)
@@ -80,7 +81,7 @@ possible terse description is shown below:
* `EASYRSA` - should point to the Easy-RSA top-level dir, normally $PWD * `EASYRSA` - should point to the Easy-RSA top-level dir, normally $PWD
* `EASYRSA_OPENSSL` - command to invoke openssl * `EASYRSA_OPENSSL` - command to invoke openssl
* `EASYRSA_SSL_CONF` - the openssl config file to use * `EASYRSA_SSL_CONF` - the openssl config file to use
* `EASYRSA_PKI` (CLI: `--pki-dir`) - dir to use to hold all PKI-specific files * `EASYRSA_PKI` (CLI: `--pki-dir`) - dir to use to hold all PKI-specific files, normally $PWD/pki.
* `EASYRSA_DN` (CLI: `--dn-mode`) - set to the string `cn_only` or `org` to * `EASYRSA_DN` (CLI: `--dn-mode`) - set to the string `cn_only` or `org` to
alter the fields to include in the req DN alter the fields to include in the req DN
* `EASYRSA_REQ_COUNTRY` (CLI: `--req-c`) - set the DN country with org mode * `EASYRSA_REQ_COUNTRY` (CLI: `--req-c`) - set the DN country with org mode
+8 -6
View File
@@ -989,13 +989,15 @@ vars_setup() {
# set up program path # set up program path
local prog_vars="${0%/*}/vars" local prog_vars="${0%/*}/vars"
# set up PKI path
local pki_vars="${EASYRSA_PKI:-$PWD/pki}/vars"
# command-line path: # command-line path:
if [ -f "$EASYRSA_VARS_FILE" ]; then if [ -f "$EASYRSA_VARS_FILE" ]; then
vars="$EASYRSA_VARS_FILE" vars="$EASYRSA_VARS_FILE"
# EASYRSA_PKI, if defined: # PKI location, if present:
elif [ -n "$EASYRSA_PKI" ] && [ -f "$EASYRSA_PKI/vars" ]; then elif [ -f "$pki_vars" ]; then
vars="$EASYRSA_PKI/vars" vars="$pki_vars"
# EASYRSA, if defined: # EASYRSA, if defined:
elif [ -n "$EASYRSA" ] && [ -f "$EASYRSA/vars" ]; then elif [ -n "$EASYRSA" ] && [ -f "$EASYRSA/vars" ]; then
vars="$EASYRSA/vars" vars="$EASYRSA/vars"
@@ -1013,9 +1015,9 @@ Note: using Easy-RSA configuration from: $vars"
fi fi
# Set defaults, preferring existing env-vars if present # Set defaults, preferring existing env-vars if present
set_var EASYRSA "$PWD" set_var EASYRSA "${0%/*}"
set_var EASYRSA_OPENSSL openssl set_var EASYRSA_OPENSSL openssl
set_var EASYRSA_PKI "$EASYRSA/pki" set_var EASYRSA_PKI "$PWD/pki"
set_var EASYRSA_DN cn_only set_var EASYRSA_DN cn_only
set_var EASYRSA_REQ_COUNTRY "US" set_var EASYRSA_REQ_COUNTRY "US"
set_var EASYRSA_REQ_PROVINCE "California" set_var EASYRSA_REQ_PROVINCE "California"
@@ -1225,4 +1227,4 @@ case "$cmd" in
;; ;;
esac esac
# vim: ft=sh nu ai sw=8 ts=8 # vim: ft=sh nu ai sw=8 ts=8 noet