accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bil...@apache.org
Subject svn commit: r1346427 - /accumulo/trunk/bin/generate_monitor_certificate.sh
Date Tue, 05 Jun 2012 15:35:06 GMT
Author: billie
Date: Tue Jun  5 15:35:05 2012
New Revision: 1346427

URL: http://svn.apache.org/viewvc?rev=1346427&view=rev
Log:
ACCUMULO-196 added script to generate server cert and display properties that should be added
to accumulo-site.xml

Added:
    accumulo/trunk/bin/generate_monitor_certificate.sh   (with props)

Added: accumulo/trunk/bin/generate_monitor_certificate.sh
URL: http://svn.apache.org/viewvc/accumulo/trunk/bin/generate_monitor_certificate.sh?rev=1346427&view=auto
==============================================================================
--- accumulo/trunk/bin/generate_monitor_certificate.sh (added)
+++ accumulo/trunk/bin/generate_monitor_certificate.sh Tue Jun  5 15:35:05 2012
@@ -0,0 +1,77 @@
+#! /usr/bin/env bash
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+bin=`dirname "$0"`
+bin=`cd "$bin"; pwd`
+
+. "$bin"/config.sh
+
+ALIAS="default"
+KEYPASS=`cat /dev/random | head -c33 | uuencode -m foo | head -2 | tail +2`
+STOREPASS=`cat /dev/random | head -c33 | uuencode -m foo | head -2 | tail +2`
+KEYSTOREPATH="$ACCUMULO_HOME/conf/keystore.jks"
+TRUSTSTOREPATH="$ACCUMULO_HOME/conf/cacerts.jks"
+CERTPATH="$ACCUMULO_HOME/conf/server.cer"
+
+if [ -e $KEYSTOREPATH ] ; then
+  rm -i $KEYSTOREPATH
+  if [ -e $KEYSTOREPATH ] ; then
+    echo "keystore already exists, exiting"
+    exit 1
+  fi
+fi
+
+if [ -e $TRUSTSTOREPATH ] ; then
+  rm -i $TRUSTSTOREPATH
+  if [ -e $TRUSTSTOREPATH ] ; then
+    echo "truststore already exists, exiting"
+    exit 2
+  fi
+fi
+
+if [ -e $CERTPATH ] ; then
+  rm -i $CERTPATH
+  if [ -e $CERTPATH ] ; then
+    echo "cert already exists, exiting"
+    exit 3
+  fi
+fi
+
+keytool -genkey -alias $ALIAS -keyalg RSA -keypass $KEYPASS -storepass $STOREPASS -keystore
$KEYSTOREPATH
+keytool -export -alias $ALIAS -storepass $STOREPASS -file $CERTPATH -keystore $KEYSTOREPATH
+echo "yes" | keytool -import -v -trustcacerts -alias $ALIAS -file $CERTPATH -keystore $TRUSTSTOREPATH
-keypass $KEYPASS -storepass $STOREPASS
+
+echo
+echo "keystore and truststore generated.  now add the following to accumulo-site.xml:"
+echo
+echo "    <property>"
+echo "      <name>monitor.ssl.keyStore</name>"
+echo "      <value>$KEYSTOREPATH</value>"
+echo "    </property>"
+echo "    <property>"
+echo "      <name>monitor.ssl.keyStorePassword</name>"
+echo "      <value>$KEYPASS</value>"
+echo "    </property>"
+echo "    <property>"
+echo "      <name>monitor.ssl.trustStore</name>"
+echo "      <value>$TRUSTSTOREPATH</value>"
+echo "    </property>"
+echo "    <property>"
+echo "      <name>monitor.ssl.trustStorePassword</name>"
+echo "      <value>$STOREPASS</value>"
+echo "    </property>"
+echo

Propchange: accumulo/trunk/bin/generate_monitor_certificate.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: accumulo/trunk/bin/generate_monitor_certificate.sh
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message