예제 #1
0
	
	if not config['server_force_ssh']: 
		config['server_use_ssl'] = False
	else:
		if 'ssh_root' not in config.keys():
			print "\n****************************"
			print "Where is your ssh folder?"
			config['ssh_root'] = prompt("[DEFAULT: ~/.ssh] ")
			print "****************************\n"
		
		if len(config['ssh_root']) == 0:
			config['ssh_root'] = os.path.join(os.path.expanduser("~"), ".ssh")

		if 'ssh_key_priv' not in config.keys():
			print "Unveillance will now generate a public/private key pair for communication with the server"
			config['ssh_key_pwd'] = generateNonce(top_range=59, bottom_range=29)
			config['ssh_key_priv'] = os.path.join(config['ssh_root'],
				"unveillance.%d.key" % time())
			config['ssh_key_pub'] = "%s.pub" % config['ssh_key_priv']
		
			with settings(warn_only=True):
				'''
				local("ssh-keygen -f %s -t rsa -b 4096 -N %s" % (config['ssh_key_priv'],
					config['ssh_key_pwd']))
				'''
				local('ssh-keygen -f %s -t rsa -b 4096 -N ""' % config['ssh_key_priv'])
				print "****************************\n"

		with settings(warn_only=True):
			# copy public key into annex local only
			local("cp %s %s" % (config['ssh_key_pub'], config['annex_local']))
예제 #2
0
    if not config['server_force_ssh']:
        config['server_use_ssl'] = False
    else:
        if 'ssh_root' not in config.keys():
            print "\n****************************"
            print "Where is your ssh folder?"
            config['ssh_root'] = prompt("[DEFAULT: ~/.ssh] ")
            print "****************************\n"

        if len(config['ssh_root']) == 0:
            config['ssh_root'] = os.path.join(os.path.expanduser("~"), ".ssh")

        if 'ssh_key_priv' not in config.keys():
            print "Unveillance will now generate a public/private key pair for communication with the server"
            config['ssh_key_pwd'] = generateNonce(top_range=59,
                                                  bottom_range=29)
            config['ssh_key_priv'] = os.path.join(
                config['ssh_root'], "unveillance.%d.key" % time())
            config['ssh_key_pub'] = "%s.pub" % config['ssh_key_priv']

            with settings(warn_only=True):
                '''
				local("ssh-keygen -f %s -t rsa -b 4096 -N %s" % (config['ssh_key_priv'],
					config['ssh_key_pwd']))
				'''
                local('ssh-keygen -f %s -t rsa -b 4096 -N ""' %
                      config['ssh_key_priv'])
                print "****************************\n"

        with settings(warn_only=True):
            # copy public key into annex local only
예제 #3
0
		with settings(warn_only=True):
			local("wget -O lib/elasticsearch.tar.gz https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.tar.gz")
			local("tar -xvzf lib/elasticsearch.tar.gz -C lib")
			local("rm lib/elasticsearch.tar.gz")

		els_root = locateLibrary(r'elasticsearch*')
	else:
		print "Elasticsearch downloaded; moving on..."
	
	with open(os.path.join(os.path.expanduser("~"), ".bash_profile"), 'ab') as BASHRC:
		BASHRC.write("export UV_SERVER_HOST=\"%s\"\n" % uv_server_host)
		BASHRC.write("export UV_UUID=\"%s\"\n" % uv_uuid)
	
	with open(os.path.join(base_dir, "conf", "annex.config.yaml"), "wb+") as CONFIG:
		CONFIG.write("base_dir: %s\n" % base_dir)
		CONFIG.write("annex_dir: %s\n" % annex_dir)
		CONFIG.write("els_root: %s\n" % os.path.join(els_root, "bin", "elasticsearch"))
		CONFIG.write("monitor_root: %s\n" % monitor_root)
		CONFIG.write("sys_arch: %s\n" % SYS_ARCH)
		CONFIG.write("python_home: %s\n" % PYTHON_HOME)
		CONFIG.write("ssh_root: %s\n" % SSH_ROOT)
		CONFIG.write("uv_log_cron: %d\n" % uv_log_cron)
	
	with open(os.path.join(base_dir, "conf", "annex.config.yaml"), "ab") as CONFIG:
		from lib.Core.Utils.funcs import generateNonce
		CONFIG.write("document_salt: \"%s\"\n" % generateNonce())
	
	initAnnex(annex_dir, base_dir, PYTHON_HOME)
	os.chdir(base_dir)
	
	exit(0)