Commit 02434a7c authored by Arnaud Fontaine's avatar Arnaud Fontaine

Merge remote-tracking branch 'origin/master' into zope4py2

parents 9610ec5f 233c0dc1
...@@ -10,7 +10,7 @@ parts = ...@@ -10,7 +10,7 @@ parts =
<= go-git-package <= go-git-package
go.importpath = github.com/caddyserver/caddy go.importpath = github.com/caddyserver/caddy
repository = https://lab.nexedi.com/nexedi/caddy.git repository = https://lab.nexedi.com/nexedi/caddy.git
revision = nxd-v1.0.3-1-g2c11cedc revision = nxd-v1.0.3-1-03fba31bf
[gowork] [gowork]
golang = ${golang1.17:location} golang = ${golang1.17:location}
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
extends = extends =
../coreutils/buildout.cfg ../coreutils/buildout.cfg
../patch/buildout.cfg ../patch/buildout.cfg
../randomsleep/buildout.cfg
parts = dcron-output parts = dcron-output
...@@ -20,7 +19,6 @@ make-options = ...@@ -20,7 +19,6 @@ make-options =
PREFIX=${buildout:parts-directory}/${:_buildout_section_name_} PREFIX=${buildout:parts-directory}/${:_buildout_section_name_}
post-install = post-install =
chmod u-s %(location)s/bin/crontab chmod u-s %(location)s/bin/crontab
dummy = ${randomsleep:recipe}
[dcron-output] [dcron-output]
# Shared binary location to ease migration # Shared binary location to ease migration
......
...@@ -4,10 +4,10 @@ extends = ...@@ -4,10 +4,10 @@ extends =
../bash/buildout.cfg ../bash/buildout.cfg
[randomsleep] [randomsleep]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template
rendered = ${buildout:bin-directory}/${:_buildout_section_name_} output = ${buildout:bin-directory}/${:_buildout_section_name_}
template = inline =
inline:#!${bash:location}/bin/bash #!${bash:location}/bin/bash
[ $# = 1 ] || { [ $# = 1 ] || {
echo "usage: ${:_buildout_section_name_} maxseconds" echo "usage: ${:_buildout_section_name_} maxseconds"
exit 1 exit 1
......
...@@ -62,7 +62,7 @@ md5sum = 975177dedf677d24e14cede5d13187ce ...@@ -62,7 +62,7 @@ md5sum = 975177dedf677d24e14cede5d13187ce
[template-trafficserver-records-config] [template-trafficserver-records-config]
_update_hash_filename_ = templates/trafficserver/records.config.jinja2 _update_hash_filename_ = templates/trafficserver/records.config.jinja2
md5sum = 88a2db868720009f6092843784b06611 md5sum = e87238c53d080ef9ef90040e57bc1395
[template-trafficserver-storage-config] [template-trafficserver-storage-config]
_update_hash_filename_ = templates/trafficserver/storage.config.jinja2 _update_hash_filename_ = templates/trafficserver/storage.config.jinja2
......
...@@ -16,6 +16,8 @@ CONFIG proxy.config.output.logfile STRING traffic.out ...@@ -16,6 +16,8 @@ CONFIG proxy.config.output.logfile STRING traffic.out
CONFIG proxy.config.admin.user_id STRING {{ '#%s' % os_module.geteuid() }} CONFIG proxy.config.admin.user_id STRING {{ '#%s' % os_module.geteuid() }}
LOCAL proxy.local.incoming_ip_to_bind STRING {{ ats_configuration['local-ip'] }} LOCAL proxy.local.incoming_ip_to_bind STRING {{ ats_configuration['local-ip'] }}
CONFIG proxy.config.log.logfile_dir STRING {{ ats_directory['log'] }} CONFIG proxy.config.log.logfile_dir STRING {{ ats_directory['log'] }}
# Never change Server header
CONFIG proxy.config.http.response_server_enabled INT 0
# Implement RFC 5861 with core # Implement RFC 5861 with core
CONFIG proxy.config.http.cache.open_write_fail_action INT 2 CONFIG proxy.config.http.cache.open_write_fail_action INT 2
CONFIG proxy.config.body_factory.template_sets_dir STRING {{ ats_configuration['templates-dir'] }} CONFIG proxy.config.body_factory.template_sets_dir STRING {{ ats_configuration['templates-dir'] }}
......
...@@ -485,6 +485,9 @@ def fakeHTTPResult(domain, path, port=HTTP_PORT, ...@@ -485,6 +485,9 @@ def fakeHTTPResult(domain, path, port=HTTP_PORT,
class TestHandler(BaseHTTPRequestHandler): class TestHandler(BaseHTTPRequestHandler):
identification = None identification = None
configuration = {} configuration = {}
# override Server header response
server_version = "TestBackend"
sys_version = ""
def log_message(self, *args): def log_message(self, *args):
if os.environ.get('SLAPOS_TEST_DEBUG'): if os.environ.get('SLAPOS_TEST_DEBUG'):
...@@ -843,6 +846,19 @@ class HttpFrontendTestCase(SlapOSInstanceTestCase): ...@@ -843,6 +846,19 @@ class HttpFrontendTestCase(SlapOSInstanceTestCase):
except Exception as e: except Exception as e:
self.fail(e) self.fail(e)
def assertResponseHeaders(self, result):
headers = result.headers.copy()
self.assertKeyWithPop('Date', headers)
# drop vary-keys
headers.pop('Connection', None)
headers.pop('Content-Length', None)
headers.pop('Keep-Alive', None)
headers.pop('Transfer-Encoding', None)
self.assertEqual('TestBackend', headers.pop('Server', ''))
return headers
def assertLogAccessUrlWithPop(self, parameter_dict): def assertLogAccessUrlWithPop(self, parameter_dict):
log_access_url = parameter_dict.pop('log-access-url') log_access_url = parameter_dict.pop('log-access-url')
...@@ -3612,18 +3628,9 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3612,18 +3628,9 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(result, 'Path', '/test-path/deeper') self.assertEqualResultJson(result, 'Path', '/test-path/deeper')
headers = result.headers.copy() headers = self.assertResponseHeaders(result)
self.assertKeyWithPop('Server', headers)
self.assertKeyWithPop('Date', headers)
self.assertKeyWithPop('Age', headers) self.assertKeyWithPop('Age', headers)
# drop keys appearing randomly in headers
headers.pop('Transfer-Encoding', None)
headers.pop('Content-Length', None)
headers.pop('Connection', None)
headers.pop('Keep-Alive', None)
self.assertEqual( self.assertEqual(
{ {
'Content-type': 'application/json', 'Content-type': 'application/json',
...@@ -3654,18 +3661,9 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3654,18 +3661,9 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(result, 'Path', '/test-path/deeper') self.assertEqualResultJson(result, 'Path', '/test-path/deeper')
headers = result.headers.copy() headers = self.assertResponseHeaders(result)
self.assertKeyWithPop('Server', headers)
self.assertKeyWithPop('Date', headers)
self.assertKeyWithPop('Age', headers) self.assertKeyWithPop('Age', headers)
# drop keys appearing randomly in headers
headers.pop('Transfer-Encoding', None)
headers.pop('Content-Length', None)
headers.pop('Connection', None)
headers.pop('Keep-Alive', None)
self.assertEqual( self.assertEqual(
{ {
'Content-type': 'application/json', 'Content-type': 'application/json',
...@@ -3712,18 +3710,8 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3712,18 +3710,8 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(result, 'Path', '/test-path/deeper') self.assertEqualResultJson(result, 'Path', '/test-path/deeper')
headers = result.headers.copy() headers = self.assertResponseHeaders(result)
self.assertKeyWithPop('Server', headers)
self.assertKeyWithPop('Date', headers)
self.assertKeyWithPop('Age', headers) self.assertKeyWithPop('Age', headers)
# drop keys appearing randomly in headers
headers.pop('Transfer-Encoding', None)
headers.pop('Content-Length', None)
headers.pop('Connection', None)
headers.pop('Keep-Alive', None)
self.assertEqual( self.assertEqual(
{ {
'Content-type': 'application/json', 'Content-type': 'application/json',
...@@ -3743,7 +3731,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3743,7 +3731,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqual(httplib.OK, result.status_code) self.assertEqual(httplib.OK, result.status_code)
self.assertEqualResultJson(result, 'Path', '/HTTPS/test') self.assertEqualResultJson(result, 'Path', '/HTTPS/test')
headers = result.headers.copy() self.assertResponseHeaders(result)
result = fakeHTTPSResult( result = fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['domain'],
...@@ -3753,8 +3741,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3753,8 +3741,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqual(httplib.OK, result.status_code) self.assertEqual(httplib.OK, result.status_code)
self.assertEqualResultJson(result, 'Path', '/HTTP/test') self.assertEqualResultJson(result, 'Path', '/HTTP/test')
self.assertResponseHeaders(result)
headers = result.headers.copy()
def test_enable_cache(self): def test_enable_cache(self):
parameter_dict = self.assertSlaveBase('enable_cache') parameter_dict = self.assertSlaveBase('enable_cache')
...@@ -3771,18 +3758,10 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3771,18 +3758,10 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(result, 'Path', '/test-path/deeper') self.assertEqualResultJson(result, 'Path', '/test-path/deeper')
headers = result.headers.copy() headers = self.assertResponseHeaders(result)
self.assertKeyWithPop('Server', headers)
self.assertKeyWithPop('Date', headers)
self.assertKeyWithPop('Age', headers) self.assertKeyWithPop('Age', headers)
# drop keys appearing randomly in headers
headers.pop('Transfer-Encoding', None)
headers.pop('Content-Length', None)
headers.pop('Connection', None)
headers.pop('Keep-Alive', None)
self.assertEqual( self.assertEqual(
{ {
'Content-type': 'application/json', 'Content-type': 'application/json',
...@@ -3973,18 +3952,10 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -3973,18 +3952,10 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(result, 'Path', '/test-path/deeper') self.assertEqualResultJson(result, 'Path', '/test-path/deeper')
headers = result.headers.copy() headers = self.assertResponseHeaders(result)
self.assertKeyWithPop('Server', headers)
self.assertKeyWithPop('Date', headers)
self.assertKeyWithPop('Age', headers) self.assertKeyWithPop('Age', headers)
# drop keys appearing randomly in headers
headers.pop('Transfer-Encoding', None)
headers.pop('Content-Length', None)
headers.pop('Connection', None)
headers.pop('Keep-Alive', None)
self.assertEqual( self.assertEqual(
{ {
'Content-type': 'application/json', 'Content-type': 'application/json',
...@@ -4118,18 +4089,10 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4118,18 +4089,10 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(result, 'Path', '/test-path') self.assertEqualResultJson(result, 'Path', '/test-path')
headers = result.headers.copy() headers = self.assertResponseHeaders(result)
self.assertKeyWithPop('Server', headers)
self.assertKeyWithPop('Date', headers)
self.assertKeyWithPop('Age', headers) self.assertKeyWithPop('Age', headers)
# drop keys appearing randomly in headers
headers.pop('Transfer-Encoding', None)
headers.pop('Content-Length', None)
headers.pop('Connection', None)
headers.pop('Keep-Alive', None)
self.assertEqual( self.assertEqual(
{ {
'Content-type': 'application/json', 'Content-type': 'application/json',
...@@ -4165,18 +4128,10 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4165,18 +4128,10 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(result, 'Path', '/test-path') self.assertEqualResultJson(result, 'Path', '/test-path')
headers = result.headers.copy() headers = self.assertResponseHeaders(result)
self.assertKeyWithPop('Server', headers)
self.assertKeyWithPop('Date', headers)
self.assertKeyWithPop('Age', headers) self.assertKeyWithPop('Age', headers)
# drop keys appearing randomly in headers
headers.pop('Transfer-Encoding', None)
headers.pop('Content-Length', None)
headers.pop('Connection', None)
headers.pop('Keep-Alive', None)
self.assertEqual( self.assertEqual(
{ {
'Content-type': 'application/json', 'Content-type': 'application/json',
...@@ -4206,16 +4161,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4206,16 +4161,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(result, 'Path', '/test-path') self.assertEqualResultJson(result, 'Path', '/test-path')
headers = result.headers.copy() headers = self.assertResponseHeaders(result)
self.assertKeyWithPop('Server', headers)
self.assertKeyWithPop('Date', headers)
# drop vary-keys
headers.pop('Content-Length', None)
headers.pop('Transfer-Encoding', None)
headers.pop('Connection', None)
headers.pop('Keep-Alive', None)
self.assertEqual( self.assertEqual(
{ {
...@@ -4240,17 +4186,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4240,17 +4186,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(result, 'Path', '/test-path') self.assertEqualResultJson(result, 'Path', '/test-path')
headers = result.headers.copy() headers = self.assertResponseHeaders(result)
self.assertKeyWithPop('Server', headers)
self.assertKeyWithPop('Date', headers)
# drop vary-keys
headers.pop('Content-Length', None)
headers.pop('Transfer-Encoding', None)
headers.pop('Connection', None)
headers.pop('Keep-Alive', None)
self.assertEqual( self.assertEqual(
{ {
'Content-type': 'application/json', 'Content-type': 'application/json',
...@@ -5017,17 +4953,7 @@ class TestSlaveGlobalDisableHttp2(TestSlave): ...@@ -5017,17 +4953,7 @@ class TestSlaveGlobalDisableHttp2(TestSlave):
self.assertEqualResultJson(result, 'Path', '/test-path') self.assertEqualResultJson(result, 'Path', '/test-path')
headers = result.headers.copy() headers = self.assertResponseHeaders(result)
self.assertKeyWithPop('Server', headers)
self.assertKeyWithPop('Date', headers)
# drop vary-keys
headers.pop('Content-Length', None)
headers.pop('Transfer-Encoding', None)
headers.pop('Connection', None)
headers.pop('Keep-Alive', None)
self.assertEqual( self.assertEqual(
{ {
'Content-type': 'application/json', 'Content-type': 'application/json',
......
...@@ -20,23 +20,23 @@ md5sum = 6ea4fa210a91c15278c847a809de5991 ...@@ -20,23 +20,23 @@ md5sum = 6ea4fa210a91c15278c847a809de5991
[template-lte-enb-epc] [template-lte-enb-epc]
_update_hash_filename_ = instance-enb-epc.jinja2.cfg _update_hash_filename_ = instance-enb-epc.jinja2.cfg
md5sum = cf6c400d9fa5b0942f9be7145f77b8de md5sum = 1358f8e0a4cecefe4cdf389b69067f34
[template-lte-enb] [template-lte-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg _update_hash_filename_ = instance-enb.jinja2.cfg
md5sum = fe249168a3f50b0efe6aeae39afb03ae md5sum = e4c224da723ad56091f27ed5c0b0bbca
[template-lte-gnb-epc] [template-lte-gnb-epc]
_update_hash_filename_ = instance-gnb-epc.jinja2.cfg _update_hash_filename_ = instance-gnb-epc.jinja2.cfg
md5sum = f94c3e2f714629d9e1fc9b2f7c8eb586 md5sum = b9a58fa4037d32fc1dc4f5ef89e6211a
[template-lte-gnb] [template-lte-gnb]
_update_hash_filename_ = instance-gnb.jinja2.cfg _update_hash_filename_ = instance-gnb.jinja2.cfg
md5sum = 6deb38b3de44f6e0a43b49fd13f0f072 md5sum = 0b74993990a0dfa3c6429dc4ac716826
[template-lte-epc] [template-lte-epc]
_update_hash_filename_ = instance-epc.jinja2.cfg _update_hash_filename_ = instance-epc.jinja2.cfg
md5sum = 089f62e736cdc620eafc2c47b050fe13 md5sum = 35556ebd82be804584482a7fe5eff0be
[ue_db.jinja2.cfg] [ue_db.jinja2.cfg]
filename = config/ue_db.jinja2.cfg filename = config/ue_db.jinja2.cfg
......
...@@ -52,6 +52,12 @@ return = monitor-base-url ...@@ -52,6 +52,12 @@ return = monitor-base-url
name = EPC name = EPC
software-type = epc software-type = epc
config-name = epc config-name = epc
{% if slapparameter_dict.get("mme_config_link", None) %}
config-mme_config_link = {{ dumps(slapparameter_dict["mme_config_link"]) }}
{% endif %}
{% if slapparameter_dict.get("mme_config_version", None) %}
config-mme_config_version = {{ dumps(slapparameter_dict["mme_config_version"]) }}
{% endif %}
[lte-enb-request] [lte-enb-request]
<= request-common-base <= request-common-base
...@@ -76,6 +82,12 @@ config-mme_addr = {{ dumps(slapparameter_dict["mme_addr"]) }} ...@@ -76,6 +82,12 @@ config-mme_addr = {{ dumps(slapparameter_dict["mme_addr"]) }}
{% if slapparameter_dict.get("enb_id", None) %} {% if slapparameter_dict.get("enb_id", None) %}
config-enb_id = {{ dumps(slapparameter_dict["enb_id"]) }} config-enb_id = {{ dumps(slapparameter_dict["enb_id"]) }}
{% endif %} {% endif %}
{% if slapparameter_dict.get("enb_config_link", None) %}
config-enb_config_link = {{ dumps(slapparameter_dict["enb_config_link"]) }}
{% endif %}
{% if slapparameter_dict.get("enb_config_version", None) %}
config-enb_config_version = {{ dumps(slapparameter_dict["enb_config_version"]) }}
{% endif %}
[monitor-base-url-dict] [monitor-base-url-dict]
lte-epc-request = ${lte-epc-request:connection-monitor-base-url} lte-epc-request = ${lte-epc-request:connection-monitor-base-url}
......
...@@ -60,6 +60,14 @@ extensions = jinja2.ext.do ...@@ -60,6 +60,14 @@ extensions = jinja2.ext.do
context = context =
section directory directory section directory directory
{% if slapparameter_dict.get("enb_config_link", None) %}
[enb-config-dl]
recipe = slapos.recipe.build:download
url = {{ slapparameter_dict.get("enb_config_link") }}
version = {{ slapparameter_dict.get("enb_config_version") }}
offline = false
{% endif %}
[lte-enb-sh-wrapper] [lte-enb-sh-wrapper]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
rendered = ${directory:bin}/${:_buildout_section_name_} rendered = ${directory:bin}/${:_buildout_section_name_}
...@@ -98,7 +106,11 @@ context = ...@@ -98,7 +106,11 @@ context =
[lte-enb-config] [lte-enb-config]
<= config-base <= config-base
{% if slapparameter_dict.get("enb_config_link", None) %}
template = ${enb-config-dl:target}
{% else %}
template = {{ enb_template }} template = {{ enb_template }}
{% endif %}
rendered = ${directory:etc}/enb.cfg rendered = ${directory:etc}/enb.cfg
[publish-connection-information] [publish-connection-information]
......
...@@ -58,6 +58,14 @@ extensions = jinja2.ext.do ...@@ -58,6 +58,14 @@ extensions = jinja2.ext.do
context = context =
section directory directory section directory directory
{% if slapparameter_dict.get("mme_config_link", None) %}
[mme-config-dl]
recipe = slapos.recipe.build:download
url = {{ slapparameter_dict.get("mme_config_link") }}
version = {{ slapparameter_dict.get("mme_config_version") }}
offline = false
{% endif %}
### IMS ### IMS
[lte-ims-service] [lte-ims-service]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
...@@ -122,7 +130,11 @@ rendered = ${directory:etc}/ims.cfg ...@@ -122,7 +130,11 @@ rendered = ${directory:etc}/ims.cfg
[lte-mme-config] [lte-mme-config]
<= config-base <= config-base
{% if slapparameter_dict.get("mme_config_link", None) %}
template = ${mme-config-dl:target}
{% else %}
template = {{ mme_template }} template = {{ mme_template }}
{% endif %}
rendered = ${directory:etc}/mme.cfg rendered = ${directory:etc}/mme.cfg
context = context =
section directory directory section directory directory
......
...@@ -52,6 +52,12 @@ return = monitor-base-url ...@@ -52,6 +52,12 @@ return = monitor-base-url
name = EPC name = EPC
software-type = epc software-type = epc
config-name = epc config-name = epc
{% if slapparameter_dict.get("mme_config_link", None) %}
config-mme_config_link = {{ dumps(slapparameter_dict["mme_config_link"]) }}
{% endif %}
{% if slapparameter_dict.get("mme_config_version", None) %}
config-mme_config_version = {{ dumps(slapparameter_dict["mme_config_version"]) }}
{% endif %}
[lte-gnb-request] [lte-gnb-request]
<= request-common-base <= request-common-base
...@@ -79,6 +85,12 @@ config-mme_addr = {{ dumps(slapparameter_dict["mme_addr"]) }} ...@@ -79,6 +85,12 @@ config-mme_addr = {{ dumps(slapparameter_dict["mme_addr"]) }}
{% if slapparameter_dict.get("enb_id", None) %} {% if slapparameter_dict.get("enb_id", None) %}
config-enb_id = {{ dumps(slapparameter_dict["enb_id"]) }} config-enb_id = {{ dumps(slapparameter_dict["enb_id"]) }}
{% endif %} {% endif %}
{% if slapparameter_dict.get("gnb_config_link", None) %}
config-gnb_config_link = {{ dumps(slapparameter_dict["gnb_config_link"]) }}
{% endif %}
{% if slapparameter_dict.get("gnb_config_version", None) %}
config-gnb_config_version = {{ dumps(slapparameter_dict["gnb_config_version"]) }}
{% endif %}
[monitor-base-url-dict] [monitor-base-url-dict]
lte-epc-request = ${lte-epc-request:connection-monitor-base-url} lte-epc-request = ${lte-epc-request:connection-monitor-base-url}
......
...@@ -60,6 +60,14 @@ extensions = jinja2.ext.do ...@@ -60,6 +60,14 @@ extensions = jinja2.ext.do
context = context =
section directory directory section directory directory
{% if slapparameter_dict.get("gnb_config_link", None) %}
[gnb-config-dl]
recipe = slapos.recipe.build:download
url = {{ slapparameter_dict.get("gnb_config_link") }}
version = {{ slapparameter_dict.get("gnb_config_version") }}
offline = false
{% endif %}
[lte-enb-sh-wrapper] [lte-enb-sh-wrapper]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
rendered = ${directory:bin}/${:_buildout_section_name_} rendered = ${directory:bin}/${:_buildout_section_name_}
...@@ -98,7 +106,11 @@ context = ...@@ -98,7 +106,11 @@ context =
[lte-gnb-config] [lte-gnb-config]
<= config-base <= config-base
{% if slapparameter_dict.get("gnb_config_link", None) %}
template = ${gnb-config-dl:target}
{% else %}
template = {{ gnb_template }} template = {{ gnb_template }}
{% endif %}
rendered = ${directory:etc}/gnb.cfg rendered = ${directory:etc}/gnb.cfg
[publish-connection-information] [publish-connection-information]
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# not need these here). # not need these here).
[instance.cfg] [instance.cfg]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = af2fc4a7a0f782fed2cb1112ef3cb397 md5sum = 1c9c4c254f371337fe08b7922901f8a9
[instance-repman.cfg] [instance-repman.cfg]
_update_hash_filename_ = instance-repman.cfg.jinja2.in _update_hash_filename_ = instance-repman.cfg.jinja2.in
...@@ -34,7 +34,7 @@ md5sum = 0eeb24c6aa0760f0d33c4cc2828ddf30 ...@@ -34,7 +34,7 @@ md5sum = 0eeb24c6aa0760f0d33c4cc2828ddf30
[template-mariadb.cfg] [template-mariadb.cfg]
_update_hash_filename_ = instance-mariadb.cfg.jinja2.in _update_hash_filename_ = instance-mariadb.cfg.jinja2.in
md5sum = 938f1e8087395757f5ae861d20500658 md5sum = aa25693b324ce5acc00f29b96a2516c0
[template-my-cnf] [template-my-cnf]
_update_hash_filename_ = templates/my.cnf.in _update_hash_filename_ = templates/my.cnf.in
......
...@@ -214,16 +214,10 @@ wait-for-files = ...@@ -214,16 +214,10 @@ wait-for-files =
{{ supervisord_lib.supervisord_program("mariadb", maradb_program_dict) }} {{ supervisord_lib.supervisord_program("mariadb", maradb_program_dict) }}
{% do part_list.append("supervisord-mariadb") %} {% do part_list.append("supervisord-mariadb") %}
[odbc-ini-text]
text = {{ dumps(base64.b64encode( slapparameter_dict.get('odbc-ini', '').encode() )) }}
[{{ section('odbc-ini') }}] [{{ section('odbc-ini') }}]
< = jinja2-template-base recipe = slapos.recipe.template
rendered = ${directory:etc}/odbc.ini output = ${directory:etc}/odbc.ini
template = inline:{% raw -%} inline = {{ dumps(slapparameter_dict.get('odbc-ini', '')) }}
{{ parameter_dict['text'].decode('base64') }}
{%- endraw %}
context = section parameter_dict odbc-ini-text
[{{ section('logrotate-entry-mariadb') }}] [{{ section('logrotate-entry-mariadb') }}]
< = logrotate-entry-base < = logrotate-entry-base
......
...@@ -108,4 +108,3 @@ template = {{ template_mariadb }} ...@@ -108,4 +108,3 @@ template = {{ template_mariadb }}
filename = instance-mariadb.cfg filename = instance-mariadb.cfg
extra-context = extra-context =
section parameter_dict template-mariadb-parameters section parameter_dict template-mariadb-parameters
import base64 base64
...@@ -26,7 +26,7 @@ md5sum = d10b8e35b02b5391cf46bf0c7dbb1196 ...@@ -26,7 +26,7 @@ md5sum = d10b8e35b02b5391cf46bf0c7dbb1196
[template-mariadb] [template-mariadb]
filename = instance-mariadb.cfg.in filename = instance-mariadb.cfg.in
md5sum = 4a1e279e3757c964caaa27137fecb66f md5sum = 2daa3aaa1263705c4628864230049c67
[template-kumofs] [template-kumofs]
filename = instance-kumofs.cfg.in filename = instance-kumofs.cfg.in
...@@ -34,7 +34,7 @@ md5sum = cfe4696a67bf4886a5d8252a5274a941 ...@@ -34,7 +34,7 @@ md5sum = cfe4696a67bf4886a5d8252a5274a941
[template-zope-conf] [template-zope-conf]
filename = zope.conf.in filename = zope.conf.in
md5sum = fb02a30a9af9ef9a4724048c548b6542 md5sum = 153fe68aa92452c3e2076d2ed26ff524
[site-zcml] [site-zcml]
filename = site.zcml filename = site.zcml
...@@ -70,7 +70,7 @@ md5sum = 274365ebbade26558ca4836837e781aa ...@@ -70,7 +70,7 @@ md5sum = 274365ebbade26558ca4836837e781aa
[template] [template]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = ed280a76c22247cf2a05fac29b8a8b30 md5sum = 165b0a50672138ee4a3fbe9239af11ba
[template-erp5] [template-erp5]
filename = instance-erp5.cfg.in filename = instance-erp5.cfg.in
...@@ -90,11 +90,11 @@ md5sum = 06265195ca29805696873b6f8a57a5fd ...@@ -90,11 +90,11 @@ md5sum = 06265195ca29805696873b6f8a57a5fd
[template-balancer] [template-balancer]
filename = instance-balancer.cfg.in filename = instance-balancer.cfg.in
md5sum = e0567c8d7717d1ed5daf4555566c76cd md5sum = 8b4d6c29e9c5d8fb2e50e6ac96906d97
[template-haproxy-cfg] [template-haproxy-cfg]
filename = haproxy.cfg.in filename = haproxy.cfg.in
md5sum = 4149e3e83c9981586ffa123d31a08908 md5sum = d2d98ed3fafce764991b72371e3e09d5
[template-rsyslogd-cfg] [template-rsyslogd-cfg]
filename = rsyslogd.cfg.in filename = rsyslogd.cfg.in
......
...@@ -211,6 +211,6 @@ frontend frontend_{{ group_name }} ...@@ -211,6 +211,6 @@ frontend frontend_{{ group_name }}
backend backend_{{ group_name }}_{{ name }} backend backend_{{ group_name }}_{{ name }}
http-request replace-path ^/{{ name }}(.*) /VirtualHostBase/https/{{ ip }}:{{ port }}/VirtualHostRoot/_vh_{{ name }}\1 http-request replace-path ^/{{ name }}(.*) /VirtualHostBase/https/{{ ip }}:{{ port }}/VirtualHostRoot/_vh_{{ name }}\1
timeout server 8h timeout server 8h
server {{ name }} {{ urlparse.urlparse(url).netloc }} server {{ name }} {{ urllib_parse.urlparse(url).netloc }}
{%- endfor %} {%- endfor %}
{% endfor %} {% endfor %}
...@@ -205,7 +205,7 @@ template = {{ parameter_dict['template-haproxy-cfg'] }} ...@@ -205,7 +205,7 @@ template = {{ parameter_dict['template-haproxy-cfg'] }}
rendered = ${directory:etc}/haproxy.cfg rendered = ${directory:etc}/haproxy.cfg
context = context =
section parameter_dict haproxy-cfg-parameter-dict section parameter_dict haproxy-cfg-parameter-dict
import urlparse urlparse import urllib_parse six.moves.urllib.parse
extensions = jinja2.ext.do extensions = jinja2.ext.do
[haproxy-reload] [haproxy-reload]
......
...@@ -197,15 +197,9 @@ environ = ...@@ -197,15 +197,9 @@ environ =
[{{ section('odbc-ini') }}] [{{ section('odbc-ini') }}]
< = jinja2-template-base recipe = slapos.recipe.template
rendered = ${directory:etc}/odbc.ini output = ${directory:etc}/odbc.ini
template = inline:{% raw -%} inline = {{ dumps(slapparameter_dict.get('odbc-ini', '')) }}
{{ base64.b64decode(text).decode('utf-8') }}
{%- endraw %}
text = {{ dumps(base64.b64encode(slapparameter_dict.get('odbc-ini', '').encode('utf-8'))) }}
context =
key text :text
import base64 base64
[{{ section('logrotate-entry-mariadb') }}] [{{ section('logrotate-entry-mariadb') }}]
< = logrotate-entry-base < = logrotate-entry-base
......
...@@ -178,7 +178,6 @@ template = {{ template_mariadb }} ...@@ -178,7 +178,6 @@ template = {{ template_mariadb }}
filename = instance-mariadb.cfg filename = instance-mariadb.cfg
extra-context = extra-context =
section parameter_dict dynamic-template-mariadb-parameters section parameter_dict dynamic-template-mariadb-parameters
import base64 base64
# Keep a section for backward compatibility for removed types # Keep a section for backward compatibility for removed types
# Once the section is removed, ghost instances will keep failing until # Once the section is removed, ghost instances will keep failing until
......
...@@ -130,17 +130,17 @@ trusted-proxy 0.0.0.0 ...@@ -130,17 +130,17 @@ trusted-proxy 0.0.0.0
%import {{ m }} %import {{ m }}
{% endfor -%} {% endfor -%}
{% set type_dict = {'neo': 'NEOStorage', 'zeo': 'zeoclient'} %} {% set type_dict = {'neo': 'NEOStorage', 'zeo': 'zeoclient'} %}
{% for name, zodb_dict in parameter_dict['zodb-dict'].iteritems() %} {% for name, zodb_dict in six.iteritems(parameter_dict['zodb-dict']) %}
<zodb_db {{ name }}> <zodb_db {{ name }}>
{%- set storage_type = type_dict[zodb_dict.pop('type')] %} {%- set storage_type = type_dict[zodb_dict.pop('type')] %}
{%- set storage_dict = zodb_dict.pop('storage-dict') %} {%- set storage_dict = zodb_dict.pop('storage-dict') %}
{%- do root_common.apply_overrides(zodb_dict, node_id) %} {%- do root_common.apply_overrides(zodb_dict, node_id) %}
{%- for key, value in zodb_dict.iteritems() %} {%- for key, value in six.iteritems(zodb_dict) %}
{{ key }} {{ value }} {{ key }} {{ value }}
{%- endfor %} {%- endfor %}
<{{ storage_type }}> <{{ storage_type }}>
{%- do root_common.apply_overrides(storage_dict, node_id) %} {%- do root_common.apply_overrides(storage_dict, node_id) %}
{%- for key, value in storage_dict.iteritems() %} {%- for key, value in six.iteritems(storage_dict) %}
{{ key }} {{ value }} {{ key }} {{ value }}
{%- endfor %} {%- endfor %}
</{{ storage_type }}> </{{ storage_type }}>
......
...@@ -8,6 +8,7 @@ extends = ...@@ -8,6 +8,7 @@ extends =
../../component/openssl/buildout.cfg ../../component/openssl/buildout.cfg
../../component/lxml-python/buildout.cfg ../../component/lxml-python/buildout.cfg
../../component/python-cryptography/buildout.cfg ../../component/python-cryptography/buildout.cfg
../../component/randomsleep/buildout.cfg
../../stack/logrotate/buildout.cfg ../../stack/logrotate/buildout.cfg
../../stack/slapos.cfg ../../stack/slapos.cfg
...@@ -65,6 +66,7 @@ rendered = ${buildout:directory}/template-monitor.cfg ...@@ -65,6 +66,7 @@ rendered = ${buildout:directory}/template-monitor.cfg
context = context =
key apache_location apache:location key apache_location apache:location
key template_logrotate_base template-logrotate-base:rendered key template_logrotate_base template-logrotate-base:rendered
key randomsleep randomsleep:output
raw monitor_bin ${buildout:bin-directory}/monitor.bootstrap raw monitor_bin ${buildout:bin-directory}/monitor.bootstrap
raw monitor_collect ${buildout:bin-directory}/monitor.collect raw monitor_collect ${buildout:bin-directory}/monitor.collect
raw monitor_statistic ${buildout:bin-directory}/monitor.statistic raw monitor_statistic ${buildout:bin-directory}/monitor.statistic
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# not need these here). # not need these here).
[monitor2-template] [monitor2-template]
filename = instance-monitor.cfg.jinja2.in filename = instance-monitor.cfg.jinja2.in
md5sum = 3cba541a8b0b22c2648848ed1d259174 md5sum = fb10eabe010d136764365c7df2993814
[monitor-httpd-conf] [monitor-httpd-conf]
_update_hash_filename_ = templates/monitor-httpd.conf.in _update_hash_filename_ = templates/monitor-httpd.conf.in
......
...@@ -250,7 +250,7 @@ recipe = slapos.cookbook:cron.d ...@@ -250,7 +250,7 @@ recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries} cron-entries = ${cron:cron-entries}
name = monitor-globalstate name = monitor-globalstate
frequency = */2 * * * * frequency = */2 * * * *
command = {{ bin_directory }}/randomsleep 20 && ${monitor-globalstate-wrapper:wrapper-path} command = {{ randomsleep }} 20 && ${monitor-globalstate-wrapper:wrapper-path}
[monitor-globalstate-first-run] [monitor-globalstate-first-run]
recipe = plone.recipe.command recipe = plone.recipe.command
...@@ -262,14 +262,14 @@ recipe = slapos.cookbook:cron.d ...@@ -262,14 +262,14 @@ recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries} cron-entries = ${cron:cron-entries}
name = monitor-configurator name = monitor-configurator
frequency = * * * * * frequency = * * * * *
command = {{ bin_directory }}/randomsleep 10 && ${monitor-configurator-wrapper:wrapper-path} command = {{ randomsleep }} 10 && ${monitor-configurator-wrapper:wrapper-path}
[monitor-collect-cron-entry] [monitor-collect-cron-entry]
recipe = slapos.cookbook:cron.d recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries} cron-entries = ${cron:cron-entries}
name = monitor_collect name = monitor_collect
frequency = * * * * * frequency = * * * * *
command = {{ bin_directory }}/randomsleep 40 && ${monitor-collect-wrapper:wrapper-path} command = {{ randomsleep }} 40 && ${monitor-collect-wrapper:wrapper-path}
[logrotate-entry-monitor-data] [logrotate-entry-monitor-data]
recipe = collective.recipe.template recipe = collective.recipe.template
......
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