Commit d42ec5f1 authored by Romain Courteaud's avatar Romain Courteaud

Allow to do ipv4toipv6 and ipv6toipv4 tunneling.

Component used are 6tunnel and haproxy.
parent 4318a553
......@@ -68,6 +68,8 @@ setup(name=name,
'generic.cloudooo = slapos.recipe.generic_cloudooo:Recipe',
'cloudooo.test = slapos.recipe.cloudooo_test:Recipe',
'firefox = slapos.recipe.firefox:Recipe',
'ipv6toipv4 = slapos.recipe.ipv6toipv4:Recipe',
'ipv4toipv6 = slapos.recipe.ipv4toipv6:Recipe',
'fontconfig = slapos.recipe.fontconfig:Recipe',
'java = slapos.recipe.java:Recipe',
'kumofs = slapos.recipe.kumofs:Recipe',
......
##############################################################################
#
# Copyright (c) 2012 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from slapos.recipe.librecipe import GenericBaseRecipe
import os
import sys
class Recipe(GenericBaseRecipe):
"""
ipv4toipv6 tunnel configuration.
"""
def install(self):
config = dict(
ipv6=self.options['ipv6'],
ipv6_port=self.options['ipv6-port'],
ipv4=self.options['ipv4'],
ipv4_port=self.options['ipv4-port'],
shell_path=self.options['shell-path'],
tunnel6_path=self.options['tunnel6-path'],
)
runner_path = self.createExecutable(
self.options['runner-path'],
self.substituteTemplate(self.getTemplateFilename('run.in'),
config))
return [runner_path]
#!%(shell_path)s
# BEWARE: This file is operated by slapgrid
# BEWARE: It will be overwritten automatically
exec %(tunnel6_path)s -d -l %(ipv4)s %(ipv4_port)s %(ipv6)s %(ipv6_port)s
##############################################################################
#
# Copyright (c) 2012 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from slapos.recipe.librecipe import GenericBaseRecipe
import os
import sys
class Recipe(GenericBaseRecipe):
"""
ipv6toipv4 tunnel configuration.
"""
def install(self):
config = dict(
ipv6=self.options['ipv6'],
ipv6_port=self.options['ipv6-port'],
ipv4=self.options['ipv4'],
ipv4_port=self.options['ipv4-port'],
shell_path=self.options['shell-path'],
haproxy_path=self.options['haproxy-path'],
conf_path=self.options['conf-path'],
)
configuration_path = self.createFile(
self.options['conf-path'],
self.substituteTemplate(self.getTemplateFilename('configuration.cfg.in'),
config))
runner_path = self.createExecutable(
self.options['runner-path'],
self.substituteTemplate(self.getTemplateFilename('run.in'),
config))
return [runner_path, configuration_path]
global
maxconn 4096
defaults
log global
mode tcp
option dontlognull
retries 3
contimeout 5000
clitimeout 50000
srvtimeout 50000
listen ipv6toipv4 %(ipv6)s:%(ipv6_port)s
mode tcp
server ipv4server %(ipv4)s:%(ipv4_port)s
#!%(shell_path)s
# BEWARE: This file is operated by slapgrid
# BEWARE: It will be overwritten automatically
exec %(haproxy_path)s -f %(conf_path)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