Class InstallerProperties
java.lang.Object
net.shibboleth.idp.installer.impl.InstallerProperties
Class which encapsulated all the properties/UI driven configuration of an install.
NOTE Updated to this properties should be reflected in the "PropertyDriverInstallation" wiki page."/
-
Field Summary
FieldsModifier and TypeFieldDescriptionThose modules which are "core".private Stringcredentials key file mode.static final intWhether to tidy up after ourselves.Those modules enabled by default.static final StringThe entity ID.private StringThe entity ID.static final StringGroup to set on files in the credential and conf directories.static final StringWhat is the installer host name?private StringHostname.static final StringThe name of a property file to merge with idp.properties.static final StringWhich modules to enable on initial install.private final org.apache.tools.ant.input.InputHandlerInput handler from the prompting.private PropertiesThe properties driving the install.static final StringThe the key size to generate.static final StringThe keystore password to use.private intKey Size.private StringKeystore Password.static final StringThe LDAP Password (usually associated with a username in ldap.properties).static final StringThe name of a property file to merge with ldap.properties.private final org.slf4j.LoggerClass logger.static final StringMode to set on credential *key files.static final StringDo we cause a failure rather than a prompt.static final StringWhether to tidy up after ourselves.private booleanDo we allow prompting?static final StringDo we do any chgrp/chmod work?static final StringThe name of a property file to fill in some or all of the above.private Stringscope.static final StringThe scope to assert.static final StringThe sealer alias to use.static final StringThe keysize for the sealer.static final StringThe sealer password to use.private StringSealer Alias.private StringSealer Password.private booleanwhether to tidy up.private final PathThe sourceDirectory.static final StringWhere to install to.private PathThe target Directory.private booleanwhether to tidy up. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate StringFind the most apposite network connector, taken from Ant.protected StringEvaluate the default scope value.protected voidInitialization routine.Get the modules to enable before ant install.Group to set on all files in credentials and conf.Mode to set on all files in credentials.Get the EntityId for this install.Get the host name for this install.Get the a file to merge with idp.properties or null.protected org.apache.tools.ant.input.InputHandlerGet anInputHandlerfor the prompting.intGet the key size for signing, encryption and backchannelGet the password for the keystore for this installation.Get the a file to merge with ldap.properties or null.Get the LDAP password iff one was provided.protected PathgetMergeFile(String propName) Get the file specified as the property as a File, or null if it doesn't exist.Get the modules to enable after first install.protected StringgetPassword(String propertyName, String prompt) Lookup a property; if it isn't defined then ask the user (if we are allowed) via a no-echo interface.getScope()Get the scope for this installation.Get the alias for the sealer key.(package private) IntegerReturn the sealer key size, if this has been specified.Get the password for the sealer for this installation.Where is the install coming from?Get the SubjectAltName for the certificates.Get where we are installing/updating/building the war.protected StringgetValue(String propertyName, String prompt, NonnullSupplier<String> defaultSupplier) Lookup a property; if it isn't defined then ask the user (if we are allowed).private booleanhasHostName(InetAddress addr) Is this address named?booleanisNoTidy()Does the user want us to *not* tidy up?booleanDo we set the mode?
-
Field Details
-
PROPERTY_SOURCE_FILE
The name of a property file to fill in some or all of the above. This file is deleted after processing.- See Also:
-
IDP_PROPERTIES_MERGE
The name of a property file to merge with idp.properties.- See Also:
-
LDAP_PROPERTIES_MERGE
The name of a property file to merge with ldap.properties.- See Also:
-
LDAP_PASSWORD
The LDAP Password (usually associated with a username in ldap.properties).- See Also:
-
TARGET_DIR
Where to install to. Default is basedir- See Also:
-
ENTITY_ID
The entity ID.- See Also:
-
NO_PROMPT
Do we cause a failure rather than a prompt.- See Also:
-
HOST_NAME
What is the installer host name?- See Also:
-
SCOPE
The scope to assert.- See Also:
-
KEY_STORE_PASSWORD
The keystore password to use.- See Also:
-
SEALER_PASSWORD
The sealer password to use.- See Also:
-
SEALER_ALIAS
The sealer alias to use.- See Also:
-
SEALER_KEYSIZE
The keysize for the sealer.- See Also:
-
KEY_SIZE
The the key size to generate.- See Also:
-
MODE_CREDENTIAL_KEYS
Mode to set on credential *key files.- See Also:
-
GROUP_CONF_CREDENTIALS
Group to set on files in the credential and conf directories.- See Also:
-
PERFORM_SET_MODE
Do we do any chgrp/chmod work?- See Also:
-
NO_TIDY
Whether to tidy up after ourselves.- See Also:
-
INITIAL_INSTALL_MODULES
Which modules to enable on initial install.- Since:
- 4.1.0
- See Also:
-
DEFAULT_KEY_SIZE
public static final int DEFAULT_KEY_SIZEWhether to tidy up after ourselves.- See Also:
-
CORE_MODULES
Those modules which are "core". -
DEFAULT_MODULES
Those modules enabled by default. -
log
@Nonnull private final org.slf4j.Logger logClass logger. -
installerProperties
The properties driving the install. -
targetDir
The target Directory. -
srcDir
The sourceDirectory. -
noPrompt
private boolean noPromptDo we allow prompting? -
entityID
The entity ID. -
hostname
Hostname. -
scope
scope. -
keyStorePassword
Keystore Password. -
sealerPassword
Sealer Password. -
sealerAlias
Sealer Alias. -
keySize
private int keySizeKey Size. (for signing, encryption and backchannel). -
tidy
private boolean tidywhether to tidy up. -
setGroupAndMode
private boolean setGroupAndModewhether to tidy up. -
credentialsKeyFileMode
credentials key file mode. -
inputHandler
@Nonnull private final org.apache.tools.ant.input.InputHandler inputHandlerInput handler from the prompting.
-
-
Constructor Details
-
InstallerProperties
Constructor.- Parameters:
sourceDir- Where the *source* installation is
-
-
Method Details
-
getInputHandler
@Nonnull protected org.apache.tools.ant.input.InputHandler getInputHandler()Get anInputHandlerfor the prompting.- Returns:
- an input handler
-
doInitialize
Initialization routine.- Throws:
ComponentInitializationException- if initialization fails
-
getPassword
@Nonnull protected String getPassword(String propertyName, String prompt) throws org.apache.tools.ant.BuildException Lookup a property; if it isn't defined then ask the user (if we are allowed) via a no-echo interface.Note that this does not work within a debugger.
- Parameters:
propertyName- the property to lookupprompt- what to say to the user- Returns:
- the value (this is not echoed to the terminal)
- Throws:
org.apache.tools.ant.BuildException- of anything goes wrong
-
getTargetDir
Get where we are installing/updating/building the war.This is slightly complicated because the default depends on what we are doing.
- Returns:
- the target directory
- Throws:
org.apache.tools.ant.BuildException- if something goes awry
-
getSourceDir
Where is the install coming from?- Returns:
- the source directory
-
getEntityID
Get the EntityId for this install.- Returns:
- the name
-
isNoTidy
public boolean isNoTidy()Does the user want us to *not* tidy up?- Returns:
- do we not tidy up?
-
hasHostName
Is this address named?Helper method for
bestHostName().- Parameters:
addr- what to look at- Returns:
- true unless the name is the canonical name
-
bestHostName
Find the most apposite network connector, taken from Ant.- Returns:
- the best name we can work out
-
getHostName
Get the host name for this install.Defaults to information pulled from the network.
- Returns:
- the host name.
-
getCredentialsKeyFileMode
Mode to set on all files in credentials.- Returns:
- the mode
-
getCredentialsGroup
Group to set on all files in credentials and conf.- Returns:
- the mode or null if none to be set
-
isSetGroupAndMode
public boolean isSetGroupAndMode()Do we set the mode?- Returns:
- do we the mode
-
defaultScope
Evaluate the default scope value.- Returns:
- everything after the first '.' in
getHostName()
-
getScope
Get the scope for this installation.- Returns:
- the scope
-
getLDAPPassword
Get the LDAP password iff one was provided. DO NOT PROMPT- Returns:
- the password if provided by a properties
- Throws:
org.apache.tools.ant.BuildException- if badness happens
-
getSubjectAltName
Get the SubjectAltName for the certificates.- Returns:
- the SubjectAltName
-
getKeyStorePassword
Get the password for the keystore for this installation.- Returns:
- the password.
-
getSealerPassword
Get the password for the sealer for this installation.- Returns:
- the password.
-
getModulesToEnable
Get the modules to enable after first install.- Returns:
- the modules
-
getCoreModules
Get the modules to enable before ant install.- Returns:
- the modules
-
getSealerKeySize
Return the sealer key size, if this has been specified.- Returns:
- the key size or null if non specified
- Throws:
org.apache.tools.ant.BuildException- if the size was not an integer
-
getSealerAlias
Get the alias for the sealer key.- Returns:
- the alias
-
getKeySize
public int getKeySize()Get the key size for signing, encryption and backchannel- Returns:
- the keysize, default is 3072.
-
getMergeFile
Get the file specified as the property as a File, or null if it doesn't exist.- Parameters:
propName- the name to lookup- Returns:
- null if the property is not provided a
Pathotherwise - Throws:
org.apache.tools.ant.BuildException- if the property is supplied but the file doesn't exist.
-
getIdPMergeProperties
Get the a file to merge with idp.properties or null.- Returns:
- the file or null if it none required
- Throws:
org.apache.tools.ant.BuildException- if badness happens
-
getLDAPMergeProperties
Get the a file to merge with ldap.properties or null.- Returns:
- the path or null if it none required
- Throws:
org.apache.tools.ant.BuildException- if badness happens
-