-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve vars auto load #1025
Improve vars auto load #1025
Conversation
The main changes made are: * If EASYRSA is set then only allow default vars file. No auto-load * If EASYRSA_PKI is set then allow also EASYRSA_PKI/vars. Use auto-load. This is something like "The Three Laws"; vars auto-load is unnecassary and should be replaced by a single default vars file. However, here is the latest version: 1. The DEFAULT vars file is in the working directory: ./vars 2. Using --vars=<FILE>, takes priority ALWAYS. NO auto-load! 3. Using --pki-dir=<DIR>, allows "$EASYRSA_PKI/vars". Use auto-load! Note: A user set PKI can auto-load a default vars file in the PKI, however, that can also conflict with a default ./vars file. 4. ERROR, if vars auto-load finds more than one VIABLE vars file. Viable vars files and conflicts: 1. "$PWD/vars" - Can conflict. 2. "$PWD/pki/vars" - Can conflict. 3. "$EASYRSA/vars" - User defined EASYRSA, no conflict. 4. "$EASYRSA_PKI/vars" - User defined EASYRSA_PKI, can conflict. This is achieved by making the following changes: Prioritise user-set EASYRSA to force "$EASYRSA/vars" ONLY. No auto-load. Expand assigning EASYRSA_PKI/vars to test for user-set PKI or default PKI. Use auto-load. Remove unused code and improve comments. Signed-off-by: Richard T Bonhomme <[email protected]>
Signed-off-by: Richard T Bonhomme <[email protected]>
The FINAL stage:
|
If a vars file in the PKI tries to change the expected PKI then fail. Allow vars file in the working directory to change the PKI. Signed-off-by: Richard T Bonhomme <[email protected]>
|
Signed-off-by: Richard T Bonhomme <[email protected]>
Signed-off-by: Richard T Bonhomme <[email protected]>
Signed-off-by: Richard T Bonhomme <[email protected]>
Signed-off-by: Richard T Bonhomme <[email protected]>
This refines the automatic loading of a
vars
file.