Commit d8a5f06c authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

Merge remote-tracking branch 'origin/master' into erp5-component

parents 3f377b24 ab499ffc
...@@ -60,7 +60,7 @@ class Recipe(object): ...@@ -60,7 +60,7 @@ class Recipe(object):
try: try:
with open(self.storage_path) as f: with open(self.storage_path) as f:
passwd = f.read() passwd = f.read()
except IOError, e: except IOError as e:
if e.errno != errno.ENOENT: if e.errno != errno.ENOENT:
raise raise
passwd = None passwd = None
...@@ -79,11 +79,11 @@ class Recipe(object): ...@@ -79,11 +79,11 @@ class Recipe(object):
if self.storage_path: if self.storage_path:
try: try:
os.unlink(self.storage_path) os.unlink(self.storage_path)
except OSError, e: except OSError as e:
if e.errno != errno.ENOENT: if e.errno != errno.ENOENT:
raise raise
fd = os.open(self.storage_path, fd = os.open(self.storage_path,
os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0600) os.O_CREAT | os.O_EXCL | os.O_WRONLY | os.O_TRUNC, 0600)
try: try:
os.write(fd, self.passwd) os.write(fd, self.passwd)
finally: finally:
......
...@@ -112,12 +112,15 @@ The way to do that is to send a new parameter to your runner instance, using the ...@@ -112,12 +112,15 @@ The way to do that is to send a new parameter to your runner instance, using the
To create the frontend, you now have to wait the slaprunner to be processed. To create the frontend, you now have to wait the slaprunner to be processed.
You can define the type of your backend using "custom-frontend-backend-type". eg: zope
If you deploy a server, which uses basic auth, you also have to declare the parameter "custom-frontend-basic-auth" as true, or your slaprunner instance won't show as correctly instanciated. If you deploy a server, which uses basic auth, you also have to declare the parameter "custom-frontend-basic-auth" as true, or your slaprunner instance won't show as correctly instanciated.
Example : Example :
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<instance> <instance>
<parameter id="custom-frontend-backend-url">http(s)://[THE_IPV6_ADDRESS]:PORT</parameter> <parameter id="custom-frontend-backend-url">http(s)://[THE_IPV6_ADDRESS]:PORT</parameter>
<parameter id="custom-frontend-backend-type">zope</parameter>
<parameter id="custom-frontend-basic-auth">true</parameter> <parameter id="custom-frontend-basic-auth">true</parameter>
</instance> </instance>
......
...@@ -44,7 +44,7 @@ mode = 0644 ...@@ -44,7 +44,7 @@ mode = 0644
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-runner.cfg url = ${:_profile_base_location_}/instance-runner.cfg
output = ${buildout:directory}/template-runner.cfg.in output = ${buildout:directory}/template-runner.cfg.in
md5sum = 9f32b1bcd32e90950ee94e8d41dfdcd7 md5sum = b30d71f2f0abfecc2638fe6b804f3c43
mode = 0644 mode = 0644
[instance-runner-import] [instance-runner-import]
...@@ -80,7 +80,7 @@ mode = 0644 ...@@ -80,7 +80,7 @@ mode = 0644
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/nginx_conf.in url = ${:_profile_base_location_}/nginx_conf.in
download-only = true download-only = true
md5sum = 67d2ce92b4ad6dca6eaf69eeb2c2734c md5sum = 7c0608eafb5c6998846851744a70b3de
filename = nginx_conf.in filename = nginx_conf.in
mode = 0644 mode = 0644
......
...@@ -59,7 +59,7 @@ offline = true ...@@ -59,7 +59,7 @@ offline = true
# Internaly, the frontend will be asked to listen on the IPv6 # Internaly, the frontend will be asked to listen on the IPv6
# with port X + 10000, to match NAT rules of Qemu. # with port X + 10000, to match NAT rules of Qemu.
[request-custom-frontend] [request-custom-frontend]
recipe = slapos.cookbook:request recipe = slapos.cookbook:requestoptional
software-url = {{ slapparameter_dict.get('custom-frontend-software-url', 'http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg') }} software-url = {{ slapparameter_dict.get('custom-frontend-software-url', 'http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg') }}
software-type = {{ slapparameter_dict.get('custom-frontend-software-type', 'RootSoftwareInstance') }} software-type = {{ slapparameter_dict.get('custom-frontend-software-type', 'RootSoftwareInstance') }}
slave = true slave = true
...@@ -71,12 +71,18 @@ cert-file = $${slap-connection:cert-file} ...@@ -71,12 +71,18 @@ cert-file = $${slap-connection:cert-file}
computer-id = $${slap-connection:computer-id} computer-id = $${slap-connection:computer-id}
partition-id = $${slap-connection:partition-id} partition-id = $${slap-connection:partition-id}
{% if slapparameter_dict.get('custom-frontend-instance-guid') -%} {%- if slapparameter_dict.get('custom-frontend-instance-guid') -%}
sla = instance_guid sla = instance_guid
sla-instance_guid = $${slap-parameter:frontend-instance-guid} sla-instance_guid = $${slap-parameter:frontend-instance-guid}
{% endif -%} {% endif -%}
{% set custom_frontend_backend_type = slapparameter_dict.get('custom-frontend-backend-type')%}
{% if custom_frontend_backend_type %}
config = url type
config-type = {{ custom_frontend_backend_type }}
{% else %}
config = url config = url
{% endif -%}
config-url = {{ slapparameter_dict.get('custom-frontend-backend-url') }} config-url = {{ slapparameter_dict.get('custom-frontend-backend-url') }}
return = site_url domain return = site_url domain
...@@ -92,7 +98,7 @@ curl_path = {{ curl_executable_location }} ...@@ -92,7 +98,7 @@ curl_path = {{ curl_executable_location }}
[publish-connection-informations] [publish-connection-informations]
custom-frontend-url = https://$${request-custom-frontend:connection-domain} custom-frontend-url = https://$${request-custom-frontend:connection-domain}
{% endif -%} {% endif %}
# Create all needed directories # Create all needed directories
[directory] [directory]
...@@ -337,7 +343,7 @@ path_pid = $${directory:run}/gunicorn.pid ...@@ -337,7 +343,7 @@ path_pid = $${directory:run}/gunicorn.pid
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
command-line = $${gunicorn:bin_gunicorn} slapos.runner:app -p $${gunicorn:path_pid} -b unix:$${gunicorn:socket} -e RUNNER_CONFIG=$${slaprunner:slapos.cfg} --preload command-line = $${gunicorn:bin_gunicorn} slapos.runner:app -p $${gunicorn:path_pid} -b unix:$${gunicorn:socket} -e RUNNER_CONFIG=$${slaprunner:slapos.cfg} --preload
wrapper-path = $${gunicorn:bin_launcher} wrapper-path = $${gunicorn:bin_launcher}
environment = PATH=$${environ:PATH} environment = PATH=$${environ:PATH}:${git:location}/bin/
RUNNER_CONFIG=$${slaprunner:slapos.cfg} RUNNER_CONFIG=$${slaprunner:slapos.cfg}
[gunicorn-graceful] [gunicorn-graceful]
......
...@@ -13,6 +13,7 @@ events { ...@@ -13,6 +13,7 @@ events {
http { http {
default_type application/octet-stream; default_type application/octet-stream;
access_log {{ param_nginx_frontend['path_access_log'] }} combined; access_log {{ param_nginx_frontend['path_access_log'] }} combined;
client_max_body_size 10M;
map $http_upgrade $connection_upgrade { map $http_upgrade $connection_upgrade {
default upgrade; default upgrade;
'' close; '' close;
......
...@@ -46,11 +46,30 @@ ...@@ -46,11 +46,30 @@
"description": "return an ipv4 frontend of the given ipv6(+optional port)", "description": "return an ipv4 frontend of the given ipv6(+optional port)",
"type": "string" "type": "string"
}, },
"custom-frontend-backend-type": {
"description": "The type of the frontend slave instance to ask",
"type": "string"
},
"custom-frontend-basic-auth": { "custom-frontend-basic-auth": {
"description": "if the ip given with 'custom-frontend-backend-url' is secure, set it to true for the promise do not fail", "description": "if the ip given with 'custom-frontend-backend-url' is secure, set it to true for the promise do not fail",
"type": "boolean", "type": "boolean",
"default": "false" "default": "false"
} },
"custom-frontend-instance-guid": {
"description": "Instance guid of the frontend you whish to use",
"type": "string",
"default": "none"
},
"custom-frontend-software-type": {
"description": "SoftwareType of the frontend you request",
"default": "RootSoftwareInstance",
"type": "string"
},
"custom-frontend-software-url": {
"description": "Software Url of the frontend you request",
"default": "http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg"
"type": "string"
},
"monitor-port": { "monitor-port": {
"description": "allow to manually change the port on wich the apache server running monitoring interface is listening. The default value for the webrunner is different from the default value of the standalone stack-monitor server", "description": "allow to manually change the port on wich the apache server running monitoring interface is listening. The default value for the webrunner is different from the default value of the standalone stack-monitor server",
"type": "integer", "type": "integer",
......
...@@ -212,7 +212,7 @@ slapos.recipe.build = 0.11.5 ...@@ -212,7 +212,7 @@ slapos.recipe.build = 0.11.5
slapos.recipe.cmmi = 0.2 slapos.recipe.cmmi = 0.2
slapos.recipe.download = 1.0.dev-r4053 slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.4.2 slapos.recipe.template = 2.4.2
slapos.toolbox = 0.39.1 slapos.toolbox = 0.39.2
smmap = 0.8.2 smmap = 0.8.2
xml-marshaller = 0.9.7 xml-marshaller = 0.9.7
z3c.recipe.scripts = 1.0.1 z3c.recipe.scripts = 1.0.1
......
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