kumofs : working set

parent ff029a11
...@@ -47,16 +47,15 @@ class Recipe(BaseSlapRecipe): ...@@ -47,16 +47,15 @@ class Recipe(BaseSlapRecipe):
ca_conf = self.installCertificateAuthority() ca_conf = self.installCertificateAuthority()
key, certificate = self.requestCertificate('Login Based Access') key, certificate = self.requestCertificate('Login Based Access')
stunnel_conf = self.installStunnel(self.getGlobalIPv6Address(), 12345, stunnel_conf = self.installStunnel(self.getGlobalIPv6Address(),
kumo_conf['kumo_gateway_port'], self.getLocalIPv4Address(), 12345, kumo_conf['kumo_gateway_port'],
certificate, key, ca_conf['ca_crl'], certificate, key, ca_conf['ca_crl'],
ca_conf['certificate_authority_path']) ca_conf['certificate_authority_path'])
self.linkBinary() self.linkBinary()
self.setConnectionDict(dict( self.setConnectionDict(dict(
kumofs_local_ip = kumo_conf['kumo_gateway_ip'], stunnel_ip = stunnel_conf['public_ip'],
stunnel_ip = stunnel_conf['ipv6'], stunnel_port = stunnel_conf['public_port'],
stunnel_port = stunnel_conf['port'],
)) ))
return self.path_list return self.path_list
...@@ -199,23 +198,23 @@ class Recipe(BaseSlapRecipe): ...@@ -199,23 +198,23 @@ class Recipe(BaseSlapRecipe):
parser.write(open(os.path.join(self.ca_request_dir, hash), 'w')) parser.write(open(os.path.join(self.ca_request_dir, hash), 'w'))
return key, certificate return key, certificate
def installStunnel(self, ip, port, external_port, def installStunnel(self, public_ip, private_ip, public_port, private_port,
ca_certificate, key, ca_crl, ca_path): ca_certificate, key, ca_crl, ca_path):
"""Installs stunnel""" """Installs stunnel"""
template_filename = self.getTemplateFilename('stunnel.conf.in') template_filename = self.getTemplateFilename('stunnel.conf.in')
log = os.path.join(self.log_directory, 'stunnel.log') log = os.path.join(self.log_directory, 'stunnel.log')
pid_file = os.path.join(self.run_directory, 'stunnel.pid') pid_file = os.path.join(self.run_directory, 'stunnel.pid')
stunnel_conf = dict( stunnel_conf = dict(
ipv6=ip, public_ip=public_ip,
ipv4=self.getLocalIPv4Address(), private_ip=private_ip,
port=port, public_port=public_port,
pid_file=pid_file, pid_file=pid_file,
log=log, log=log,
cert = ca_certificate, cert = ca_certificate,
key = key, key = key,
ca_crl = ca_crl, ca_crl = ca_crl,
ca_path = ca_path, ca_path = ca_path,
external_port = external_port, private_port = private_port,
) )
stunnel_conf_path = self.createConfigurationFile("stunnel.conf", stunnel_conf_path = self.createConfigurationFile("stunnel.conf",
self.substituteTemplate(template_filename, self.substituteTemplate(template_filename,
......
...@@ -9,5 +9,5 @@ cert = %(cert)s ...@@ -9,5 +9,5 @@ cert = %(cert)s
;key = /etc/ssl/certs/stunnel.pem ;key = /etc/ssl/certs/stunnel.pem
[mysqls] [mysqls]
accept = %(ipv6)s:%(port)s accept = %(public_ip)s:%(public_port)s
connect = %(ipv4)s:%(external_port)s connect = %(private_ip)s:%(private_port)s
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment