Merge branch 'develop' of https://github.com/sleuthkit/autopsy into develop

This commit is contained in:
momo 2015-10-15 10:29:12 -04:00
commit e32fb92f21
43 changed files with 722 additions and 250 deletions

View File

@ -39,6 +39,7 @@ import javax.swing.JOptionPane;
import org.sleuthkit.autopsy.casemodule.Case.CaseType;
import org.sleuthkit.autopsy.core.UserPreferences;
import org.sleuthkit.datamodel.CaseDbConnectionInfo;
import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.TskData.DbType;
/**
@ -112,7 +113,7 @@ final class NewCaseWizardAction extends CallableSystemAction {
get();
CaseType currentCaseType = CaseType.values()[(int) wizardDescriptor.getProperty("caseType")]; //NON-NLS
CaseDbConnectionInfo info = UserPreferences.getDatabaseConnectionInfo();
if ((currentCaseType == CaseType.SINGLE_USER_CASE) || ((info.getDbType() != DbType.SQLITE) && info.canConnect())) {
if ((currentCaseType == CaseType.SINGLE_USER_CASE) || ((info.getDbType() != DbType.SQLITE) && SleuthkitCase.tryConnectOld(info.getHost(), info.getPort(), info.getUserName(), info.getPassword(), info.getDbType()))) {
AddImageAction addImageAction = SystemAction.get(AddImageAction.class);
addImageAction.actionPerformed(null);
} else {

View File

@ -19,5 +19,6 @@ ServicesMonitor.restoredService.notify.msg=Connection to {0} is up
ServicesMonitor.statusChange.notify.title=Service Status Update
ServicesMonitor.statusChange.notify.msg=Status for {0} is {1}
ServicesMonitor.nullServiceName.excepton.txt=Requested service name is null
ServicesMonitor.nullStatusOrDetails.excepton.txt=Status or details string is null
ServicesMonitor.unknownServiceName.excepton.txt=Requested service name {0} is unknown
ServicesMonitor.unknownServiceName.excepton.txt=Requested service name {0} is unknown
ServicesMonitor.KeywordSearchNull=Cannot find Keyword Search service
ServicesMonitor.InvalidPortNumber=Invalid port number.

View File

@ -34,6 +34,12 @@ import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
import org.sleuthkit.autopsy.events.AutopsyEventPublisher;
import org.sleuthkit.autopsy.keywordsearchservice.KeywordSearchService;
import org.sleuthkit.autopsy.events.MessageServiceConnectionInfo;
import org.sleuthkit.autopsy.events.MessageServiceException;
import org.sleuthkit.autopsy.keywordsearchservice.KeywordSearchServiceException;
import org.sleuthkit.datamodel.CaseDbConnectionInfo;
import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.TskCoreException;
/**
* This class periodically checks availability of collaboration resources -
@ -149,28 +155,8 @@ public class ServicesMonitor {
* @param status Updated status for the service.
* @param details Details of the event.
*
* @throws
* org.sleuthkit.autopsy.core.ServicesMonitor.ServicesMonitorException Thrown
* if
* either
* of
* input
* parameters
* is
* null.
*/
public void setServiceStatus(String service, String status, String details) throws ServicesMonitorException {
if (service == null) {
logger.log(Level.SEVERE, "Call to setServiceStatus() with null service name"); //NON-NLS
throw new ServicesMonitorException(NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.nullServiceName.excepton.txt"));
}
if (status == null || details == null) {
logger.log(Level.SEVERE, "Call to setServiceStatus() with null status or details"); //NON-NLS
throw new ServicesMonitorException(NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.nullStatusOrDetails.excepton.txt"));
}
public void setServiceStatus(String service, String status, String details) {
// if the status update is for an existing service who's status hasn't changed - do nothing.
if (statusByService.containsKey(service) && status.equals(statusByService.get(service))) {
return;
@ -211,15 +197,8 @@ public class ServicesMonitor {
*
* @return ServiceStatus Status for the service.
*
* @throws
* org.sleuthkit.autopsy.core.ServicesMonitor.ServicesMonitorException Thrown
* if
* service
* name is
* null or
* service
* doesn't
* exist.
* @throws ServicesMonitorException If service name is null or service
* doesn't exist.
*/
public String getServiceStatus(String service) throws ServicesMonitorException {
@ -260,14 +239,12 @@ public class ServicesMonitor {
* Performs case database service availability status check.
*/
private void checkDatabaseConnectionStatus() {
CaseDbConnectionInfo info = UserPreferences.getDatabaseConnectionInfo();
try {
if (UserPreferences.getDatabaseConnectionInfo().canConnect()) {
setServiceStatus(Service.REMOTE_CASE_DATABASE.toString(), ServiceStatus.UP.toString(), "");
} else {
setServiceStatus(Service.REMOTE_CASE_DATABASE.toString(), ServiceStatus.DOWN.toString(), "");
}
} catch (Exception ex) {
logger.log(Level.SEVERE, "Exception while checking database connection status", ex); //NON-NLS
SleuthkitCase.tryConnect(info);
setServiceStatus(Service.REMOTE_CASE_DATABASE.toString(), ServiceStatus.UP.toString(), "");
} catch (TskCoreException ex) {
setServiceStatus(Service.REMOTE_CASE_DATABASE.toString(), ServiceStatus.DOWN.toString(), ex.getMessage());
}
}
@ -275,15 +252,24 @@ public class ServicesMonitor {
* Performs keyword search service availability status check.
*/
private void checkKeywordSearchServerConnectionStatus() {
KeywordSearchService kwsService = Lookup.getDefault().lookup(KeywordSearchService.class);
try {
KeywordSearchService kwsService = Lookup.getDefault().lookup(KeywordSearchService.class);
if (kwsService != null && kwsService.canConnectToRemoteSolrServer(UserPreferences.getIndexingServerHost(), UserPreferences.getIndexingServerPort())) {
if (kwsService != null) {
int port = Integer.parseUnsignedInt(UserPreferences.getIndexingServerPort());
kwsService.tryConnect(UserPreferences.getIndexingServerHost(), port);
setServiceStatus(Service.REMOTE_KEYWORD_SEARCH.toString(), ServiceStatus.UP.toString(), "");
} else {
setServiceStatus(Service.REMOTE_KEYWORD_SEARCH.toString(), ServiceStatus.DOWN.toString(), "");
setServiceStatus(Service.REMOTE_KEYWORD_SEARCH.toString(), ServiceStatus.DOWN.toString(),
NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.KeywordSearchNull"));
}
} catch (Exception ex) {
logger.log(Level.SEVERE, "Exception while checking keyword search server connection status", ex); //NON-NLS
} catch (NumberFormatException ex) {
String rootCause = NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.InvalidPortNumber");
logger.log(Level.SEVERE, "Unable to connect to messaging server: " + rootCause, ex); //NON-NLS
setServiceStatus(Service.REMOTE_KEYWORD_SEARCH.toString(), ServiceStatus.DOWN.toString(), rootCause);
} catch (KeywordSearchServiceException ex) {
String rootCause = ex.getMessage();
logger.log(Level.SEVERE, "Unable to connect to messaging server: " + rootCause, ex); //NON-NLS
setServiceStatus(Service.REMOTE_KEYWORD_SEARCH.toString(), ServiceStatus.DOWN.toString(), rootCause);
}
}
@ -291,14 +277,14 @@ public class ServicesMonitor {
* Performs messaging service availability status check.
*/
private void checkMessagingServerConnectionStatus() {
MessageServiceConnectionInfo info = UserPreferences.getMessageServiceConnectionInfo();
try {
if (UserPreferences.getMessageServiceConnectionInfo().canConnect()) {
setServiceStatus(Service.MESSAGING.toString(), ServiceStatus.UP.toString(), "");
} else {
setServiceStatus(Service.MESSAGING.toString(), ServiceStatus.DOWN.toString(), "");
}
} catch (Exception ex) {
logger.log(Level.SEVERE, "Exception while checking messaging server connection status", ex); //NON-NLS
info.tryConnect();
setServiceStatus(Service.MESSAGING.toString(), ServiceStatus.UP.toString(), "");
} catch (MessageServiceException ex) {
String rootCause = ex.getMessage();
logger.log(Level.SEVERE, "Unable to connect to messaging server: " + rootCause, ex); //NON-NLS
setServiceStatus(Service.MESSAGING.toString(), ServiceStatus.DOWN.toString(), rootCause);
}
}
@ -397,6 +383,8 @@ public class ServicesMonitor {
*/
public class ServicesMonitorException extends Exception {
private static final long serialVersionUID = 1L;
public ServicesMonitorException(String message) {
super(message);
}

View File

@ -54,6 +54,8 @@ public final class UserPreferences {
public static final String PROCESS_TIME_OUT_ENABLED = "ProcessTimeOutEnabled"; //NON-NLS
public static final String PROCESS_TIME_OUT_HOURS = "ProcessTimeOutHours"; //NON-NLS
private static final int DEFAULT_PROCESS_TIMEOUT_HR = 60;
private static final String DEFAULT_PORT_STRING = "61616";
private static final int DEFAULT_PORT_INT = 61616;
// Prevent instantiation.
private UserPreferences() {
@ -131,7 +133,7 @@ public final class UserPreferences {
public static CaseDbConnectionInfo getDatabaseConnectionInfo() {
DbType dbType;
try {
dbType = DbType.valueOf(preferences.get(EXTERNAL_DATABASE_TYPE, "SQLITE"));
dbType = DbType.valueOf(preferences.get(EXTERNAL_DATABASE_TYPE, "POSTGRESQL"));
} catch (Exception ex) {
dbType = DbType.SQLITE;
}
@ -181,10 +183,10 @@ public final class UserPreferences {
* @param info An object encapsulating the message service info.
*/
public static void setMessageServiceConnectionInfo(MessageServiceConnectionInfo info) {
preferences.put(MESSAGE_SERVICE_HOST, info.getHost());
preferences.put(MESSAGE_SERVICE_PORT, Integer.toString(info.getPort()));
preferences.put(MESSAGE_SERVICE_USER, info.getUserName());
preferences.put(MESSAGE_SERVICE_PASSWORD, info.getPassword());
preferences.put(MESSAGE_SERVICE_HOST, info.getHost());
preferences.put(MESSAGE_SERVICE_PORT, info.getPort());
}
/**
@ -193,10 +195,19 @@ public final class UserPreferences {
* @return An object encapsulating the message service info.
*/
public static MessageServiceConnectionInfo getMessageServiceConnectionInfo() {
return new MessageServiceConnectionInfo(preferences.get(MESSAGE_SERVICE_USER, ""),
preferences.get(MESSAGE_SERVICE_PASSWORD, ""),
int port;
try {
port = Integer.parseInt(preferences.get(MESSAGE_SERVICE_PORT, DEFAULT_PORT_STRING));
} catch (NumberFormatException ex) {
// if there is an error parsing the port number, use the default port number
port = DEFAULT_PORT_INT;
}
return new MessageServiceConnectionInfo(
preferences.get(MESSAGE_SERVICE_HOST, ""),
preferences.get(MESSAGE_SERVICE_PORT, "61616"));
port,
preferences.get(MESSAGE_SERVICE_USER, ""),
preferences.get(MESSAGE_SERVICE_PASSWORD, ""));
}
/**

View File

@ -191,3 +191,8 @@ MultiUserSettingsPanel.tbMsgPassword.toolTipText=Password
MultiUserSettingsPanel.tbMsgPassword.text=
MultiUserSettingsPanel.tbMsgHostname.toolTipText=Hostname or IP Address
MultiUserSettingsPanel.tbMsgHostname.text=
MultiUserSettingsPanel.lbTestMessageWarning.text=
MultiUserSettingsPanel.lbTestSolrWarning.text=
MultiUserSettingsPanel.lbTestDbWarning.text=
MultiUserSettingsPanel.KeywordSearchNull=Cannot find Keyword Search service
MultiUserSettingsPanel.InvalidPortNumber=Invalid port number.

View File

@ -16,12 +16,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="pnOverallPanel" max="32767" attributes="0"/>
<Component id="pnOverallPanel" min="-2" pref="555" max="-2" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="pnOverallPanel" alignment="0" max="32767" attributes="0"/>
<Component id="pnOverallPanel" alignment="0" min="-2" pref="559" max="-2" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -57,10 +57,10 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="pnDatabaseSettings" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="pnSolrSettings" min="-2" pref="106" max="-2" attributes="0"/>
<Component id="pnSolrSettings" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="pnMessagingSettings" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<EmptySpace pref="39" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -78,7 +78,7 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="tbDbHostname" max="32767" attributes="0"/>
@ -92,6 +92,10 @@
<Component id="tbDbPort" alignment="0" max="32767" attributes="0"/>
<Component id="tbDbUsername" alignment="0" max="32767" attributes="0"/>
<Component id="tbDbPassword" alignment="0" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="lbTestDbWarning" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
@ -114,7 +118,9 @@
<Component id="tbDbUsername" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="tbDbPassword" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="13" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lbTestDbWarning" min="-2" pref="16" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -201,6 +207,16 @@
<Property name="autoscrolls" type="boolean" value="true"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lbTestDbWarning">
<Properties>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="0" green="0" red="ff" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="MultiUserSettingsPanel.lbTestDbWarning.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="pnSolrSettings">
@ -215,7 +231,7 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="tbSolrHostname" max="32767" attributes="0"/>
@ -227,6 +243,10 @@
<Component id="lbTestSolr" min="-2" pref="16" max="-2" attributes="0"/>
</Group>
<Component id="tbSolrPort" alignment="0" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="lbTestSolrWarning" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
@ -247,7 +267,9 @@
<Component id="tbSolrHostname" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="tbSolrPort" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="45" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lbTestSolrWarning" min="-2" pref="16" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -300,6 +322,16 @@
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lbTestSolrWarning">
<Properties>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="0" green="0" red="ff" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="MultiUserSettingsPanel.lbTestSolrWarning.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="pnMessagingSettings">
@ -314,7 +346,7 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="tbMsgHostname" max="32767" attributes="0"/>
@ -328,6 +360,10 @@
<Component id="tbMsgPort" alignment="0" max="32767" attributes="0"/>
<Component id="tbMsgUsername" alignment="0" max="32767" attributes="0"/>
<Component id="tbMsgPassword" alignment="0" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="lbTestMessageWarning" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
@ -344,7 +380,7 @@
</Group>
<Component id="lbTestMessageService" min="-2" pref="23" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="tbMsgHostname" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="tbMsgPort" min="-2" max="-2" attributes="0"/>
@ -353,6 +389,8 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="tbMsgPassword" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lbTestMessageWarning" min="-2" pref="16" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -437,6 +475,16 @@
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lbTestMessageWarning">
<Properties>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="0" green="0" red="ff" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="MultiUserSettingsPanel.lbTestMessageWarning.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JCheckBox" name="cbEnableMultiUser">

View File

@ -22,7 +22,11 @@ import java.util.logging.Level;
import javax.swing.ImageIcon;
import org.openide.util.ImageUtilities;
import org.openide.util.Lookup;
import org.sleuthkit.autopsy.events.MessageServiceException;
import org.sleuthkit.autopsy.keywordsearchservice.KeywordSearchService;
import org.sleuthkit.autopsy.keywordsearchservice.KeywordSearchServiceException;
import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.TskCoreException;
public final class MultiUserSettingsPanel extends javax.swing.JPanel {
@ -34,6 +38,7 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
private static final String INVALID_DB_PORT_MSG = NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.validationErrMsg.invalidDatabasePort");
private static final String INVALID_MESSAGE_SERVICE_PORT_MSG = NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.validationErrMsg.invalidMessageServicePort");
private static final String INVALID_INDEXING_SERVER_PORT_MSG = NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.validationErrMsg.invalidIndexingServerPort");
private static final int DEFAULT_MESSAGE_SERVICE_PORT = 61616;
private static final long serialVersionUID = 1L;
private final MultiUserSettingsPanelController controller;
private final Collection<JTextField> textBoxes = new ArrayList<>();
@ -41,7 +46,7 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
private static final Logger logger = Logger.getLogger(MultiUserSettingsPanel.class.getName());
private final ImageIcon goodIcon;
private final ImageIcon badIcon;
/**
* Creates new form AutopsyMultiUserSettingsPanel
*
@ -50,6 +55,7 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
public MultiUserSettingsPanel(MultiUserSettingsPanelController theController) {
initComponents();
controller = theController;
setSize(555, 600);
/**
* Add text prompts to all of the text fields.
@ -98,9 +104,6 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
addDocumentListeners(textBoxes, textBoxChangedListener);
goodIcon = new ImageIcon(ImageUtilities.loadImage("org/sleuthkit/autopsy/images/good.png", false));
badIcon = new ImageIcon(ImageUtilities.loadImage("org/sleuthkit/autopsy/images/bad.png", false));
lbTestDatabase.setIcon(null);
lbTestSolr.setIcon(null);
lbTestMessageService.setIcon(null);
enableMultiUserComponents(textBoxes, cbEnableMultiUser.isSelected());
}
@ -148,12 +151,14 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
lbDatabaseSettings = new javax.swing.JLabel();
bnTestDatabase = new javax.swing.JButton();
lbTestDatabase = new javax.swing.JLabel();
lbTestDbWarning = new javax.swing.JLabel();
pnSolrSettings = new javax.swing.JPanel();
lbSolrSettings = new javax.swing.JLabel();
tbSolrHostname = new javax.swing.JTextField();
tbSolrPort = new javax.swing.JTextField();
bnTestSolr = new javax.swing.JButton();
lbTestSolr = new javax.swing.JLabel();
lbTestSolrWarning = new javax.swing.JLabel();
pnMessagingSettings = new javax.swing.JPanel();
lbMessageServiceSettings = new javax.swing.JLabel();
tbMsgHostname = new javax.swing.JTextField();
@ -162,6 +167,7 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
tbMsgPassword = new javax.swing.JPasswordField();
bnTestMessageService = new javax.swing.JButton();
lbTestMessageService = new javax.swing.JLabel();
lbTestMessageWarning = new javax.swing.JLabel();
cbEnableMultiUser = new javax.swing.JCheckBox();
tbOops = new javax.swing.JTextField();
@ -197,6 +203,9 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
org.openide.awt.Mnemonics.setLocalizedText(lbTestDatabase, org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.lbTestDatabase.text")); // NOI18N
lbTestDatabase.setAutoscrolls(true);
lbTestDbWarning.setForeground(new java.awt.Color(255, 0, 0));
org.openide.awt.Mnemonics.setLocalizedText(lbTestDbWarning, org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.lbTestDbWarning.text")); // NOI18N
javax.swing.GroupLayout pnDatabaseSettingsLayout = new javax.swing.GroupLayout(pnDatabaseSettings);
pnDatabaseSettings.setLayout(pnDatabaseSettingsLayout);
pnDatabaseSettingsLayout.setHorizontalGroup(
@ -213,7 +222,10 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
.addComponent(lbTestDatabase, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(tbDbPort)
.addComponent(tbDbUsername)
.addComponent(tbDbPassword))
.addComponent(tbDbPassword)
.addGroup(pnDatabaseSettingsLayout.createSequentialGroup()
.addComponent(lbTestDbWarning)
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
);
pnDatabaseSettingsLayout.setVerticalGroup(
@ -232,7 +244,9 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
.addComponent(tbDbUsername, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(tbDbPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(13, 13, 13))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lbTestDbWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
pnSolrSettings.setBorder(javax.swing.BorderFactory.createEtchedBorder());
@ -255,6 +269,9 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
org.openide.awt.Mnemonics.setLocalizedText(lbTestSolr, org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.lbTestSolr.text")); // NOI18N
lbTestSolrWarning.setForeground(new java.awt.Color(255, 0, 0));
org.openide.awt.Mnemonics.setLocalizedText(lbTestSolrWarning, org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.lbTestSolrWarning.text")); // NOI18N
javax.swing.GroupLayout pnSolrSettingsLayout = new javax.swing.GroupLayout(pnSolrSettings);
pnSolrSettings.setLayout(pnSolrSettingsLayout);
pnSolrSettingsLayout.setHorizontalGroup(
@ -269,7 +286,10 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
.addComponent(bnTestSolr)
.addGap(18, 18, 18)
.addComponent(lbTestSolr, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(tbSolrPort))
.addComponent(tbSolrPort)
.addGroup(pnSolrSettingsLayout.createSequentialGroup()
.addComponent(lbTestSolrWarning)
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
);
pnSolrSettingsLayout.setVerticalGroup(
@ -285,7 +305,9 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
.addComponent(tbSolrHostname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(tbSolrPort, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(45, 45, 45))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lbTestSolrWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
pnMessagingSettings.setBorder(javax.swing.BorderFactory.createEtchedBorder());
@ -318,6 +340,9 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
org.openide.awt.Mnemonics.setLocalizedText(lbTestMessageService, org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.lbTestMessageService.text")); // NOI18N
lbTestMessageWarning.setForeground(new java.awt.Color(255, 0, 0));
org.openide.awt.Mnemonics.setLocalizedText(lbTestMessageWarning, org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.lbTestMessageWarning.text")); // NOI18N
javax.swing.GroupLayout pnMessagingSettingsLayout = new javax.swing.GroupLayout(pnMessagingSettings);
pnMessagingSettings.setLayout(pnMessagingSettingsLayout);
pnMessagingSettingsLayout.setHorizontalGroup(
@ -334,7 +359,10 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
.addComponent(lbTestMessageService, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(tbMsgPort)
.addComponent(tbMsgUsername)
.addComponent(tbMsgPassword))
.addComponent(tbMsgPassword)
.addGroup(pnMessagingSettingsLayout.createSequentialGroup()
.addComponent(lbTestMessageWarning)
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
);
pnMessagingSettingsLayout.setVerticalGroup(
@ -346,7 +374,7 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
.addComponent(bnTestMessageService, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(lbMessageServiceSettings))
.addComponent(lbTestMessageService, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(tbMsgHostname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(tbMsgPort, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
@ -354,7 +382,9 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
.addComponent(tbMsgUsername, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(tbMsgPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lbTestMessageWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
org.openide.awt.Mnemonics.setLocalizedText(cbEnableMultiUser, org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.cbEnableMultiUser.text")); // NOI18N
@ -395,21 +425,21 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(pnDatabaseSettings, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(pnSolrSettings, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(pnSolrSettings, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(pnMessagingSettings, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(39, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(pnOverallPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(pnOverallPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 555, javax.swing.GroupLayout.PREFERRED_SIZE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(pnOverallPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(pnOverallPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 559, javax.swing.GroupLayout.PREFERRED_SIZE)
);
}// </editor-fold>//GEN-END:initComponents
@ -433,6 +463,9 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
lbTestSolr.setIcon(null);
bnTestMessageService.setEnabled(false);
lbTestMessageService.setIcon(null);
lbTestDbWarning.setText("");
lbTestSolrWarning.setText("");
lbTestMessageWarning.setText("");
}
enableMultiUserComponents(textBoxes, cbEnableMultiUser.isSelected());
controller.changed();
@ -440,50 +473,93 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
private void bnTestDatabaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnTestDatabaseActionPerformed
lbTestDatabase.setIcon(null);
lbTestDbWarning.setText("");
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
CaseDbConnectionInfo dbInfo = new CaseDbConnectionInfo(
this.tbDbHostname.getText(),
this.tbDbPort.getText(),
this.tbDbUsername.getText(),
new String(this.tbDbPassword.getPassword()),
DbType.POSTGRESQL);
if (dbInfo.canConnect()) {
try {
CaseDbConnectionInfo info = new CaseDbConnectionInfo(
this.tbDbHostname.getText().trim(),
this.tbDbPort.getText().trim(),
this.tbDbUsername.getText().trim(),
new String(this.tbDbPassword.getPassword()),
DbType.POSTGRESQL);
SleuthkitCase.tryConnect(info);
lbTestDatabase.setIcon(goodIcon);
} else {
lbTestDbWarning.setText("");
} catch (TskCoreException ex) {
lbTestDatabase.setIcon(badIcon);
lbTestDbWarning.setText(ex.getMessage());
} finally {
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}//GEN-LAST:event_bnTestDatabaseActionPerformed
private void bnTestMessageServiceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnTestMessageServiceActionPerformed
lbTestMessageService.setIcon(null);
lbTestMessageWarning.setText("");
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
MessageServiceConnectionInfo messagingConnectionInfo = new MessageServiceConnectionInfo(
this.tbMsgUsername.getText(),
new String(this.tbMsgPassword.getPassword()),
this.tbMsgHostname.getText(),
this.tbMsgPort.getText());
if (messagingConnectionInfo.canConnect()) {
lbTestMessageService.setIcon(goodIcon);
} else {
int port;
try {
port = Integer.parseInt(this.tbMsgPort.getText().trim());
} catch (NumberFormatException ex) {
lbTestMessageService.setIcon(badIcon);
lbTestMessageWarning.setText(NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.InvalidPortNumber"));
return;
}
MessageServiceConnectionInfo info = new MessageServiceConnectionInfo(
this.tbMsgHostname.getText().trim(),
port,
this.tbMsgUsername.getText().trim(),
new String(this.tbMsgPassword.getPassword()));
try {
info.tryConnect();
lbTestMessageService.setIcon(goodIcon);
lbTestMessageWarning.setText("");
} catch (MessageServiceException ex) {
lbTestMessageService.setIcon(badIcon);
lbTestMessageWarning.setText(ex.getMessage());
} finally {
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}//GEN-LAST:event_bnTestMessageServiceActionPerformed
private void bnTestSolrActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnTestSolrActionPerformed
lbTestSolr.setIcon(null);
lbTestSolrWarning.setText("");
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
KeywordSearchService kwsService = Lookup.getDefault().lookup(KeywordSearchService.class);
if (kwsService != null && kwsService.canConnectToRemoteSolrServer(tbSolrHostname.getText(), tbSolrPort.getText())) {
lbTestSolr.setIcon(goodIcon);
} else {
try {
if (kwsService != null) {
int port = Integer.parseInt(tbSolrPort.getText().trim());
kwsService.tryConnect(tbSolrHostname.getText().trim(), port);
lbTestSolr.setIcon(goodIcon);
lbTestSolrWarning.setText("");
} else {
lbTestSolr.setIcon(badIcon);
lbTestSolrWarning.setText(NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.KeywordSearchNull"));
}
} catch (NumberFormatException ex) {
lbTestSolr.setIcon(badIcon);
lbTestSolrWarning.setText(NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.InvalidPortNumber"));
} catch (KeywordSearchServiceException ex) {
lbTestSolr.setIcon(badIcon);
lbTestSolrWarning.setText(ex.getMessage());
} finally {
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}//GEN-LAST:event_bnTestSolrActionPerformed
void load() {
lbTestDatabase.setIcon(null);
lbTestSolr.setIcon(null);
lbTestMessageService.setIcon(null);
lbTestDbWarning.setText("");
lbTestSolrWarning.setText("");
lbTestMessageWarning.setText("");
CaseDbConnectionInfo dbInfo = UserPreferences.getDatabaseConnectionInfo();
tbDbHostname.setText(dbInfo.getHost().trim());
tbDbPort.setText(dbInfo.getPort().trim());
@ -492,7 +568,7 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
MessageServiceConnectionInfo msgServiceInfo = UserPreferences.getMessageServiceConnectionInfo();
tbMsgHostname.setText(msgServiceInfo.getHost().trim());
tbMsgPort.setText(msgServiceInfo.getPort().trim());
tbMsgPort.setText(Integer.toString(msgServiceInfo.getPort()));
tbMsgUsername.setText(msgServiceInfo.getUserName().trim());
tbMsgPassword.setText(msgServiceInfo.getPassword());
@ -524,9 +600,9 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
* @return True or false.
*/
private boolean databaseFieldsArePopulated() {
return !tbDbHostname.getText().isEmpty()
&& !tbDbPort.getText().isEmpty()
&& !tbDbUsername.getText().isEmpty()
return !tbDbHostname.getText().trim().isEmpty()
&& !tbDbPort.getText().trim().isEmpty()
&& !tbDbUsername.getText().trim().isEmpty()
&& tbDbPassword.getPassword().length != 0;
}
@ -537,8 +613,8 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
* @return True or false.
*/
private boolean solrFieldsArePopulated() {
return !tbSolrHostname.getText().isEmpty()
&& !tbSolrPort.getText().isEmpty();
return !tbSolrHostname.getText().trim().isEmpty()
&& !tbSolrPort.getText().trim().isEmpty();
}
/**
@ -548,9 +624,9 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
* @return True or false.
*/
private boolean messageServiceFieldsArePopulated() {
return !tbMsgHostname.getText().isEmpty()
&& !tbMsgPort.getText().isEmpty()
&& !tbMsgUsername.getText().isEmpty()
return !tbMsgHostname.getText().trim().isEmpty()
&& !tbMsgPort.getText().trim().isEmpty()
&& !tbMsgUsername.getText().trim().isEmpty()
&& tbMsgPassword.getPassword().length != 0;
}
@ -572,11 +648,19 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
UserPreferences.setDatabaseConnectionInfo(info);
int port = 0;
try {
port = Integer.parseInt(this.tbMsgPort.getText().trim());
} catch (NumberFormatException ex) {
logger.log(Level.SEVERE, "Bad port setting", ex);
}
MessageServiceConnectionInfo msgServiceInfo = new MessageServiceConnectionInfo(
tbMsgUsername.getText().trim(),
new String(tbMsgPassword.getPassword()),
tbMsgHostname.getText().trim(),
tbMsgPort.getText().trim());
port,
tbMsgUsername.getText().trim(),
new String(tbMsgPassword.getPassword()));
UserPreferences.setMessageServiceConnectionInfo(msgServiceInfo);
UserPreferences.setIndexingServerHost(tbSolrHostname.getText().trim());
@ -638,7 +722,7 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
* @return True or false.
*/
boolean databaseSettingsAreValid() {
if (portNumberIsValid(tbDbPort.getText())) {
if (portNumberIsValid(tbDbPort.getText().trim())) {
return true;
} else {
tbOops.setText(INVALID_DB_PORT_MSG);
@ -652,7 +736,7 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
* @return True or false.
*/
boolean messageServiceSettingsAreValid() {
if (!portNumberIsValid(tbMsgPort.getText())) {
if (!portNumberIsValid(tbMsgPort.getText().trim())) {
tbOops.setText(INVALID_MESSAGE_SERVICE_PORT_MSG);
return false;
}
@ -666,7 +750,7 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
* @return True or false.
*/
boolean indexingServerSettingsAreValid() {
if (!portNumberIsValid(tbSolrPort.getText())) {
if (!portNumberIsValid(tbSolrPort.getText().trim())) {
tbOops.setText(INVALID_INDEXING_SERVER_PORT_MSG);
return false;
}
@ -703,8 +787,11 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
private javax.swing.JLabel lbMessageServiceSettings;
private javax.swing.JLabel lbSolrSettings;
private javax.swing.JLabel lbTestDatabase;
private javax.swing.JLabel lbTestDbWarning;
private javax.swing.JLabel lbTestMessageService;
private javax.swing.JLabel lbTestMessageWarning;
private javax.swing.JLabel lbTestSolr;
private javax.swing.JLabel lbTestSolrWarning;
private javax.swing.JPanel pnDatabaseSettings;
private javax.swing.JPanel pnMessagingSettings;
private javax.swing.JPanel pnOverallPanel;

View File

@ -0,0 +1,10 @@
MessageServiceConnectionInfo.ConnectionCheck.Everything=Invalid hostname, port number, username, and/or password.
MessageServiceConnectionInfo.ConnectionCheck.Hostname=Invalid hostname.
MessageServiceConnectionInfo.ConnectionCheck.Port=Invalid port number.
MessageServiceConnectionInfo.ConnectionCheck.Username=Invalid username.
MessageServiceConnectionInfo.ConnectionCheck.Password=Invalid password.
MessageServiceConnectionInfo.ConnectionCheck.UsernameAndPassword=Invalid username and/or password.
MessageServiceConnectionInfo.ConnectionCheck.HostnameOrPort=Invalid hostname and/or port number.
MessageServiceConnectionInfo.MissingHostname=Missing hostname.
MessageServiceConnectionInfo.MissingUsername=Missing username.
MessageServiceConnectionInfo.MissingPassword=Missing password.

View File

@ -24,6 +24,10 @@ import javax.annotation.concurrent.Immutable;
import javax.jms.Connection;
import javax.jms.JMSException;
import org.apache.activemq.ActiveMQConnectionFactory;
import java.io.IOException;
import java.net.InetAddress;
import java.util.MissingResourceException;
import org.openide.util.NbBundle;
/**
* Connection info for a Java Message Service (JMS) provider. Thread-safe.
@ -32,26 +36,31 @@ import org.apache.activemq.ActiveMQConnectionFactory;
public final class MessageServiceConnectionInfo {
private static final String MESSAGE_SERVICE_URI = "tcp://%s:%s?wireFormat.maxInactivityDuration=0";
private static final String CONNECTION_TIMED_OUT = "connection timed out";
private static final String CONNECTION_REFUSED = "connection refused";
private static final String PASSWORD_OR_USERNAME_BAD = "user name [";
private static final int IS_REACHABLE_TIMEOUT_MS = 1000;
private final String userName;
private final String password;
private final String host;
private final String port;
private final int port;
/**
* Constructs an object containing connection info for a Java Message
* Service (JMS) provider.
*
* @param userName The user name to use for a message service connection.
* @param password The password to use for a message service connection.
* @param host The host to use for a message service connection. May be
* a host name or an IP address.
* @param port The port number to use for a message service connection.
* @param userName The user name to use for a message service connection.
* @param password The password to use for a message service connection.
*
*/
public MessageServiceConnectionInfo(String userName, String password, String host, String port) {
this.userName = userName;
this.password = password;
public MessageServiceConnectionInfo(String host, int port, String userName, String password) {
this.host = host;
this.port = port;
this.userName = userName;
this.password = password;
}
/**
@ -85,9 +94,9 @@ public final class MessageServiceConnectionInfo {
/**
* Gets the port number to use for a message service connection.
*
* @return The port as a string.
* @return The port as an int.
*/
public String getPort() {
public int getPort() {
return port;
}
@ -99,24 +108,71 @@ public final class MessageServiceConnectionInfo {
* @throws URISyntaxException if the connection info is not for a valid TCP
* URI.
*/
public URI getURI() throws URISyntaxException {
return new URI(String.format(MESSAGE_SERVICE_URI, host, port));
URI getURI() throws URISyntaxException {
return new URI(String.format(MESSAGE_SERVICE_URI, getHost(), Integer.toString(getPort())));
}
/**
* Verifies connection to messaging service.
* Verifies connection to messaging service. Throws if we cannot communicate
* with messaging service.
*
* @return True if connection can be established, false otherwise.
* When issues occur, it attempts to diagnose them by looking at the
* exception messages, returning the appropriate user-facing text for the
* exception received. This method expects the Exceptions messages to be in
* English and compares against English text.
*
* @throws org.sleuthkit.autopsy.events.MessageServiceException
*/
public boolean canConnect() {
public void tryConnect() throws MessageServiceException {
if (host == null || host.isEmpty()) {
throw new MessageServiceException(NbBundle.getMessage(MessageServiceConnectionInfo.class, "MessageServiceConnectionInfo.MissingHostname")); //NON-NLS
} else if (userName == null || userName.isEmpty()) {
throw new MessageServiceException(NbBundle.getMessage(MessageServiceConnectionInfo.class, "MessageServiceConnectionInfo.MissingUsername")); //NON-NLS
} else if (password == null || password.isEmpty()) {
throw new MessageServiceException(NbBundle.getMessage(MessageServiceConnectionInfo.class, "MessageServiceConnectionInfo.MissingPassword")); //NON-NLS
}
try {
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(getUserName(), getPassword(), getURI());
Connection connection = connectionFactory.createConnection(getUserName(), getPassword());
connection.start();
connection.close();
return true;
} catch (URISyntaxException | JMSException ex) {
return false;
} catch (URISyntaxException ex) {
// The hostname or port seems bad
throw new MessageServiceException(NbBundle.getMessage(MessageServiceConnectionInfo.class, "MessageServiceConnectionInfo.ConnectionCheck.HostnameOrPort")); //NON-NLS
} catch (JMSException ex) {
String result;
Throwable cause = ex.getCause();
if (cause != null) {
// there is more information from another exception
String msg = cause.getMessage();
if (msg.startsWith(CONNECTION_TIMED_OUT)) {
// The hostname or IP address seems bad
result = NbBundle.getMessage(MessageServiceConnectionInfo.class, "MessageServiceConnectionInfo.ConnectionCheck.Hostname"); //NON-NLS
} else if (msg.toLowerCase().startsWith(CONNECTION_REFUSED)) {
// The port seems bad
result = NbBundle.getMessage(MessageServiceConnectionInfo.class, "MessageServiceConnectionInfo.ConnectionCheck.Port"); //NON-NLS
} else if (msg.toLowerCase().startsWith(PASSWORD_OR_USERNAME_BAD)) {
// The username or password seems bad
result = NbBundle.getMessage(MessageServiceConnectionInfo.class, "MessageServiceConnectionInfo.ConnectionCheck.UsernameAndPassword"); //NON-NLS
} else {
// Could be either hostname or port number
result = NbBundle.getMessage(MessageServiceConnectionInfo.class, "MessageServiceConnectionInfo.ConnectionCheck.HostnameOrPort"); //NON-NLS
}
} else {
// there is no more information from another exception
try {
if (InetAddress.getByName(getHost()).isReachable(IS_REACHABLE_TIMEOUT_MS)) {
// if we can reach the host, then it's probably a port problem
result = NbBundle.getMessage(MessageServiceConnectionInfo.class, "MessageServiceConnectionInfo.ConnectionCheck.Port"); //NON-NLS
} else {
result = NbBundle.getMessage(MessageServiceConnectionInfo.class, "MessageServiceConnectionInfo.ConnectionCheck.Hostname"); //NON-NLS
}
} catch (IOException | MissingResourceException any) {
// it may be anything
result = NbBundle.getMessage(MessageServiceConnectionInfo.class, "MessageServiceConnectionInfo.ConnectionCheck.Everything"); //NON-NLS
}
}
throw new MessageServiceException(result);
}
}
}

View File

@ -0,0 +1,53 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2015 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sleuthkit.autopsy.events;
/**
* Provides a system exception for the Message Service.
*/
public class MessageServiceException extends Exception {
private static final long serialVersionUID = 1L;
/**
* Constructs a new exception with null as its message.
*/
public MessageServiceException() {
super();
}
/**
* Constructs a new exception with the specified message.
*
* @param message The message.
*/
public MessageServiceException(String message) {
super(message);
}
/**
* Constructs a new exception with the specified message and cause.
*
* @param message The message.
* @param cause The cause.
*/
public MessageServiceException(String message, Throwable cause) {
super(message, cause);
}
}

View File

@ -38,13 +38,15 @@ public interface KeywordSearchService extends Closeable {
public void indexArtifact(BlackboardArtifact artifact) throws TskCoreException;
/**
* Are we able to connect to the remote Solr server.
* Checks if we can communicate with the KeywordSearchService using the
* passed-in host and port. Closes the connection upon exit. Throws if it
* cannot communicate.
*
* @param host the hostname or IP address of the server
* @param port the port to connect to
* @param host the remote hostname or IP address of the server
* @param port the remote port of the server
*
* @return true if we can connect, otherwise false
* @throws KeywordSearchServiceException
*/
public boolean canConnectToRemoteSolrServer(String host, String port);
public void tryConnect(String host, int port) throws KeywordSearchServiceException;
}
}

View File

@ -0,0 +1,53 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2015 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sleuthkit.autopsy.keywordsearchservice;
/**
* Provides a system exception for the Keyword Search package.
*/
public class KeywordSearchServiceException extends Exception {
private static final long serialVersionUID = 1L;
/**
* Constructs a new exception with null as its message.
*/
public KeywordSearchServiceException() {
super();
}
/**
* Constructs a new exception with the specified message.
*
* @param message The message.
*/
public KeywordSearchServiceException(String message) {
super(message);
}
/**
* Constructs a new exception with the specified message and cause.
*
* @param message The message.
* @param cause The cause.
*/
public KeywordSearchServiceException(String message, Throwable cause) {
super(message, cause);
}
}

View File

@ -4,7 +4,7 @@
<configuration>
<data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
<code-name-base>org.sleuthkit.autopsy.imagegallery</code-name-base>
<standalone/>
<suite-component/>
<module-dependencies>
<dependency>
<code-name-base>org.netbeans.api.progress</code-name-base>

View File

@ -0,0 +1 @@
suite.dir=${basedir}/..

View File

@ -106,7 +106,6 @@ KeywordSearchFilterNode.getFileActions.openExternViewActLbl=Open in External Vie
KeywordSearchFilterNode.getFileActions.searchSameMd5=Search for files with the same MD5 hash
KeywordSearchFilterNode.getFileActions.viewInNewWinActionLbl=View in New Window
KeywordSearchIngestModule.init.badInitMsg=Keyword search server was not properly initialized, cannot run keyword search ingest.
KeywordSearchIngestModule.init.verifyConnection=Please verify credentials and connectivity to multi-user keyword search service.
KeywordSearchIngestModule.init.tryStopSolrMsg={0}<br />Please try stopping old java Solr process (if it exists) and restart the application.
KeywordSearchIngestModule.init.noKwInLstMsg=No keywords in keyword list.
KeywordSearchIngestModule.init.onlyIdxKwSkipMsg=Only indexing will be done and and keyword search will be skipped (you can still add keyword lists using the Keyword Lists - Add to Ingest).
@ -288,3 +287,7 @@ SearchRunner.Searcher.done.err.msg=Error performing keyword search
KeywordSearchGlobalSearchSettingsPanel.timeRadioButton5.toolTipText=Fastest overall, but no results until the end
KeywordSearchGlobalSearchSettingsPanel.timeRadioButton5.text=No periodic searches
KeywordSearchIngestModule.startUp.fileTypeDetectorInitializationException.msg=Error initializing the file type detector.
SolrConnectionCheck.HostnameOrPort=Invalid hostname and/or port number.
SolrConnectionCheck.Hostname=Invalid hostname.
SolrConnectionCheck.Port=Invalid port number.
SolrConnectionCheck.MissingHostname=Missing hostname.

View File

@ -38,6 +38,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleReferenceCounter;
import org.sleuthkit.autopsy.ingest.IngestServices;
import org.sleuthkit.autopsy.keywordsearch.Ingester.IngesterException;
import org.sleuthkit.autopsy.keywordsearchservice.KeywordSearchService;
import org.sleuthkit.autopsy.keywordsearchservice.KeywordSearchServiceException;
import org.sleuthkit.autopsy.modules.filetypeid.FileTypeDetector;
import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.TskCoreException;
@ -147,10 +148,23 @@ public final class KeywordSearchIngestModule implements FileIngestModule {
if (Case.getCurrentCase().getCaseType() == Case.CaseType.MULTI_USER_CASE) {
// for multi-user cases need to verify connection to remore SOLR server
KeywordSearchService kwsService = new SolrSearchService();
if (!kwsService.canConnectToRemoteSolrServer(UserPreferences.getIndexingServerHost(), UserPreferences.getIndexingServerPort())) {
int port;
try {
port = Integer.parseInt(UserPreferences.getIndexingServerPort());
} catch (NumberFormatException ex) {
// if there is an error parsing the port number
String msg = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.badInitMsg");
logger.log(Level.SEVERE, msg);
String details = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.verifyConnection");
String details = NbBundle.getMessage(this.getClass(), "SolrConnectionCheck.Port");
logger.log(Level.SEVERE, "{0}: {1} {2}", new Object[]{msg, details, ex.toString()});
services.postMessage(IngestMessage.createErrorMessage(KeywordSearchModuleFactory.getModuleName(), msg, details));
throw new IngestModuleException(msg);
}
try {
kwsService.tryConnect(UserPreferences.getIndexingServerHost(), port);
} catch (KeywordSearchServiceException ex) {
String msg = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.badInitMsg");
String details = ex.getMessage();
logger.log(Level.SEVERE, "{0}: {1} {2}", new Object[]{msg, details, ex.toString()});
services.postMessage(IngestMessage.createErrorMessage(KeywordSearchModuleFactory.getModuleName(), msg, details));
throw new IngestModuleException(msg);
}

View File

@ -33,6 +33,10 @@ import org.sleuthkit.autopsy.datamodel.ContentUtils;
import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.SleuthkitCase;
import org.openide.util.NbBundle;
import java.net.InetAddress;
import java.util.MissingResourceException;
import org.sleuthkit.autopsy.keywordsearchservice.KeywordSearchServiceException;
/**
* An implementation of the KeywordSearchService interface that uses Solr for
@ -41,6 +45,10 @@ import org.sleuthkit.datamodel.SleuthkitCase;
@ServiceProvider(service = KeywordSearchService.class)
public class SolrSearchService implements KeywordSearchService {
private static final String BAD_IP_ADDRESS_FORMAT = "ioexception occured when talking to server";
private static final String SERVER_REFUSED_CONNECTION = "server refused connection";
private static final int IS_REACHABLE_TIMEOUT_MS = 1000;
@Override
public void indexArtifact(BlackboardArtifact artifact) throws TskCoreException {
if (artifact == null) {
@ -157,39 +165,59 @@ public class SolrSearchService implements KeywordSearchService {
/**
* Checks if we can communicate with Solr using the passed-in host and port.
* Closes the connection upon exit.
* Closes the connection upon exit. Throws if it cannot communicate with
* Solr.
*
* When issues occur, it attempts to diagnose them by looking at the
* exception messages, returning the appropriate user-facing text for the
* exception received. This method expects the Exceptions messages to be in
* English and compares against English text.
*
* @param host the remote hostname or IP address of the Solr server
* @param port the remote port for Solr
*
* @return true if communication with Solr is functional, false otherwise
* @throws org.sleuthkit.autopsy.keywordsearch.KeywordSearchServiceException
*
*/
@Override
public boolean canConnectToRemoteSolrServer(String host, String port) {
if (host.isEmpty() || port.isEmpty()) {
return false;
}
try {
// if the port value is invalid, return false
Integer.parseInt(port);
} catch (NumberFormatException ex) {
return false;
}
public void tryConnect(String host, int port) throws KeywordSearchServiceException {
HttpSolrServer solrServer = null;
if (host == null || host.isEmpty()) {
throw new KeywordSearchServiceException(NbBundle.getMessage(SolrSearchService.class, "SolrConnectionCheck.MissingHostname")); //NON-NLS
}
try {
solrServer = new HttpSolrServer("http://" + host + ":" + port + "/solr"); //NON-NLS;
solrServer = new HttpSolrServer("http://" + host + ":" + Integer.toString(port) + "/solr"); //NON-NLS;
KeywordSearch.getServer().connectToSolrServer(solrServer);
return true; // if we get here, it's at least up and responding
} catch (SolrServerException | IOException ignore) {
} catch (SolrServerException ex) {
throw new KeywordSearchServiceException(NbBundle.getMessage(SolrSearchService.class, "SolrConnectionCheck.HostnameOrPort")); //NON-NLS
} catch (IOException ex) {
String result = NbBundle.getMessage(SolrSearchService.class, "SolrConnectionCheck.HostnameOrPort"); //NON-NLS
String message = ex.getCause().getMessage().toLowerCase();
if (message.startsWith(SERVER_REFUSED_CONNECTION)) {
try {
if (InetAddress.getByName(host).isReachable(IS_REACHABLE_TIMEOUT_MS)) {
// if we can reach the host, then it's probably port problem
result = NbBundle.getMessage(SolrSearchService.class, "SolrConnectionCheck.Port"); //NON-NLS
} else {
result = NbBundle.getMessage(SolrSearchService.class, "SolrConnectionCheck.HostnameOrPort"); //NON-NLS
}
} catch (IOException | MissingResourceException any) {
// it may be anything
result = NbBundle.getMessage(SolrSearchService.class, "SolrConnectionCheck.HostnameOrPort"); //NON-NLS
}
} else if (message.startsWith(BAD_IP_ADDRESS_FORMAT)) {
result = NbBundle.getMessage(SolrSearchService.class, "SolrConnectionCheck.Hostname"); //NON-NLS
}
throw new KeywordSearchServiceException(result);
} catch (NumberFormatException ex) {
throw new KeywordSearchServiceException(NbBundle.getMessage(SolrSearchService.class, "SolrConnectionCheck.Port")); //NON-NLS
} catch (IllegalArgumentException ex) {
throw new KeywordSearchServiceException(ex.getMessage());
} finally {
if (solrServer != null) {
if (null != solrServer) {
solrServer.shutdown();
}
}
return false;
}
@Override

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
docs/doxygen-user/images/postgresqlinstall2.PNG Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View File

@ -77,54 +77,89 @@ To install ActiveMQ, perform the following steps:
<br>
6. Move the <i>apache-activemq-5.11.1</i> folder to a location of your choice, bearing in mind that the files should be in a location that the running process will have write permissions to the folder. A typical folder choice is <i>C:\\Program Files\\apache-activemq-5.11.1</i>. Typically, it will ask for administrator permission to move the folder. Allow it if required.
7. Install ActiveMQ as a service by navigating to the folder <i>apache-activemq-5.11.1-bin\\apache-activemq-5.11.1\\bin\\win64</i>, right-clicking _InstallService.bat_, clicking _Run as administrator_, then click _Yes_.
8. Start the ActiveMQ service by going pressing _Start_, type _services.msc_, and press _Enter_. Find _ActiveMQ_ in the list and press the _Start the service_ link.
9. ActiveMQ should now be fully installed.
10. You can access the admin pages in your web browser using something via a URL like this (set your host): http://localhost:8161/admin. The default username is _admin_ and the default password is _admin_. If you can see a page that looks like the following, it is ready to function.
8. If you desire authentication for your ActiveMQ server(a good idea), the following directions allow you to set up credentials:
+ Copy the file _groups.properties_ from the _authentication_ folder of the install package to <i>"C:\Program Files\apache-activemq-5.11.1-bin\apache-activemq-5.11.1\conf"</i>, overwriting the existing file.
+ Copy the file _users.properties_ from the _authentication_ folder of the install package to <i>"C:\Program Files\apache-activemq-5.11.1-bin\apache-activemq-5.11.1\conf"</i>, overwriting the existing file.
+ Copy and paste the text from the file _add_to_activemq_xml.txt_ from the _authentication_ folder of the install package to the file <i>"C:\Program Files\apache-activemq-5.11.1-bin\apache-activemq-5.11.1\conf\activemq.xml"</i>, inserting the text at the line shown in yellow in the screenshot below.
<br>
<br>
\image html insertTextHere.PNG
<br>
<br>
After insertion, the file should look like the screenshot below, with the inserted portion highlighted in yellow. This is where you can change the username and password for your ActiveMQ setup.
<br>
<br>
\image html insertedText.PNG
<br>
<br>
To add a new user or change the password:
+ Stop the ActiveMQ service by pressing _Start_, type _services.msc_, and press _Enter_. Find _ActiveMQ_ in the list and press the _Stop the service_ link.
<br>
<br>
\image html StopActiveMQService.PNG
<br>
<br>
+ Edit <i>"C:\Program Files\apache-activemq-5.11.1-bin\apache-activemq-5.11.1\conf\activemq.xml"</i> adding the desired line. Both _username_ and _password_ are case sensitive. You will very likely want to keep your new users in the _users_ group.
<br>
<br>
\image html newUserAndPassword.PNG
<br>
<br>
+ Start the ActiveMQ service by pressing _Start_, type _services.msc_, and press _Enter_. Find _ActiveMQ_ in the list and press the _Start the service_ link.
<br>
<br>
\image html StartActiveMQService.PNG
<br>
<br>
9. If not already started, start the ActiveMQ service by pressing _Start_, type _services.msc_, and press _Enter_. Find _ActiveMQ_ in the list and press the _Start the service_ link.
10. ActiveMQ should now be fully installed and configured. You can access the admin pages in your web browser via a URL like this (set your host): http://localhost:8161/admin. The default username is _admin_ and the default password is _admin_. You can change these passwords by editing the file <i>"C:\Program Files\apache-activemq-5.11.1-bin\apache-activemq-5.11.1\conf\activemq.xml"</i> on the ActiveMQ server as discussed above. If you can see a page that looks like the following, it is ready to function.
<br><br>
\image html activemq.PNG
<br>
11. If you do not see a screen like the above screenshot and you have double checked that the ActiveMQ service is running, contact your network administrator. For the ActiveMQ service to be accessible by network clients you may need to configure your Windows firewall (and any other 3rd party firewall in use) to allow communication.
<br>
If you do not see a screen like the above screenshot and you have double checked that the ActiveMQ service is running, contact your network administrator. For the ActiveMQ service to be accessible by network clients you may need to configure your Windows firewall (and any other 3rd party firewall in use) to allow communication.
<br><br>
\subsection solr_install Bitnami Solr Installation
To install Solr, perform the following steps:
1. Download the Apache Solr 4.10.3-0 installation package from https://bitnami.com/stack/solr/installer. By default, the Bitnami installation process will configure Solr to run in a 32-bit Java runtime as a Windows Service under the Local System account. The following steps will configure Solr to run in a 64-bit Java runtime using an account that will have access to the network storage.
A central Solr server is needed to store keyword indexes. To install Solr, perform the following steps:
1. Download the Apache Solr 4.10.3-0 installation package from https://bitnami.com/stack/solr/installer. By default, the Bitnami installation process will configure Solr to run in a 32-bit Java runtime as a Windows Service under the Local System account. The following steps will configure Solr to run in a 64-bit Java runtime using an account that will have access to the network storage.
2. Test if you have a 64-bit version of the Java Runtime Environment already installed by double clicking _test_version.bat_. If you do not see "You have a 64-bit JRE installed", proceed to step 3. If you see "You have a 64-bit JRE installed", proceed to step 4.
3. Install a 64-bit version of the JRE. Download it from: http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html. Be sure to select a package that has "x64" in the name. Follow the installation prompts to install the JRE, then when the install has completed, re-run _test_version.bat_. It should say "You have a 64-bit JRE installed".
4. Run the Bitnami installer, <i>bitnami-solr-4.10.3-0-windows-installer.exe</i>
5. If Windows prompts with User Account Control, click _Yes_
6. Follow the prompts through to completion. You do not need to "Learn more about Bitnami cloud hosting" so you can clear the check box.
7. If you see an error dialog like the following, you may safely ignore it.
<br><br>
\image html apachebadmessage.PNG
<br>
8. When the installation completes, clear the "Launch Bitnami Apache Solr Stack Now?" checkbox and click _Finish_.
9. Stop _solrApache_ and _solrJetty_ services by pressing _Start_, typing _services.msc_, pressing _Enter_, and locating the _solrApache_ and _solrJetty_ Windows services. Select the services one at a time, and press _Stop the service_ once for each of them. If the service is already stopped and there is no _Stop the service_ available, this is okay.
10. Right click on <i>C:\\Bitnami\\solr-4.10.3-0\\apache-solr\\scripts\\serviceinstall.bat</i> and click on _Run as administrator_, selecting _Yes_ if prompted by User Account Control.
11. Edit the <i>C:\\Bitnami\\solr-4.10.3-0\\apache-solr\\scripts\\serviceinstall.bat</i> script and replace the path to _JavaHome_ with the path to your 64-bit version of the JRE, e.g. something like: <i>--JavaHome="C:\Program Files\Java\jre1.8.0_45"</i> Note you need administrator permission to change this file. The easiest way around this is to save a copy on the Desktop, edit the Desktop version, and copy the new one back over the top of the old. Windows will ask for permission to overwrite the old file; allow it.
<br><br>
If you have a 64-bit JRE installed, the correct path can be obtained by running the command _where java_ from the Windows command line. A correct example is shown below in yellow:
<br>
\image html wherejava.PNG
<br>
Do not include the "bin" folder in the path you place into the _JavaHome_ variable.
<br><br>
Note that if you get something like the following, it is a symbolic link to the Java installation and you need to trace it to the proper folder as explained below.
<br>
\image html symlinkjava.PNG
<br>
Use Windows Explorer to navigate to the path shown (<i>C:\\ProgramData\\Oracle\\Java\\javapath</i> for the example above), then right click on _java.exe_ and go to _Properties_. You will see the path you should use in the _Target_ field, shown in the screenshot below. Do not include the "bin" folder in the path you place into the _JavaHome_ variable.
<br>
\image html javaproperties.PNG
<br>
12. Edit <i>C:\\Bitnami\\solr-4.10.3-0\\apache-solr\\solr\\solr.xml</i> to set the _transientCacheSize_ to the maximum number of cases expected to be open concurrently. If you expect ten concurrent cases, the text to add is
11. Edit the <i>C:\\Bitnami\\solr-4.10.3-0\\apache-solr\\scripts\\serviceinstall.bat</i> script. You need administrator permission to change this file. The easiest way around this is to save a copy on the Desktop, edit the Desktop version, and copy the new one back over the top of the old. Windows will ask for permission to overwrite the old file; allow it. You should make the following changes to this file:
<br>
<br>
- Add the following options in the _JvmOptions_ section of the line that begins with <i>"C:\Bitnami\solr-4.10.3-0/apache-solr\scripts\prunsrv.exe"</i> :
+ <i>++JvmOptions=-DzkRun</i>
+ <i>++JvmOptions=-Dcollection.configName=AutopsyConfig</i>
+ <i>++JvmOptions=-Dbootstrap_confdir="C:\Bitnami\solr-4.10.3-0\apache-solr\solr\configsets\AutopsyConfig\conf"</i>
- Replace the path to <i>JavaHome</i> with the path to your 64-bit version of the JRE. If you do not know the path, the correct _JavaHome_ path can be obtained by running the command <i>"where java"</i> from the Windows command line. An example is shown below. The text in yellow is what we are interested in, so do not include the <i>"bin"</i> folder in the path you place into the _JavaHome_ variable. A correct example of the final result will look something like this:&nbsp;&nbsp;&nbsp;<i>--JavaHome="C:\Program Files\Java\jre1.8.0_45"</i>
<br><br>
\image html wherejava.PNG
<br><br>
Note that if you get something like the following when running the <i>"where java"</i> command, it is a symbolic link to the Java installation and you need to trace it to the proper folder as explained below.
<br><br>
\image html symlinkjava.PNG
<br><br>
To trace a symbolic link to the proper folder, use Windows Explorer to navigate to the path shown (<i>C:\\ProgramData\\Oracle\\Java\\javapath</i> for the example above), then right click on _java.exe_ and Click on _Properties_. You will see the path you should use in the _Target_ field, shown in the screenshot below. Do not include the <i>"bin"</i> folder in the path you place into the _JavaHome_ variable.
<br><br>
\image html javaproperties.PNG
<br><br>
A fully updated _serviceinstall.bat_ is shown below, with the changes marked in yellow.
<br><br>
\image html updatedServiceInstall.PNG
<br><br>
12. Edit <i>"C:\Bitnami\solr-4.10.3-0\apache-solr\solr\solr.xml"</i> to set the _transientCacheSize_ to the maximum number of cases expected to be open concurrently. If you expect ten concurrent cases, the text to add is
<i>\<int name="transientCacheSize">10\</int></i>
<br><br>
The added part is highlighted in yellow below. Ensure that it is inside the <i>\<solr></i> tag as follows:
@ -133,23 +168,43 @@ The added part is highlighted in yellow below. Ensure that it is inside the <i>\
<br>
Again you may have trouble saving to the file in the current location. If so, just save it out to the desktop and copy the desktop file back over the top of the original.
<br><br>
Also, be very careful. Do not cut and paste this from this document, as some programs will change quotes to characters that look like quotes but are not.
**Do not cut and paste this from this document**, as some programs will change quotes to characters that look like quotes but are not.
<br><br>
13. Copy the folders _configsets_ and _lib_ from the installation disk to <i>C:\\Bitnami\\solr-4.10.3-0\\apache-solr\\solr</i>
13. Edit <i>"C:\Bitnami\solr-4.10.3-0\apache-solr\resources/log4j.properties"</i> to configure Solr log settings:
- Increase the log rotation size threshold (_log4j\.appender\.file\.MaxFileSize_) from 4MB to 100MB.
- Remove the _CONSOLE_ appender from the _log4j\.rootLogger_ line.
<br><br>
The log file should end up looking like this (modified lines are highlighted in yellow):
<br><br>
\image html log4j.PNG
<br><br>
14. Edit the file <i>"C:\Bitnami\solr-4.10.3-0\apache-solr\solr\zoo.cfg"</i> to increase the _tickTime_ value to 15000 as shown in the screenshot below.
<br><br>
\image html tickTime.PNG
<br><br>
15. Edit the file <i>"C:\Bitnami\solr-4.10.3-0\apache-solr\solr\zoo.cfg"</i> to set the value <i>dataDir=C:/Bitnami/zookeeper</i> as shown in the screenshot below.
<br><br>
\image html dataDir.PNG
<br><br>
16. Right-click on the file <i>"C:\Bitnami\solr-4.10.3-0\apache-solr\scripts\serviceinstall.bat"</i> and click "Run As Administrator".
14. Start a Windows command prompt as administrator by pressing _Start_, typing _command_, right clicking on _Command Prompt_, and clicking on _Run as administrator_. Then run the following command to install the _solrJetty_ service (very likely it will say "The solrJetty service could not be started." This is okay.): <i>cmd /c C:\\Bitnami\\solr-4.10.3-0\\apache-solr\\scripts\\serviceinstall.bat INSTALL</i>
<br><br>
Your command prompt should look like the screenshot below. Note the use of <i>cmd /c</i> to prevent the script from closing your command prompt.
If there is no "Run as administrator" option when you right-click the _serviceinstall.bat_ file, start a Windows command prompt as administrator by pressing _Start_, typing _command_, right clicking on _Command Prompt_, and clicking on _Run as administrator_. Then run the following command to install the _solrJetty_ service:
<br><br>
<i>cmd /c C:\\Bitnami\\solr-4.10.3-0\\apache-solr\\scripts\\serviceinstall.bat INSTALL</i>
<br><br>
Your command prompt should look like the screenshot below. Very likely it will say "The solrJetty service could not be started." This is okay.
<br><br>
\image html solrinstall1.PNG
<br><br>
15. Press _Start_, type _services.msc_, and press _Enter_. Find _solrJetty_. If the service is running, press _Stop the service_, then double click it, and switch to the _Log On_ tab to change the logon credentials to a user who will have access to read and write the primary shared drive. If the machine is on a domain, the Account Name will be in the form of _DOMAINNAME\\username_ as shown in the example below. Note that in the screenshot below, the domain name is _DOMAIN_ and the user name is _username_. These are just examples, not real values.
17. Copy the folder _configsets_ from the installation disk to <i>C:\\Bitnami\\solr-4.10.3-0\\apache-solr\\solr</i>
18. Copy the folder _lib_ from the installation disk to <i>C:\\Bitnami\\solr-4.10.3-0\\apache-solr\\solr</i>
19. Press _Start_, type _services.msc_, and press _Enter_. Find _solrJetty_. If the service is running, press _Stop the service_, then double click it, and switch to the _Log On_ tab to change the logon credentials to a user who will have access to read and write the primary shared drive. If the machine is on a domain, the Account Name will be in the form of _DOMAINNAME\\username_ as shown in the example below. Note that in the screenshot below, the domain name is _DOMAIN_ and the user name is _username_. These are just examples, not real values.
<br><br>
\image html solrinstall2.PNG
<br>
If the machine is on a domain, **make sure** to select the domain with the mouse by going to the _Log On_ tab, clicking _Browse_, then clicking _Locations_ and selecting the domain of interest. Then enter the user name desired and press _Check Names_. When that completes, press _OK_, type in the password (once for each box) and press _OK_. You may see "The user has been granted the log on as a service right."
If the machine is on a domain, **make sure** to select the domain with the mouse by going to the _Log On_ tab, clicking _Browse_, then clicking _Locations_ and selecting the domain of interest. Then enter the user name desired and press _Check Names_. When that completes, press _OK_, type in the password once for each box and press _OK_. You may see "The user has been granted the log on as a service right."
16. You should be able to see the Solr service in a web browser via the URL <i>http://localhost:8983/solr/#/</i> as shown in the screenshot below.
20. You should be able to see the Solr service in a web browser via the URL <i>http://localhost:8983/solr/#/</i> as shown in the screenshot below.
<br><br>
\image html solrinstall3.PNG
<br>
@ -160,18 +215,46 @@ If the service is appropriately started and you are unable to see the screenshot
To install PostgreSQL, perform the following steps:
1. Download a 64-bit PostgreSQL version 9.4.1 installer from http://www.enterprisedb.com/products-services-training/pgdownload#windows Choose the one that says _Win X86-64_.
2. Run _postgresql-9.4.4-1-windows-x64.exe_
3. You may accept defaults for all items except for the password as you work through the wizard. Do not lose the password you enter in. This is the PostgreSQL administrator login password.
4. You do not need to launch the StackBuilder nor acquire any more software from it. Uncheck the option to use StackBuilder and press _Finish_.
5. Using the PostgreSQL administrator login and the _psql_ tool, create a regular user account to use while running Autopsy. Note you can also do this with the graphical tool _pgAdminIII_, but this guide only covers _psql_. To start _psql_, press _Start_, type _psql_, and press _Enter_ a few times until it prompts you for a password. Type in the password you gave it when installing PostgreSQL. You should see a prompt that looks like the screenshot below.
<br>
5. Create a regular user account to use while running Autopsy. You can do this with either of two methods, graphically, or command line. We cover graphically first.
- Graphically:
- Using the PostgreSQL administrator login and the pgAdmin III tool, create a regular user account to use while running Autopsy.
- Right click on <i>"Login Roles"</i> and select <i>"New Login Role..."</i> as shown below:
<br><br>
\image html pgAdmin.PNG
<br><br>
- Enter the user name you would like to use in the <i>"Role name"</i> field.
<br><br>
\image html newLoginRole.PNG
<br><br>
- Enter the password on the <i>"Definition"</i> tab.
<br><br>
\image html newPassword.PNG
<br><br>
- Check <i>"Can create databases"</i> on the <i>"Role Privileges"</i> tab.
<br><br>
\image html newRights.PNG
<br><br>
- Click <i>"OK"</i>.
<br><br>
- Command line:
<br>
Use the _psql_ tool. To start _psql_, press _Start_, type _psql_, and press _Enter_ a few times until it prompts you for a password. Type in the password you gave it when installing PostgreSQL. You should see a prompt that looks like the screenshot below.
<br><br>
\image html postgresqlinstall1.PNG
<br>
<br><br>
If you want your user account name to be <i>"Autopsy"</i> and your password to be <i>"myPassword"</i>, use the following command to create a new user, noting that the password is enclosed in single quotes, __not backticks nor double quotes__. Also note that it is important to type this command in from the keyboard directly, as copying and pasting can sometimes yield different characters for single quotes that can confuse _psql_.
<br><br>
The command is:
<br>
> CREATE USER Autopsy WITH PASSWORD 'myPassword' CREATEDB;
> CREATE &nbsp;&nbsp; USER &nbsp;&nbsp; Autopsy &nbsp;&nbsp; WITH &nbsp;&nbsp; PASSWORD &nbsp;&nbsp; 'myPassword' &nbsp;&nbsp; CREATEDB;
<br>
When you see the _CREATE ROLE_ output as shown in the screenshot below, the new user has been created. You can close the _psql_ window now.
<br>
@ -187,44 +270,96 @@ First, find your machine's IPv4 address and Subnet Mask (Press _Start_, type _cm
<br>
The following is an example rule that allows all clients on the 10.10.192.x subnet to connect using md5 authentication.
<br>
> host all all 10.10.192.0/24 md5
> host&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;10.10.192.0/24&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;md5
<br>
__Rules of thumb:__
If your Subnet Mask is 255.255.0.0, your rule should look like this: A.B.0.0/16, where A is the first octet in your IP address and B is the second octet.
__Subnet Mask Rules of thumb:__
- If your Subnet Mask is 255.255.0.0, your rule should look like this: A.B.0.0/16, where A is the first octet in your IP address and B is the second octet.
<br>
- If your Subnet Mask is 255.255.255.0, your rule should look like this: A.B.C.0/24, where A is the first octet in your IP address, B is the second octet, and C is the third octet.
<br><br>
If your Subnet Mask is 255.255.255.0, your rule should look like this: A.B.C.0/24, where A is the first octet in your IP address, B is the second octet, and C is the third octet. Add the line highlighted in yellow below, formatted with spaces between the entries, adjusting the IP address to an appropriate value as described above.
Add the line highlighted in yellow below, formatted with spaces between the entries, adjusting the IP address to an appropriate value as described above.
<br><br>
\image html postgresqlinstall4.PNG
<br>
<br><br>
If you intend to use PostgreSQL from machines on a different subnet, you need an entry in the _pg_hba.conf_ file for each subnet.
<br><br>
Uncomment the following values in the configuration file located at <i>C:\\Program Files\\PostgreSQL\\9.4\\data\\postgresql.conf</i> and change the value to those shown below:
7. Uncomment the following entires in the configuration file located at <i>C:\\Program Files\\PostgreSQL\\9.4\\data\\postgresql.conf</i> by removing the leading "#", and change their values <i>"off"</i> as shown below.
<br>
> fsync = off<br>
> synchronous_commit = off<br>
> full_page_writes = off<br>
<br>
Pictorially, change the following, from this:
<br>
<br><br>
\image html postgresqlinstall5.PNG
<br>
<br><br>
To this:
<br><br>
\image html postgresqlinstall6.PNG
<br>
<br><br>
Note the removal of the leading number symbol-this uncomments that entry.
<br><br>
7. Press _Start_, type _services.msc_, and press _Enter_. Select _postgresql-x64-9.4 PostgreSQL Server 9.4_ in the services list and click the link that says _Stop the service_ then click the link that says _Start the service_ as shown in the screenshot below.
8. Still in <i>"C:\Program Files\PostgreSQL\9.4\data\postgresql.conf"</i>, find the entry named _max_connections_ and set it to the number of suggested connections for your configuration. A rule of thumb is add 100 connections for each Automated Ingest Node and 100 connections for each Reviewer node you plan to have in the network. More information is available at 5.1.1. See the screenshot below.
<br><br>
\image html maxConnections.PNG
<br><br>
9. Press _Start_, type _services.msc_, and press _Enter_. Select _postgresql-x64-9.4 PostgreSQL Server 9.4_ in the services list and click the link that says _Stop the service_ then click the link that says _Start the service_ as shown in the screenshot below.
<br><br>
\image html postgresqlinstall7.PNG
<br>
PostgreSQL should now be up and running. You can verify this with the PSQL tool used earlier in this document.
<br><br>
PostgreSQL should now be up and running. You can verify by using either the _pgAdmin_ tool or the _psql_ tool to connect to the database server from another machine on the network .
<br><br><br>
\section shared_network_drive Shared Network Drive
To use Multi-user cases, there needs to be a large network storage available to all participating computers.
<br><br>
To authenticate with Windows and allow access to a shared drive, you will need a username and a password, a domain name if you are on a domain, the IP address of the machine hosting the shared drive, and the hostname of the machine hosting the shared drive. Using Windows Explorer, enter two slashes "\\" followed by the storage machine's IP address and press enter. An example is shown below with the text "\\10.10.152.211" entered.
<br><br>
\image html urlInAddressbar.PNG
<br><br>
You will see a dialog similar to the following, asking for your credentials.
<br><br>
\image html credentialsWithDomain.PNG
<br><br>
If you have a domain name, add it in the top box before the "\". Follow it with your username. If you have no domain name, just use your username. Add your password in the next box down and place a check mark in <i>"Remember my credentials"</i>, then press <i>"OK"</i>.
Next, we will do the same with the hostname of the machine. This is necessary to authenticate with both IP address access and hostname access. If you do not know the hostname, you may find it by pinging the IP address with the <i>"-a"</i> flag set. It will look something like the screenshot below, where we find the hostname associated with the IP address <i>10.10.142.56</i> is <i>win-kmort-4863.basistech.net</i>.
<br><br>
\image html getHostname.PNG
<br><br>
In Windows Explorer, use this hostname preceded by two slashes, "\\", in the address bar as shown below and press enter.
<br><br>
\image html hostname.PNG
<br><br>
You will see a screen similar to the screenshot below.
<br><br>
\image html toConnect.PNG
<br><br>
If you are familiar with the Windows Credential Manager, you may use this tool to manage credentials. These credentials can also be managed from the command line using the "net use" command. To get to Credential Manager click on to <i>Start</i>, and typing <i>"Credential Manager"</i> and pressing enter. A screenshot of the Windows Credential Manager is shown below.
<br><br>
\image html credentialManager.PNG
<br><br>
Note that authentication and access can be an issue when passwords change. When passwords change, for every computer using a credential that is no longer valid, you will need to redo the above steps. One indicator this is a problem is seeing the text: <i>"The system detected a possible attempt to compromise security. Please ensure that you can contact the server that authenticated you."</i> Do not forget to re-authenticate with both the IP address and the hostname.
<br><br><br>
\section optimizing_performance Optimizing Performance
After installing Autopsy, there are several hardware-based things that we suggest you do to optimize performance:
1. Change the number of parallel pipelines used at run time. The default is two pipelines, but this can be increased if you are running on a system with several cores. To do this:
- Run Autopsy from the Start Menu or desktop
- When presented with the case creation splash screen, cancel/close the window

View File

@ -10,6 +10,7 @@ app.version=3.1.3
#build.type=RELEASE
build.type=DEVELOPMENT
project.org.sleuthkit.autopsy.imagegallery=ImageGallery
update_versions=false
#custom JVM options
#Note: can be higher on 64 bit systems, should be in sync with build.xml
@ -27,7 +28,8 @@ modules=\
${project.org.sleuthkit.autopsy.testing}:\
${project.org.sleuthkit.autopsy.thunderbirdparser}:\
${project.org.sleuthkit.autopsy.core}:\
${project.org.sleuthkit.autopsy.corelibs}
${project.org.sleuthkit.autopsy.corelibs}:\
${project.org.sleuthkit.autopsy.imagegallery}
project.org.sleuthkit.autopsy.core=Core
project.org.sleuthkit.autopsy.corelibs=CoreLibs
project.org.sleuthkit.autopsy.keywordsearch=KeywordSearch

View File

@ -27,13 +27,6 @@ It is up to the user to distinguish between the paths when adding to this file.
<Properties>
<!-- Path to input directory -->
<!--indir value="X:\path\to\input\directory" /-->
<!-- Path to global CSV file -->
<!--global_csv value="X:\path\to\global\csv.txt" /-->
<!-- Path to images -->
<image value="..\input\nps-2008-jean.E01" />
<!--image value="../input/file.E01" /-->
<!--image value="This provokes an error." /-->
<!--image value="X:\Invalid\Path\Does\Not\Exist.img" /-->
<!--build value="X:\Path\To\Build\File.xml"-->
<!-- example: -->
<!--<image value="path-to-img" />-->
</Properties>

View File

@ -93,8 +93,6 @@ def usage():
print ("-v verbose mode")
print ("-e ARG Enable exception mode with given string")
print ("-h help")
print ("-fr Do not download new images each time")
#----------------------#
# Main #
@ -108,19 +106,6 @@ def main():
return
test_config = TestConfiguration(args)
# Download images unless they asked not to
if(not args.fr):
antin = ["ant"]
antin.append("-f")
antin.append(os.path.join("..","..","build.xml"))
antin.append("test-download-imgs")
if SYS is OS.CYGWIN:
subprocess.call(antin)
elif SYS is OS.WIN:
theproc = subprocess.Popen(antin, shell = True, stdout=subprocess.PIPE)
theproc.communicate()
# Otherwise test away!
TestRunner.run_tests(test_config)
@ -1666,7 +1651,6 @@ class Args(object):
self.verbose = False
self.exception = False
self.exception_string = ""
self.fr = False
self.copy_diff_files = False
self.diff_files_output_folder = ""
@ -1721,9 +1705,6 @@ class Args(object):
elif arg == "-h" or arg == "--help":
usage()
return False
elif arg == "-fr" or arg == "--forcerun":
print("Not downloading new images")
self.fr = True
elif arg == "-o" or arg == "--output":
try:
arg = sys.argv.pop(0)