Commit 37e10364 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

install stunnel in generic_varnish to support https backend.

parent 13a81682
master 1.0 arnau cedric.ln-erp5-cluster cloudooo-clusterise-split cygwin-res-resstack davstorage-ajaxplorer dream dropbear_do_not_delete_home_dot_ssh erp5 erp5-cluster erp5-cluster-monitoring erp5-cluster-scalability erp5-cluster-z2.13 erp5-component erp5-component-libressl erp5-component-subversion-1.7 erp5-component-subversion-1.8 erp5-component-z2.12 erp5-postfix erp5-rkm erp5-scikit erp5-z2.12 erp5_kernel_jupyter etherpad-lite frontend-monitor-slave-configuration gcc-4.7 glpi grid-computing hexaglobe-watermarking-replicated improved-hello-world ipnb_st ipython ipython_notebook ivan jupyter_wendelin kvm-iaas monitor-stack nbext new-frontend nltk nltk_deploy officejs_testrunner openblas-make-ext-options openstack palo palo-5.1 postgres rafael_agent re6st-master reafs/heads/ipython request-recipe rjsext_deploy rjsext_deploy_new rjsext_deploy_old scikit-notmerge shebang_limitation shellinabox_password_promise_delay slapos-master-cluster slapprunner-shellinabox-wip slaprunner systematic systematic-nginx testing_erp5 testnode_software_link ttrm varnish webrunner.custom-personal wendelin_notebook zerovm-test 1.0.19 1.0.18 1.0.17 1.0.16 1.0.15 1.0.14 1.0.13 1.0.12 1.0.11 1.0.10 1.0.9 1.0.8.1 1.0.8 1.0.7 1.0.6 1.0.5 1.0.4 1.0.3 1.0.2 1.0.1 vifib-20150331 vifib-20150203 vifib-20150130 vifib-20150123 vifib-20150116 vifib-20141222 slaprunner-resilient-v1-RC1 slapos.core-1.0.0rc6-1 slapos.cookbook-0.103 slapos.cookbook-0.102 slapos.cookbook-0.101 slapos.cookbook-0.100 slapos.cookbook-0.99 slapos.cookbook-0.98 slapos.cookbook-0.97 slapos.cookbook-0.96 slapos.cookbook-0.95 slapos.cookbook-0.94 slapos.cookbook-0.93 slapos.cookbook-0.92 slapos.cookbook-0.91 slapos.cookbook-0.90 slapos.cookbook-0.89 slapos.cookbook-0.88 slapos.cookbook-0.87 slapos.cookbook-0.86 slapos.cookbook-0.85 slapos.cookbook-0.84.2 slapos.cookbook-0.84.1 slapos.cookbook-0.84 slapos.cookbook-0.83.1 slapos.cookbook-0.83 slapos.cookbook-0.82 slapos.cookbook-0.81 slapos.cookbook-0.80 slapos.cookbook-0.79 slapos.cookbook-0.78.5 slapos.cookbook-0.78.4 slapos.cookbook-0.78.3 slapos.cookbook-0.78.2 slapos-legacy-flask-stack slapos-0.271 slapos-0.270 slapos-0.269 slapos-0.268 slapos-0.267 slapos-0.266 slapos-0.265 slapos-0.264 slapos-0.263 slapos-0.262 slapos-0.261 slapos-0.260 slapos-0.259.2 slapos-0.259.1 slapos-0.259 slapos-0.258 slapos-0.257 slapos-0.256 slapos-0.255 slapos-0.254 slapos-0.253.3 slapos-0.253.2 slapos-0.253.1 slapos-0.253 slapos-0.252.1 slapos-0.252 slapos-0.251 slapos-0.250.2 slapos-0.250.1 slapos-0.250 slapos-0.249.1 slapos-0.249 slapos-0.248.1 slapos-0.248 slapos-0.247 slapos-0.246 slapos-0.245 slapos-0.244 slapos-0.243 slapos-0.242 slapos-0.241 slapos-0.240.0 slapos-0.240 slapos-0.239 slapos-0.238 slapos-0.237 slapos-0.236 slapos-0.235 slapos-0.234 slapos-0.233 slapos-0.232 slapos-0.231 slapos-0.230 slapos-0.229 slapos-0.228 slapos-0.227 slapos-0.226 slapos-0.225 slapos-0.224 slapos-0.223.1 slapos-0.223 slapos-0.222 slapos-0.221 slapos-0.220 slapos-0.219 slapos-0.218.2 slapos-0.218.1 slapos-0.218 slapos-0.217 slapos-0.217-B1 slapos-0.216 slapos-0.215 slapos-0.214 slapos-0.213 slapos-0.212 slapos-0.211 slapos-0.210 slapos-0.209 slapos-0.208 slapos-0.207 slapos-0.206 slapos-0.205 slapos-0.204 slapos-0.203 slapos-0.202 slapos-0.201 slapos-0.200 slapos-0.199 slapos-0.199-hotfix-20140409 slapos-0.198 slapos-0.197 slapos-0.196 slapos-0.195 slapos-0.194-RC3 slapos-0.194-RC2 slapos-0.194-RC1 slapos-0.193 slapos-0.192 slapos-0.191 slapos-0.190 slapos-0.189 slapos-0.188 slapos-0.187 slapos-0.186 slapos-0.185 slapos-0.184 slapos-0.183 slapos-0.182 slapos-0.181 slapos-0.180 slapos-0.179 slapos-0.178 slapos-0.177.5 slapos-0.177.4 slapos-0.177.3 slapos-0.177.2 slapos-0.177.1 slapos-0.177 slapos-0.176.4 slapos-0.176.3 slapos-0.176.2 slapos-0.176.1 slapos-0.176 slapos-0.175 slapos-0.174 slapos-0.173 slapos-0.172 slapos-0.171 slapos-0.170 slapos-0.169 slapos-0.168.9 slapos-0.168.8 slapos-0.168.7 slapos-0.168.6 slapos-0.168.5 slapos-0.168.4 slapos-0.168.3 slapos-0.168.2 slapos-0.168.1 slapos-0.168 erp5-cluster-0.1.1 cygwin-resstack-3 cygwin-resstack-2 cygwin-resstack-1 cygwin-cachetest-4 cygwin-cachetest-3 cygwin-cachetest-2 cygwin-cachetest-1
No related merge requests found
......@@ -39,9 +39,28 @@ class Recipe(GenericSlapRecipe):
ip = self.options['ip']
backend_url = self.parameter_dict['tidstorage-url']
backend_server, backend_port = self._getBackendServer(backend_url)
path_list = []
if backend_url.startswith('https://'):
config = dict(
stunnel_binary=self.options['stunnel-binary'],
stunnel_server=ip,
stunnel_port=int(self.options['stunnel-port']),
stunnel_pid_file=self.options['stunnel-pid-file'],
stunnel_conf_file=self.options['stunnel-conf-file'],
shell_path=self.options['shell-path'],
backend_server=backend_server.replace('[', '').replace(']', ''),
backend_port=backend_port,
)
path_list.append(self.createExecutable(self.options['stunnel-wrapper'],
self.substituteTemplate(self.getTemplateFilename('stunnel.in'),
config)))
path_list.append(self.createFile(self.options['stunnel-conf-file'],
self.substituteTemplate(self.getTemplateFilename('stunnel.conf.in'),
config)))
backend_server = ip
backend_port = int(self.options['stunnel-port'])
varnishd_manager_port = int(self.options['manager-port'])
varnishd_server_port = int(self.options['server-port'])
path_list = []
config = dict(
varnishd_binary=self.options['varnishd-binary'],
varnish_ip=ip,
......
foreground = yes
output = /dev/stdout
pid = %(stunnel_pid_file)s
debug = 4
[remote]
accept = %(stunnel_server)s:%(stunnel_port)s
client = yes
connect = %(backend_server)s:%(backend_port)s
sni = %(stunnel_server)s
#!%(shell_path)s
DAEMON_OPTS="%(stunnel_conf_file)s"
exec %(stunnel_binary)s ${DAEMON_OPTS} 2>&1
......@@ -48,6 +48,7 @@ extends =
../../component/python-2.7/buildout.cfg
../../component/python-ldap-python/buildout.cfg
../../component/rdiff-backup/buildout.cfg
../../component/stunnel/buildout.cfg
../../component/subversion/buildout.cfg
../../component/tesseract/buildout.cfg
../../component/varnish/buildout.cfg
......@@ -76,6 +77,7 @@ parts =
graphviz
haproxy
jsl
stunnel
varnish-3.0
w3m
poppler
......@@ -235,7 +237,7 @@ mode = 640
# XXX: "template.cfg" is hardcoded in instanciation recipe
filename = template.cfg
template = ${:_profile_base_location_}/instance.cfg.in
md5sum = fbb7ea50d7ea6d4e25725801cc3fd5f9
md5sum = a1a5a9983207e4a8128bab331cbd3cd5
extra-context =
key apache_location apache:location
key aspell_location aspell:location
......@@ -274,6 +276,7 @@ extra-context =
key openssl_location openssl:location
key poppler_location poppler:location
key sed_location sed:location
key stunnel_location stunnel:location
key template_cloudooo template-cloudooo:target
key template_erp5_single template-erp5-single:target
key template_erp5_cluster template-erp5-cluster:target
......@@ -316,7 +319,7 @@ mode = 640
[template-varnish]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance-varnish.cfg.in
md5sum = 728650f5d20ad637d8d824d1968865ca
md5sum = ae0465591c22c0cb316c1706965c6b18
mode = 640
[bt5-repository]
......
......@@ -28,18 +28,23 @@ recipe = slapos.cookbook:generic.varnish
ip = ${slap-network-information:local-ipv4}
server-port = 6001
manager-port = 6002
stunnel-port = 6003
# Paths: Running wrappers
varnishd-wrapper = ${basedirectory:services}/varnishd
varnishlog-wrapper = ${rootdirectory:bin}/varnishlog
stunnel-wrapper = ${basedirectory:services}/stunnel
# Binary information
varnishd-binary = {{ parameter_dict['varnish'] }}/sbin/varnishd
varnishlog-binary = {{ parameter_dict['varnish'] }}/bin/varnishlog
shell-path = {{ parameter_dict['dash'] }}/bin/dash
stunnel-binary = {{ parameter_dict['stunnel'] }}/bin/stunnel
# Configuration by VCL
vcl-file = ${rootdirectory:etc}/default.vcl
pid-file = ${basedirectory:run}/varnishd.pid
stunnel-conf-file = ${rootdirectory:etc}/stunnel.conf
stunnel-pid-file = ${basedirectory:run}/stunnel.pid
varnish-data = ${directory:varnish-data}
# this will pass at -n option
varnish-instance-name = ${directory:varnish-instance}
......
......@@ -99,6 +99,7 @@ dash = {{ dash_location }}
dcron = {{ dcron_location }}
gzip = {{ gzip_location }}
logrotate = {{ logrotate_location }}
stunnel = {{ stunnel_location }}
varnish = {{ varnish_location }}
wget = {{ wget_location }}
buildout-bin-directory = {{ buildout_bin_directory }}
......
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