Commit 25b8fcef authored by Jérome Perrin's avatar Jérome Perrin

stack/erp5: drop Zope2 directives from zope.conf and ZServer support

ERP5 now only supports WSGI
parent 733b97a8
...@@ -186,11 +186,6 @@ ...@@ -186,11 +186,6 @@
}, },
"type": "object" "type": "object"
}, },
"wsgi": {
"description": "If set to true, Zope is run as a WSGI application, instead of using the Medusa HTTP server.",
"type": "boolean",
"default": true
},
"zope-partition-dict": { "zope-partition-dict": {
"description": "Zope layout definition", "description": "Zope layout definition",
"default": { "default": {
......
...@@ -34,7 +34,7 @@ md5sum = 45cc45510b59ceb730b6e38448b5c0c3 ...@@ -34,7 +34,7 @@ md5sum = 45cc45510b59ceb730b6e38448b5c0c3
[template-zope-conf] [template-zope-conf]
filename = zope.conf.in filename = zope.conf.in
md5sum = 828dedaaa1d2007eac6f65cc8009e1fb md5sum = 3f06e23af6a35e4a4f69fdd92d8031de
[site-zcml] [site-zcml]
filename = site.zcml filename = site.zcml
...@@ -86,7 +86,7 @@ md5sum = 0ac4b74436f554cd677f19275d18d880 ...@@ -86,7 +86,7 @@ md5sum = 0ac4b74436f554cd677f19275d18d880
[template-zope] [template-zope]
filename = instance-zope.cfg.in filename = instance-zope.cfg.in
md5sum = c798dece9de7478aebbea4cee244f0c7 md5sum = 2785d2fa6466a0e425f965a1a07a6ea6
[template-balancer] [template-balancer]
filename = instance-balancer.cfg.in filename = instance-balancer.cfg.in
......
{% from "instance_zodb_base" import zodb_dict with context %} {% from "instance_zodb_base" import zodb_dict with context %}
{% set wsgi = slapparameter_dict['wsgi'] -%}
{% set webdav = slapparameter_dict['webdav'] -%} {% set webdav = slapparameter_dict['webdav'] -%}
{% set use_ipv6 = slapparameter_dict.get('use-ipv6', False) -%} {% set use_ipv6 = slapparameter_dict.get('use-ipv6', False) -%}
{% set ports = itertools.count(slapparameter_dict['port-base']) -%} {% set ports = itertools.count(slapparameter_dict['port-base']) -%}
...@@ -242,29 +241,6 @@ pem = {{dumps(storage_dict.pop(k))}} ...@@ -242,29 +241,6 @@ pem = {{dumps(storage_dict.pop(k))}}
{% endfor -%} {% endfor -%}
{# endhack -#} {# endhack -#}
[runzope-base]
<= run-common
instance-home = ${directory:instance}
{% if wsgi -%}
wrapped-command-line =
'{{ bin_directory }}/runwsgi'
--event-log-file={{ '${' ~ conf_parameter_name ~ ':event-log}' }}
--access-log-file={{ '${' ~ conf_parameter_name ~ ':z2-log}' }}
{% if longrequest_logger_interval > 0 %} --long-request-log-file={{ '${' ~ conf_parameter_name ~ ':longrequest-logger-file}' }} {% endif %}
{% if webdav %}-w{% endif %}
{{ ipv4 }}:${:port}
{% if timerserver_interval %}--timerserver-interval={{ timerserver_interval }}{% endif %}
'${:configuration-file}'
--threads={{ thread_amount }}
--large-file-threshold={{ slapparameter_dict['large-file-threshold'] }}
{% else -%}
wrapped-command-line = '{{ bin_directory }}/runzope' -C '${:configuration-file}'
{%- endif %}
{%- set private_dev_shm = slapparameter_dict['private-dev-shm'] %}
{%- if private_dev_shm %}
private-tmpfs = {{ private_dev_shm }} /dev/shm
{%- endif %}
[{{ section('zcml') }}] [{{ section('zcml') }}]
recipe = slapos.cookbook:copyfilelist recipe = slapos.cookbook:copyfilelist
target-directory = ${directory:instance-etc} target-directory = ${directory:instance-etc}
...@@ -305,7 +281,6 @@ tidstorage-port = {{ dumps(slapparameter_dict['tidstorage-port']) }} ...@@ -305,7 +281,6 @@ tidstorage-port = {{ dumps(slapparameter_dict['tidstorage-port']) }}
{% endif -%} {% endif -%}
{% set thread_amount = slapparameter_dict['thread-amount'] -%} {% set thread_amount = slapparameter_dict['thread-amount'] -%}
webdav = {{ dumps(webdav) }} webdav = {{ dumps(webdav) }}
wsgi = {{ dumps(wsgi) }}
timerserver-interval = {{ dumps(timerserver_interval) }} timerserver-interval = {{ dumps(timerserver_interval) }}
[zope-conf-base] [zope-conf-base]
...@@ -331,7 +306,6 @@ import-list = ...@@ -331,7 +306,6 @@ import-list =
[{{ conf_parameter_name }}] [{{ conf_parameter_name }}]
< = zope-conf-parameter-base < = zope-conf-parameter-base
pid-file = ${directory:run}/{{ name }}.pid pid-file = ${directory:run}/{{ name }}.pid
lock-file = ${directory:run}/{{ name }}.lock
port = {{ port }} port = {{ port }}
event-log = ${directory:log}/{{ name }}-event.log event-log = ${directory:log}/{{ name }}-event.log
z2-log = ${directory:log}/{{ name }}-Z2.log z2-log = ${directory:log}/{{ name }}-Z2.log
...@@ -364,14 +338,30 @@ context = ...@@ -364,14 +338,30 @@ context =
section parameter_dict {{ conf_parameter_name }} section parameter_dict {{ conf_parameter_name }}
import os os import os os
import re re import re re
[runzope-base]
<= run-common
instance-home = ${directory:instance}
wrapped-command-line =
'{{ bin_directory }}/runwsgi'
--event-log-file={{ '${' ~ conf_parameter_name ~ ':event-log}' }}
--access-log-file={{ '${' ~ conf_parameter_name ~ ':z2-log}' }}
{% if longrequest_logger_interval > 0 %} --long-request-log-file={{ '${' ~ conf_parameter_name ~ ':longrequest-logger-file}' }} {% endif %}
{% if webdav %}-w{% endif %}
{{ ipv4 }}:${:port}
{% if timerserver_interval %}--timerserver-interval={{ timerserver_interval }}{% endif %}
'${:configuration-file}'
--threads={{ thread_amount }}
--large-file-threshold={{ slapparameter_dict['large-file-threshold'] }}
{%- set private_dev_shm = slapparameter_dict['private-dev-shm'] %}
{%- if private_dev_shm %}
private-tmpfs = {{ private_dev_shm }} /dev/shm
{%- endif %}
[{{ section(name) }}] [{{ section(name) }}]
< = runzope-base < = runzope-base
wrapper-path = ${directory:service-on-watch}/{{ name }} wrapper-path = ${directory:service-on-watch}/{{ name }}
configuration-file = {{ '${' ~ conf_name ~ ':output}' }} configuration-file = {{ '${' ~ conf_name ~ ':output}' }}
{%- if wsgi %}
port = {{ port }} port = {{ port }}
{%- endif %}
hash-files = hash-files =
${:configuration-file} ${:configuration-file}
hash-existing-files = hash-existing-files =
...@@ -497,9 +487,6 @@ environment-extra = ...@@ -497,9 +487,6 @@ environment-extra =
SQLBENCH_PATH={{ parameter_dict['sqlbench_path'] }} SQLBENCH_PATH={{ parameter_dict['sqlbench_path'] }}
TEST_CA_PATH=${directory:ca-dir} TEST_CA_PATH=${directory:ca-dir}
ERP5_TEST_RUNNER_CONFIGURATION=${test-runner-configuration:output} ERP5_TEST_RUNNER_CONFIGURATION=${test-runner-configuration:output}
{%- if wsgi %}
erp5_wsgi=1
{%- endif %}
instance-home = ${directory:unit-test-path} instance-home = ${directory:unit-test-path}
wrapper-path = ${directory:bin}/${:command-name}.real wrapper-path = ${directory:bin}/${:command-name}.real
command-line = command-line =
......
...@@ -15,12 +15,9 @@ instancehome $INSTANCE ...@@ -15,12 +15,9 @@ instancehome $INSTANCE
# revoked when their account is terminated. # revoked when their account is terminated.
skip-ownership-checking true skip-ownership-checking true
lock-filename {{ parameter_dict['lock-file'] }}
pid-filename {{ parameter_dict['pid-file'] }} pid-filename {{ parameter_dict['pid-file'] }}
default-zpublisher-encoding utf-8 default-zpublisher-encoding utf-8
rest-input-encoding utf-8
rest-output-encoding utf-8
# Magic parameter to use the first entry of X-Forwarded-For as the source IP address. # Magic parameter to use the first entry of X-Forwarded-For as the source IP address.
# (see monkey patches in ERP5Type/patches/HTTPRequest.py and ERP5Type/patches/http_server.py) # (see monkey patches in ERP5Type/patches/HTTPRequest.py and ERP5Type/patches/http_server.py)
...@@ -29,23 +26,6 @@ rest-output-encoding utf-8 ...@@ -29,23 +26,6 @@ rest-output-encoding utf-8
# * Backend proxy drops incoming X-Forwarded-For without valid SSL Client Authentification. # * Backend proxy drops incoming X-Forwarded-For without valid SSL Client Authentification.
trusted-proxy 0.0.0.0 trusted-proxy 0.0.0.0
{% if not parameter_dict['wsgi'] -%}
{% if parameter_dict['webdav'] -%}
<webdav-source-server>
address {{ parameter_dict['ip'] }}:{{ parameter_dict['port'] }}
force-connection-close off
</webdav-source-server>
{% else %}
<http-server>
address {{ parameter_dict['ip'] }}:{{ parameter_dict['port'] }}
</http-server>
{% endif %}
{%- endif %}
<zoperunner>
program $INSTANCE/bin/runzope
</zoperunner>
<product-config DeadlockDebugger> <product-config DeadlockDebugger>
dump_url {{ parameter_dict['deadlock-path'] }} dump_url {{ parameter_dict['deadlock-path'] }}
secret {{ parameter_dict['deadlock-debugger-password'] }} secret {{ parameter_dict['deadlock-debugger-password'] }}
...@@ -76,16 +56,7 @@ trusted-proxy 0.0.0.0 ...@@ -76,16 +56,7 @@ trusted-proxy 0.0.0.0
node-id {{ node_id }} node-id {{ node_id }}
</product-config> </product-config>
{% if not parameter_dict['wsgi'] -%}
{% set timerserver_interval = parameter_dict['timerserver-interval'] -%}
{% if timerserver_interval -%}
%import Products.TimerService.timerserver
<timer-server>
interval {{ timerserver_interval }}
</timer-server>
{% endif %}
{% endif -%}
{% set sql_connection_string = parameter_dict.get('sql-connection-string') -%} {% set sql_connection_string = parameter_dict.get('sql-connection-string') -%}
{% if sql_connection_string -%} {% if sql_connection_string -%}
{% set bt5_repository_url = [] -%} {% set bt5_repository_url = [] -%}
...@@ -110,22 +81,6 @@ trusted-proxy 0.0.0.0 ...@@ -110,22 +81,6 @@ trusted-proxy 0.0.0.0
</product-config> </product-config>
{% endif -%} {% endif -%}
<eventlog>
level info
<logfile>
dateformat
path {{ parameter_dict['event-log'] }}
</logfile>
</eventlog>
<logger access>
level WARN
<logfile>
dateformat
format %(message)s
path {{ parameter_dict['z2-log'] }}
</logfile>
</logger>
<zodb_db temporary> <zodb_db temporary>
<temporarystorage> <temporarystorage>
......
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