Skip to content
Browse files

fixing and integrating installation scripts

adding https configuration
  • Loading branch information...
1 parent 6140803 commit 4550b028bc508e1c8bee03106ddbdc7242345e5d BuzzTroll committed with timf May 18, 2010
View
9 bin/create-nimbus-home
@@ -72,6 +72,15 @@ if [ ! -d $NIMBUS_HOME ]; then
fi
fi
+echo "Installing cumulus..."
+${NIMBUS_SRC}/cumulus/install.sh $NIMBUS_HOME/cumulus
+if [ $? -ne 0 ]; then
+ echo "Failed to install cumulus"
+ exit 1
+fi
+source $NIMBUS_HOME/cumulus/env.sh
+
+
echo "Deploying skeleton directory structure.."
cp -fr $NIMBUS_SRC/home/* $NIMBUS_HOME/
if [ $? -ne 0 ]; then
View
46 cumulus/install.sh
@@ -16,6 +16,13 @@ else
cd $installdir
# just in case they enter the same dir as the source distro
installdir=`pwd`
+ echo "Installing cumulus to $installdir"
+ cp -r $source_dir/* $installdir
+ if [ "X$?" != "X0" ]; then
+ echo "Copy to $installdir failed"
+ echo "verify that you can write to that directory"
+ fi
+ cd $source_dir
fi
python -c "from twisted.web import server, resource" 2> /dev/null
@@ -39,28 +46,23 @@ if [ "X$?" != "X0" ]; then
fi
if [ "X$authz_deps" != "X0" ]; then
- echo "WARNING: Did not find sqlite3 thus we cannot use pynimbusauthz"
- echo " using basic file security instead"
- echo " this is ok for testing and small install"
-else
- sec_type="authz"
+ echo "ERROR: Did not find sqlite3 thus we cannot use pynimbusauthz"
+ echo " using basic file security instead"
+ echo " this is ok for testing and small install"
- dbf="$installdir/etc/authz.db"
- if [ -f "$dbf" ]; then
- echo "WARNING: db already exists"
- else
- sqlite3 -batch ${dbf} < $installdir/etc/acl.sql
- fi
+ exit 1
fi
-if [ "$installdir" != "$source_dir" ]; then
- cp -r $source_dir $installdir
- if [ "X$?" != "X0" ]; then
- echo "Copy to $installdir failed"
- echo "verify that you can write to that directory"
- fi
+sec_type="authz"
+
+dbf="$installdir/etc/authz.db"
+if [ -f "$dbf" ]; then
+ echo "WARNING: db already exists"
+else
+ sqlite3 -batch ${dbf} < $installdir/etc/acl.sql
fi
+
host=`hostname -f`
me=`id -u`
if [ "X$me" == "X0" ]; then
@@ -80,9 +82,17 @@ else
fi
sed -e "s^@@INSTALLDIR@@^$installdir^g" $installdir/etc/env.sh.in > $installdir/env.sh
+if [ $? -ne 0 ]; then
+ exit 1
+fi
sed -e "s^@@INSTALLDIR@@^$installdir^g" -e "s^@@HOSTNAME@@^$host^g" -e "s^@@PORT@@^$port^g" -e "s^@@SEC@@^$sec_type^g" $installdir/etc/cumulus.ini.in > $outf
-
+if [ $? -ne 0 ]; then
+ exit 1
+fi
sed -e "s^@@HOST_PORT@@^$host:$port^g" $installdir/etc/dot_s3cfg.in > $installdir/dot_s3cfg
+if [ $? -ne 0 ]; then
+ exit 1
+fi
echo "Make further customizations by editing $outf"
View
11 cumulus/pycb/__init__.py
@@ -89,7 +89,6 @@ def setup_logger(self):
handler.setFormatter(formatter)
logger.addHandler(handler)
-
def default_settings(self):
self.auth_error = ""
self.hostname = socket.gethostname()
@@ -100,6 +99,9 @@ def default_settings(self):
self.log_level = logging.INFO
self.log_filename = None
self.location = "CumulusLand"
+ self.https_key = None
+ self.https_cert = None
+ self.use_https = False
def get_contact(self):
return (self.hostname, self.port)
@@ -174,6 +176,13 @@ def load_settings(self):
except:
pass
+ try:
+ self.https_key = s.getboolean("https", "key")
+ self.https_cert = s.getboolean("https", "cert")
+ self.use_https = s.getboolean("https", "enabled")
+ except:
+ pass
+
def parse_cmdline(self, argv):
global Version
View
14 cumulus/pycb/cumulus.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
from twisted.web import server, resource, http
-from twisted.internet import reactor
+from twisted.internet import reactor, ssl
from cbPosixBackend import cbPosixBackend
from ConfigParser import SafeConfigParser
import hashlib
@@ -252,7 +252,17 @@ def __init__(self):
self.done = False
self.cb = CBService()
self.site = CumulusSite(self.cb)
- self.iconnector = reactor.listenTCP(self.cb.get_port(), self.site)
+
+ # figure out if we need http of https
+ if pycb.config.use_https:
+ sslContext = ssl.DefaultOpenSSLContextFactory(
+ pycb.config.https_key,
+ pycb.config.https_cert)
+ self.iconnector = reactor.listenSSL(self.cb.get_port(),
+ self.site,
+ sslContext)
+ else:
+ self.iconnector = reactor.listenTCP(self.cb.get_port(), self.site)
def getListener(self):
return self.iconnector.getHost()
View
2 home/bin/nimbusctl
@@ -6,6 +6,8 @@ NIMBUS_HOME_REL="`dirname $0`/.."
NIMBUS_HOME=`cd $NIMBUS_HOME_REL; pwd`
export NIMBUS_HOME
+. $NIMBUS_HOME/cumulus/env.sh
+
NIMBUS_WEBDIR="$NIMBUS_HOME/web"
NIMBUS_PYLIB="$NIMBUS_WEBDIR/lib/python"
View
1 home/sbin/nimbusconfigure.py
@@ -33,6 +33,7 @@
services.enabled: True
services.wait: 10
web.enabled: False
+cumulus.enabled: True
"""
CONFIG_STATE_PATH = 'nimbus-setup.conf'
View
18 home/sbin/nimbusctl.py
@@ -42,8 +42,9 @@
sys.exit(_NO_CONFIG_ERROR)
web_enabled = config.getboolean('nimbussetup', 'web.enabled')
services_enabled = config.getboolean('nimbussetup', 'services.enabled')
+cumulus_enabled = config.getboolean('nimbussetup', 'services.enabled')
-if not (web_enabled or services_enabled):
+if not (web_enabled or services_enabled or cumulus_enabled):
sys.exit("Neither Nimbus services nor Nimbus web are enabled. "+
"See the '%s' config file to adjust this setting." % CONFIG_PATH)
@@ -88,6 +89,21 @@
postStartDelay=3
))
+if cumulus_enabled:
+ CUMULUS_SERVICE_EXE = os.path.join(NIMBUS_HOME, "cumulus/bin/cumulus.sh")
+ if not os.path.exists(CUMULUS_SERVICES_EXE):
+ sys.exit("The services executable does not exist: " +
+ CUMULUS_SERVICES_EXE)
+ ProcessManager.add( Process(
+ name = "cumulus",
+ desc = "Nimbus services",
+ program = CUMULUS_SERVICES_EXE,
+ args = [],
+ workingDir = NIMBUS_HOME,
+ postStartDelay=5
+ ))
+
+
argv = sys.argv
if len(argv) == 2:
argv = argv[:]
View
2 service/service/java/source/etc/workspace-service/other/common.conf
@@ -68,5 +68,5 @@ msgsinks.dir=$NIMBUS_HOME/services/var/nimbus/msg-sinks
# MERGE_TODO
cumulus.home.dir=/@CUMULUSDIR@
-cumulus.authz.db=/@CUMULUSDIR@/etc/authz.db
+cumulus.authz.db=/@AUTHZDB@
cumulus.repo.dir=/@CUMULUSDIR@/posixdata

0 comments on commit 4550b02

Please sign in to comment.
Something went wrong with that request. Please try again.