Author: chirino Date: Mon Dec 19 17:49:27 2011 New Revision: 1220874 URL: http://svn.apache.org/viewvc?rev=1220874&view=rev Log: fixes APLO-120 : Add a --with-ssl option to the apollo create command to control if an SSL enabled configuration is created.
Modified: activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala Modified: activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala?rev=1220874&r1=1220873&r2=1220874&view=diff ============================================================================== --- activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala (original) +++ activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala Mon Dec 19 17:49:27 2011 @@ -50,6 +50,9 @@ class Create extends Action { @option(name = "--home", description = "Directory where apollo is installed") val home: String = System.getProperty("apollo.home") + @option(name = "--with-ssl", description = "Generate an SSL enabled configuraiton") + val with_ssl = true + var broker_security_config = """ <authentication domain="apollo"/> @@ -93,23 +96,28 @@ class Create extends Action { } // Generate a keystore with a new key - println("Generating ssl keystore...") - val ssl = system(etc, Array( - "keytool", "-genkey", - "-storetype", "JKS", - "-storepass", "password", - "-keystore", "keystore", - "-keypass", "password", - "-alias", host, - "-keyalg", "RSA", - "-keysize", "4096", - "-dname", "cn=%s".format(host), - "-validity", "3650"))==0 + val ssl = with_ssl && { + println("Generating ssl keystore...") + val rc = system(etc, Array( + "keytool", "-genkey", + "-storetype", "JKS", + "-storepass", "password", + "-keystore", "keystore", + "-keypass", "password", + "-alias", host, + "-keyalg", "RSA", + "-keysize", "4096", + "-dname", "cn=%s".format(host), + "-validity", "3650"))==0 + if(!rc) { + println("WARNNIG: Could not generate the keystore, make sure the keytool command is in your PATH") + } + rc + } if( ssl ) { write("etc/apollo-ssl.xml", etc/"apollo.xml", true) } else { - println("WARNNIG: Could not generate the keystore, make sure the keytool command is in your PATH") write("etc/apollo.xml", etc/"apollo.xml", true) }