Integrate Bitrock delivery fixing various bugs/improvements in installer validation tool:

- ACE-2940 installer validations are occurring too early in the flow
 - ACE-2941 installer error messages for failed environment validations should be localisable
 - ACE-2942 installer environment validation messages are displayed incorrectly (i.e. in popups)
 - ACE-2943 installer should not check CIFS ports on Windows 
 - ACE-2944 on Unix-like OSes, the installer should not check ports < 1024 if not running as root


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@85977 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Samuel Langlois
2014-09-30 09:00:31 +00:00
parent fc1a8dfed2
commit d2cd775fe8

View File

@@ -1,6 +1,6 @@
<component> <component>
<name>alfrescovalidations</name> <name>alfrescovalidations</name>
<description></description> <description>Alfresco Validations</description>
<detailedDescription></detailedDescription> <detailedDescription></detailedDescription>
<selected>1</selected> <selected>1</selected>
<show>0</show> <show>0</show>
@@ -21,6 +21,172 @@
</alfrescoAutodetectJava> </alfrescoAutodetectJava>
</actionList> </actionList>
</actionDefinition> </actionDefinition>
<actionDefinition name="alfrescoSystemValidations">
<actionList>
<setInstallerVariable name="reportValue" value=""/>
<setInstallerVariable name="msgArchitectureWarning" value="${tr('64bit architecture recommended')}"/>
<setInstallerVariable name="msgCpuSpeed" value="${tr('Insufficient CPU clock speed')}"/>
<setInstallerVariable name="msgCpuCores" value="${tr('Insufficient CPUs (cores)')}"/>
<setInstallerVariable name="msgRam" value="${tr('Insufficient system RAM')}"/>
<setInstallerVariable name="msgFileDescriptors" value="${tr('Insufficent file descriptors')}"/>
<setInstallerVariable name="msgCifsUdp" value="${tr('CIFS UDP ports in use')}"/>
<setInstallerVariable name="msgCifsTcp" value="${tr('CIFS TCP ports in use')}"/>
<setInstallerVariable name="msgSmtpTcp" value="${tr('SMTP TCP port in use')}"/>
<setInstallerVariable name="msgImapTcp" value="${tr('IMAP TCP port in use')}"/>
<throwError>
<text>This installer is for Windows 64 bit. Please download the Windows 32 bit version.</text>
<ruleList>
<compareText text="${project.installerFilename}" logic="contains" value="win-x64"/>
<platformTest type="windows"/>
<platformTest type="windows-x64" negate="1"/>
</ruleList>
</throwError>
<setInstallerVariable name="reportValue" value="${reportValue}${msgArchitectureWarning}: 32bit&#xA;">
<ruleList>
<compareText text="${project.installerFilename}" logic="does_not_contain" value="win-x64"/>
<platformTest type="windows-x64"/>
</ruleList>
</setInstallerVariable>
<!-- Server Hardware -->
<!-- CPU Speed validation -->
<mathExpression text="int(ceil(${machine_cpu_speed}/1000))" variable="machine_cpu_speedGHz"/>
<mathExpression text="int(ceil(${minimum_cpu_speed}/1000))" variable="minimum_cpu_speedGHz"/>
<mathExpression text="int(ceil(${recommended_cpu_speed}/1000))" variable="recommended_cpu_speedGHz"/>
<throwError>
<text>CPU clock speed of ${machine_cpu_speedGHz} GHz is slower than the minimum required by Alfresco (${minimum_cpu_speedGHz} GHz). Alfresco will not perform well. Upgrade the server to one with more modern CPUs (CPU clock speed of at least ${minimum_cpu_speedGHz} GHz, and preferably ${recommended_cpu_speedGHz} GHz or more).</text>
<ruleList>
<compareValues>
<logic>less</logic>
<value1>${machine_cpu_speed}</value1>
<value2>${minimum_cpu_speed}</value2>
</compareValues>
</ruleList>
</throwError>
<setInstallerVariable name="reportValue" value="${reportValue}${msgCpuSpeed} (${recommended_cpu_speedGHz} GHz+): ${machine_cpu_speedGHz} GHz&#xA;">
<ruleList>
<compareValues>
<logic>less</logic>
<value1>${machine_cpu_speed}</value1>
<value2>${recommended_cpu_speed}</value2>
</compareValues>
<compareValues>
<logic>greater_or_equal</logic>
<value1>${machine_cpu_speed}</value1>
<value2>${minimum_cpu_speed}</value2>
</compareValues>
</ruleList>
</setInstallerVariable>
<!-- CPU Cores validation -->
<setInstallerVariable name="reportValue" value="${reportValue}${msgCpuCores} (${minimum_core_count}+): ${machine_cpu_count}&#xA;">
<ruleList>
<compareValues>
<logic>less</logic>
<value1>${machine_cpu_count}</value1>
<value2>${minimum_core_count}</value2>
</compareValues>
</ruleList>
</setInstallerVariable>
<!-- RAM validation -->
<mathExpression text="int(ceil(${machine_total_memory}/1024))" variable="machine_total_memoryGB"/>
<mathExpression text="int(ceil(${minimum_ram}/1024))" variable="minimum_ramGB"/>
<mathExpression text="int(ceil(${recommended_ram}/1024))" variable="recommended_ramGB"/>
<throwError>
<text>${machine_total_memoryGB} GB of RAM is not enough to run Alfresco for test or production purposes. Alfresco may not function correctly and if it does, it will not perform well. Upgrade the server to have at least ${minimum_ramGB} GB of RAM (preferably at least ${recommended_ramGB} GB).</text>
<ruleList>
<compareValues>
<logic>less</logic>
<value1>${machine_total_memory}</value1>
<value2>${minimum_ram}</value2>
</compareValues>
</ruleList>
</throwError>
<setInstallerVariable name="reportValue" value="${reportValue}${msgRam} (${recommended_ramGB}GB+): ${machine_total_memoryGB}GB">
<ruleList>
<compareValues>
<logic>less</logic>
<value1>${machine_total_memory}</value1>
<value2>${recommended_ram}</value2>
</compareValues>
<compareValues>
<logic>greater_or_equal</logic>
<value1>${machine_total_memory}</value1>
<value2>${minimum_ram}</value2>
</compareValues>
</ruleList>
</setInstallerVariable>
<!-- File Descriptors validation-->
<setInstallerVariable name="reportValue" value="${reportValue}${msgFileDescriptors} (${minimum_file_descriptors}+)">
<ruleList>
<resourceLimitTest type="open_files" logic="less" value="${minimum_file_descriptors}"/>
<platformTest type="windows" negate="1"/>
</ruleList>
</setInstallerVariable>
<!-- Network validation -->
<actionGroup>
<actionList>
<!-- Validate CIFS ports -->
<setInstallerVariable name="cifsUdpPortList" value=""/>
<foreach variables="cifs_udp_port_to_check">
<values>${netbd_port}, ${netbd_port_1}</values>
<actionList>
<setInstallerVariable name="cifsUdpPortList" value="${cifsUdpPortList} ${cifs_udp_port_to_check}">
<ruleList>
<portTest port="${cifs_udp_port_to_check}" condition="cannot_bind"/>
<platformTest type="windows" negate="1"/>
</ruleList>
</setInstallerVariable>
</actionList>
</foreach>
<setInstallerVariable name="reportValue" value="${reportValue}${msgCifsUdp}: ${cifsUdpPortList}&#xA;">
<ruleList>
<compareText text="${cifsUdpPortList}" logic="does_not_equal" value=""/>
</ruleList>
</setInstallerVariable>
<setInstallerVariable name="cifsTcpPortList" value=""/>
<foreach variables="cifs_tcp_port_to_check">
<values>${netbd_port}, ${netbd_port_2}, ${smb_port}</values>
<actionList>
<setInstallerVariable name="cifsTcpPortList" value="${cifsTcpPortList} ${cifs_tcp_port_to_check}">
<ruleList>
<portTest port="${cifs_tcp_port_to_check}" condition="cannot_bind"/>
<platformTest type="windows" negate="1"/>
</ruleList>
</setInstallerVariable>
</actionList>
</foreach>
<setInstallerVariable name="reportValue" value="${reportValue}${msgCifsTcp}: ${cifsTcpPortList}&#xA;">
<ruleList>
<compareText text="${cifsTcpPortList}" logic="does_not_equal" value=""/>
</ruleList>
</setInstallerVariable>
<setInstallerVariable name="reportValue" value="${reportValue}${msgSmtpTcp}: ${smtp_port}&#xA;">
<ruleList>
<portTest port="${smtp_port}" condition="cannot_bind"/>
</ruleList>
</setInstallerVariable>
<setInstallerVariable name="reportValue" value="${reportValue}${msgImapTcp}: ${smtp_port}&#xA;">
<ruleList>
<portTest port="${imap_port}" condition="cannot_bind"/>
</ruleList>
</setInstallerVariable>
</actionList>
<ruleList>
<isTrue value="${installer_is_root_install}"/>
</ruleList>
</actionGroup>
<setInstallerVariable name="component(alfrescovalidations).parameter(alfresco_report).value" value="${reportValue}">
<ruleList>
<compareText text="${reportValue}" value="" logic="does_not_equal"/>
</ruleList>
</setInstallerVariable>
<setInstallerVariable name="component(alfrescovalidations).parameter(alfresco_report).ask" value="0">
<ruleList>
<compareText text="${reportValue}" value="" logic="equals"/>
</ruleList>
</setInstallerVariable>
</actionList>
</actionDefinition>
</functionDefinitionList> </functionDefinitionList>
<componentSelectionValidationActionList> <componentSelectionValidationActionList>
<alfrescoComponentsValidations/> <alfrescoComponentsValidations/>
@@ -59,190 +225,19 @@
<stringParameter name="imap_port" value="143" ask="0"> <stringParameter name="imap_port" value="143" ask="0">
<description>IMAP port</description> <description>IMAP port</description>
</stringParameter> </stringParameter>
<infoParameter>
<name>alfresco_report</name>
<title>Warning!</title>
<explanation>This environment is not configured optimally for Alfresco - please carefully review this list before continuing.
While these issues will not prevent Alfresco from functioning, some product features may be unavailable, or the system may not perform optimally.</explanation>
<value></value>
<insertBefore>readytoinstall</insertBefore>
</infoParameter>
</parameterList> </parameterList>
<initializationActionList> <readyToInstallActionList/>
<throwError>
<text>This installer is for Windows 64 bit. Please download the Windows 32 bit version.</text>
<ruleList>
<compareText text="${project.installerFilename}" logic="contains" value="win-x64"/>
<platformTest type="windows"/>
<platformTest type="windows-x64" negate="1"/>
</ruleList>
</throwError>
<!-- Network validation -->
<!-- Validate CIFS ports -->
<setInstallerVariable name="portList" value=""/>
<foreach variables="port_to_check">
<values>${netbd_port}, ${netbd_port_1}, ${netbd_port_2}, ${smb_port}</values>
<actionList>
<setInstallerVariable name="portList" value="${portList} ${port_to_check}">
<ruleList>
<portTest port="${port_to_check}" condition="cannot_bind"/>
</ruleList>
</setInstallerVariable>
</actionList>
</foreach>
<showWarning>
<text>CIFS protocol will be unavailable. Check for running processes that are using the following ports: ${portList} (eg. existing CIFS servers).</text>
<ruleList>
<compareText text="${portList}" logic="does_not_equal" value=""/>
<isTrue value="${installer_is_root_install}"/>
</ruleList>
</showWarning>
<showWarning>
<text>CIFS protocol will be unavailable. Cannot bind ports: ${portList}. Consider reconfiguring Alfresco to use a non-privileged port then use a port forwarding tool (such as iptables) to forward this port</text>
<ruleList>
<compareText text="${portList}" logic="does_not_equal" value=""/>
<isFalse value="${installer_is_root_install}"/>
</ruleList>
</showWarning>
<!--Validate SMTP port-->
<showInfo>
<text>SMTP protocol will be unavailable (note: not enabled by default). Check for running processes that are using ${smtp_port} (eg. existing SMTP servers)</text>
<ruleList>
<isTrue value="${installer_is_root_install}"/>
<portTest port="${smtp_port}" condition="cannot_bind"/>
</ruleList>
</showInfo>
<showInfo>
<text>SMTP protocol will be unavailable (note: not enabled by default). Cannot bind port ${smtp_port}. Consider reconfiguring Alfresco to use a non-privileged port then use a port forwarding tool (such as iptables) to forward this port.</text>
<ruleList>
<isFalse value="${installer_is_root_install}"/>
<portTest port="${smtp_port}" condition="cannot_bind"/>
</ruleList>
</showInfo>
<!--Validate IMAP port-->
<showInfo>
<text>IMAP protocol will be unavailable (note: not enabled by default). Check for running processes that are using ${imap_port} (eg. existing IMAP servers), on non-Windows OSes consider reconfiguring Alfresco to use a non-privileged port then use a port forwarding tool (such as iptables) to forward this port</text>
<ruleList>
<isTrue value="${installer_is_root_install}"/>
<portTest port="${imap_port}" condition="cannot_bind"/>
</ruleList>
</showInfo>
<!--Validate IMAP port-->
<showInfo>
<text>IMAP protocol will be unavailable (note: not enabled by default). Cannot bind port ${imap_port}. Consider reconfiguring Alfresco to use a non-privileged port then use a port forwarding tool (such as iptables) to forward this port</text>
<ruleList>
<isFalse value="${installer_is_root_install}"/>
<portTest port="${imap_port}" condition="cannot_bind"/>
</ruleList>
</showInfo>
<!-- Database check. We will not implement it for now-->
<!-- File Descriptors validation-->
<showWarning>
<text>Alfresco requires at least ${minimum_file_descriptors} file descriptors. While Alfresco will start correctly, you will likely see errors during indexing of content into the search engine. Increase the number of file descriptors available to Alfresco.</text>
<ruleList>
<resourceLimitTest type="open_files" logic="less" value="${minimum_file_descriptors}"/>
<platformTest type="windows" negate="1"/>
</ruleList>
</showWarning>
<!-- Server Hardware -->
<!-- CPU Speed validation -->
<showWarning>
<text>CPU clock speed of ${machine_cpu_speed} Mhz is slower than that recommended for test or production use (${recommended_cpu_speed} Mhz). Alfresco will perform well for development purposes but this server should not be used for other purposes. Upgrade the server to one with more modern CPUs (CPU clock speed of at least ${recommended_cpu_speed} Mhz).</text>
<ruleList>
<compareValues>
<logic>less</logic>
<value1>${machine_cpu_speed}</value1>
<value2>${recommended_cpu_speed}</value2>
</compareValues>
<compareValues>
<logic>greater_or_equal</logic>
<value1>${machine_cpu_speed}</value1>
<value2>${minimum_cpu_speed}</value2>
</compareValues>
</ruleList>
</showWarning>
<throwError>
<text>CPU clock speed of ${machine_cpu_speed} Mhz is slower than the minimum required by Alfresco (${minimum_cpu_speed} Mhz). Alfresco will not perform well. Upgrade the server to one with more modern CPUs (CPU clock speed of at least ${minimum_cpu_speed} Mhz, and preferably ${recommended_cpu_speed} Mhz or more).</text>
<ruleList>
<compareValues>
<logic>less</logic>
<value1>${machine_cpu_speed}</value1>
<value2>${minimum_cpu_speed}</value2>
</compareValues>
</ruleList>
</throwError>
<showWarning>
<text>Unable to determine CPU clock speed. This machine may not be fast enough to run Alfresco for test or production purposes. Manually validate that the CPU clock speed of this server is at least ${minimum_cpu_speed} Mhz.</text>
<ruleList>
<compareValues>
<logic>equals</logic>
<value1>${machine_cpu_speed}</value1>
<value2>0</value2>
</compareValues>
</ruleList>
</showWarning>
<!-- CPU Cores validation -->
<showWarning>
<text>This machine does not have enough CPUs (cores) to run Alfresco for non-development purposes. Alfresco will function well for development purposes but this server should not be used for any other purpose. Upgrade the server to have at least ${minimum_core_count} CPUs (cores)</text>
<ruleList>
<compareValues>
<logic>less</logic>
<value1>${machine_cpu_count}</value1>
<value2>${minimum_core_count}</value2>
</compareValues>
</ruleList>
</showWarning>
<showWarning>
<text>Unable to determine CPU (core) count. This machine may not have enough CPUs (cores) to run Alfresco for non-development purposes. Manually validate that this machine has at least ${minimum_core_count} CPUs (cores)</text>
<ruleList>
<compareValues>
<logic>equals</logic>
<value1>${machine_cpu_count}</value1>
<value2>0</value2>
</compareValues>
</ruleList>
</showWarning>
<!-- RAM validation -->
<throwError>
<text>${machine_total_memory} MB of RAM is not enough to run Alfresco for test or production purposes. Alfresco may not function correctly and if it does, it will not perform well. Upgrade the server to have at least ${minimum_ram} MB of RAM (preferably at least ${recommended_ram} MB).</text>
<ruleList>
<compareValues>
<logic>less</logic>
<value1>${machine_total_memory}</value1>
<value2>${minimum_ram}</value2>
</compareValues>
</ruleList>
</throwError>
<showWarning>
<text>${machine_total_memory} MB of RAM is not enough to run Alfresco for test or production purposes. Alfresco will function well for development purposes but this server should not be used for other purposes. Upgrade the server to have at least ${recommended_ram} MB of RAM</text>
<ruleList>
<compareValues>
<logic>less</logic>
<value1>${machine_total_memory}</value1>
<value2>${recommended_ram}</value2>
</compareValues>
<compareValues>
<logic>greater_or_equal</logic>
<value1>${machine_total_memory}</value1>
<value2>${minimum_ram}</value2>
</compareValues>
</ruleList>
</showWarning>
<!-- <showWarning>
<text>Alfresco recommends installation on a server with at least 4GB of RAM (this server has ${machine_total_memory} MB of memory). You may continue the installation, but please be aware that Alfresco may not perform optimally.</text>
<ruleList>
<compareValues value1="${machine_total_memory}" logic="less" value2="4096"/>
<compareValues value1="${machine_total_memory}" logic="greater_or_equal" value2="${recommended_ram}"/>
</ruleList>
</showWarning>-->
<showWarning>
<text>Unable to determine size of installed RAM. This machine may not have sufficient RAM to run Alfresco correctly. Manually validate that this server has at least ${minimum_ram} MB (preferably at least ${recommended_ram} MB) of RAM installed.</text>
<ruleList>
<compareValues>
<logic>equals</logic>
<value1>${machine_total_memory}</value1>
<value2>0</value2>
</compareValues>
</ruleList>
</showWarning>
</initializationActionList>
<preInstallationActionList> <preInstallationActionList>
<alfrescoSystemValidations/>
<alfrescoComponentsValidations> <alfrescoComponentsValidations>
<ruleList> <ruleList>
<compareText text="${installer_ui}" logic="equals" value="unattended"/> <compareText text="${installer_ui}" logic="equals" value="unattended"/>