diff --git a/component/egg-patch/Pillow/0001-set-metadata-in-setup.py-for-compatibility-with-old-.patch b/component/egg-patch/Pillow/0001-set-metadata-in-setup.py-for-compatibility-with-old-.patch deleted file mode 100644 index 87cd542a8f2f4d1fed5bcb5a445c66e22b8a1c62..0000000000000000000000000000000000000000 --- a/component/egg-patch/Pillow/0001-set-metadata-in-setup.py-for-compatibility-with-old-.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 77f86b50f097dcf364e0d140e45593bf001d46bc Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> -Date: Fri, 1 Mar 2024 09:49:17 +0900 -Subject: [PATCH] set metadata in setup.py for compatibility with old slapos - buildout - ---- - setup.py | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/setup.py b/setup.py -index 1bf0bcff5..a93fe7b22 100755 ---- a/setup.py -+++ b/setup.py -@@ -987,6 +987,11 @@ ext_modules = [ - - try: - setup( -+ name='pillow', -+ version='10.2.0', -+ packages=["PIL"], -+ include_package_data=True, -+ package_dir={"": "src"}, - cmdclass={"build_ext": pil_build_ext}, - ext_modules=ext_modules, - zip_safe=not (debug_build() or PLATFORM_MINGW), --- -2.42.0 - diff --git a/component/git/buildout.cfg b/component/git/buildout.cfg index 12febee7cdef0e2883cd1297b1fc4f1ae9596377..1e2c6fc678abf9e5a2514fd7946b95dd7639dec5 100644 --- a/component/git/buildout.cfg +++ b/component/git/buildout.cfg @@ -7,6 +7,7 @@ extends = ../gettext/buildout.cfg ../libexpat/buildout.cfg ../openssl/buildout.cfg + ../patch/buildout.cfg ../pcre/buildout.cfg ../perl/buildout.cfg ../tar/buildout.cfg @@ -33,6 +34,10 @@ environment = PATH=${curl:location}/bin:${gettext:location}/bin:${tar:location}/bin:${xz-utils:location}/bin:%(PATH)s CPPFLAGS=-I${zlib:location}/include LDFLAGS=-L${zlib:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${curl:location}/lib -Wl,-rpath=${libexpat:location}/lib +patch-options = -p1 +patch-binary = ${patch:location}/bin/patch +patches = + https://github.com/git/git/commit/ea3422662d21c33c349cc71e9cdbfe235e8f6905.patch?full_index=1#0f4d03d2dad5facbdd76a6ac1ef5b057 [gitweb] <= git diff --git a/component/pillow/buildout.cfg b/component/pillow/buildout.cfg index 211de809d7aeb3fe132f813e5cea8042086d4b31..7aa23e9893252cd2434ee57643cd9dfbf6a11d3d 100644 --- a/component/pillow/buildout.cfg +++ b/component/pillow/buildout.cfg @@ -34,8 +34,3 @@ rpath = ${libjpeg:location}/lib ${libtiff:location}/lib ${zlib:location}/lib -Pillow-patches = ${:_profile_base_location_}/../../component/egg-patch/Pillow/0001-set-metadata-in-setup.py-for-compatibility-with-old-.patch#0a06cc5a94d3db24688938731e4b15e2 -Pillow-patch-options = -p1 - -[pillow-python:python2] -Pillow-patches = diff --git a/software/neoppod/buildout.hash.cfg b/software/neoppod/buildout.hash.cfg index 8df2e3a11fcf5e15c7fa3b2a298bf9d263312d37..3d25280cbe30312090f576a36cd71efce8417fe6 100644 --- a/software/neoppod/buildout.hash.cfg +++ b/software/neoppod/buildout.hash.cfg @@ -18,7 +18,7 @@ md5sum = b4baf7f21f450fa522c2a69f5a4aedf7 [root-common] filename = root-common.cfg.in -md5sum = 102a7f1c1bc46a9b3fa5bd9b9a628e1d +md5sum = eefc3358852b7509bfe1b18da19abca0 [instance-neo-admin] filename = instance-neo-admin.cfg.in diff --git a/software/neoppod/root-common.cfg.in b/software/neoppod/root-common.cfg.in index 0b2ae2eb711e3b55b31aaa7b4f37aa7d6d9642bd..7d56f394e70bec4700059de0a493a231d89d6334 100644 --- a/software/neoppod/root-common.cfg.in +++ b/software/neoppod/root-common.cfg.in @@ -32,6 +32,7 @@ sla-computer_guid = ${slap-connection:computer-id} {% macro common_section() -%} [request-common-base] +<= monitor-parameters-propagation recipe = slapos.cookbook:request.serialised software-url = ${slap-connection:software-release-url} server-url = ${slap-connection:server-url} diff --git a/software/slapos-sr-testing/software.cfg b/software/slapos-sr-testing/software.cfg index 7a0655bbd24af3431f51fdf00e425d7d08c1da19..a0abcca0c4193e41211c1d2fbc438871b105b662 100644 --- a/software/slapos-sr-testing/software.cfg +++ b/software/slapos-sr-testing/software.cfg @@ -543,7 +543,7 @@ mysqlclient = 2.1.1 paho-mqtt = 1.5.0 pcpp = 1.30 persistent = 6.1 -Pillow = 10.2.0+SlapOSPatched001 +Pillow = 10.2.0 plantuml = 0.3.0:whl pypdf = 3.6.0:whl pysftp = 0.2.9 diff --git a/software/theia/buildout.hash.cfg b/software/theia/buildout.hash.cfg index 25f0583ed76dea368b33fe985b2abafd30b84fb4..c27dcb6ef15e3220b94e4d9cc390b370e7d3e7e1 100644 --- a/software/theia/buildout.hash.cfg +++ b/software/theia/buildout.hash.cfg @@ -19,7 +19,7 @@ md5sum = b4e87cff99a8521e6d0b911e3ef35b30 [instance] _update_hash_filename_ = instance.cfg.in -md5sum = 837eb2786f185ddb5a28d29e271652f7 +md5sum = 4f752dd5444a6f9e7c617ec7ccfe62d6 [instance-import] _update_hash_filename_ = instance-import.cfg.jinja.in @@ -31,7 +31,7 @@ md5sum = b982e83fa42103b7391d97eb36591174 [instance-resilient] _update_hash_filename_ = instance-resilient.cfg.jinja -md5sum = ad9499e7355ded4975ad313442cecb7a +md5sum = f0202548a2b5fa27d909faa701c6589b [slapos-standalone-script] _update_hash_filename_ = slapos_standalone_script.py.jinja diff --git a/software/theia/instance-resilient.cfg.jinja b/software/theia/instance-resilient.cfg.jinja index 8a10b2037eb9acc29ca13d3f55e73a81b7f9f0b4..375dc3318e60995c2fb6203ee0fd14ddc909f020 100644 --- a/software/theia/instance-resilient.cfg.jinja +++ b/software/theia/instance-resilient.cfg.jinja @@ -18,11 +18,12 @@ parts += {#- Prepare monitoring information to transmit to and request from the main theia, the clones and the PBS #} -{%- set monitor_cors_domains = slapparameter_dict.pop('monitor-cors-domains', 'monitor.app.officejs.com') %} +{%- set monitor_interface_url = slapparameter_dict.pop('monitor-interface-url', 'monitor.app.officejs.com/#page=ojsm_landing') %} +{%- set monitor_cors_domains = urllib_parse.urlparse(monitor_interface_url).hostname %} {%- set monitor_username = slapparameter_dict.get('monitor-username', '${monitor-instance-parameter:username}') %} {%- set monitor_password = slapparameter_dict.get('monitor-password', '${monitor-htpasswd:passwd}') %} {%- set monitor_return = ['monitor-base-url'] %} -{%- set monitor_parameter = {'monitor-cors-domains': monitor_cors_domains, 'monitor-username' : monitor_username, 'monitor-password': monitor_password} %} +{%- set monitor_parameter = {'monitor-cors-domains': monitor_cors_domains, 'monitor-interface-url': monitor_interface_url, 'monitor-username' : monitor_username, 'monitor-password': monitor_password} %} {%- set monitor_dict = {'parameter': monitor_parameter, 'return': monitor_return} %} diff --git a/software/theia/instance.cfg.in b/software/theia/instance.cfg.in index e1c047453b2ebc351ded2e94ece4954cd714b72c..b8aee5b0484af056af595678dedf0e9472a7d307 100644 --- a/software/theia/instance.cfg.in +++ b/software/theia/instance.cfg.in @@ -92,6 +92,7 @@ context = key eggs_directory buildout:eggs-directory key slapparameter_dict slap-configuration:configuration raw monitor_template ${monitor-template:output} + import urllib_parse six.moves.urllib.parse template-parts-destination = ${template-parts:target} template-replicated-destination = ${template-replicated:target} import-list = file parts :template-parts-destination diff --git a/software/theia/test/test.py b/software/theia/test/test.py index 3f9ce985014b256f21ee389ae0c82c62d9444014..1da4e2be1baf6ff33e912dbd6f199eb2ae297d87 100644 --- a/software/theia/test/test.py +++ b/software/theia/test/test.py @@ -626,6 +626,25 @@ class ResilientTheiaMixin(object): class TestTheiaResilientInterface(ResilientTheiaMixin, TestTheia): + def test_monitoring_default_interface(self): + monitor_setup_url_list = [ + u for u in [ + p.getConnectionParameterDict().get('monitor-setup-url') + for p in self.slap.computer.getComputerPartitionList() + ] if u is not None + ] + for url in monitor_setup_url_list: + self.assertIn('monitor.app.officejs.com', url) + + monitor_url_list = [ + u for u in [ + p.getConnectionParameterDict().get('monitor-base-url') + for p in self.slap.computer.getComputerPartitionList() + ] if u is not None + ] + for url in monitor_url_list: + self.assertNotEqual(url, '') + def test_all_monitor_url_use_same_password(self): monitor_setup_params = dict( parse_qsl( @@ -666,3 +685,45 @@ class TestTheiaResilientInterface(ResilientTheiaMixin, TestTheia): class TestTheiaResilientWithEmbeddedInstance(ResilientTheiaMixin, TestTheiaWithEmbeddedInstance): pass + +class TestTheiaResilientMonitoring(ResilientTheiaMixin, TheiaTestCase): + + MONITOR_CORS_DOMAIN = 'monitor.couscous.interface' + MONITOR_INTERFACE_URL = 'https://' + MONITOR_CORS_DOMAIN + '/#param1=a1' + + @classmethod + def getInstanceParameterDict(cls): + return { + 'monitor-interface-url': TestTheiaResilientMonitoring.MONITOR_INTERFACE_URL + } + + def test_monitoring_propagation(self): + + monitor_setup_url_list = [ + u for u in [ + p.getConnectionParameterDict().get('monitor-setup-url') + for p in self.slap.computer.getComputerPartitionList() + ] if u is not None + ] + self.assertEqual(len(monitor_setup_url_list), 4) + for url in monitor_setup_url_list: + self.assertIn(TestTheiaResilientMonitoring.MONITOR_INTERFACE_URL, url) + + monitor_cors_url_list = [ + u for u in [ + p.getInstanceParameterDict().get('monitor-cors-domains') + for p in self.slap.computer.getComputerPartitionList() + ] if u is not None + ] + for url in monitor_cors_url_list: + self.assertIn(TestTheiaResilientMonitoring.MONITOR_CORS_DOMAIN, url) # TODO: assert equal + + monitor_interface_url_list = [ + u for u in [ + p.getInstanceParameterDict().get('monitor-interface-url') + for p in self.slap.computer.getComputerPartitionList() + ] if u is not None + ] + self.assertEqual(len(monitor_interface_url_list), 4) + for url in monitor_interface_url_list: + self.assertIn(TestTheiaResilientMonitoring.MONITOR_INTERFACE_URL, url) diff --git a/stack/erp5/buildout.cfg b/stack/erp5/buildout.cfg index 01781bb1942f7b162a5e4bc4b2e1e60232925372..0d33680821a89668faa2c6e35b6d1657d61ef062 100644 --- a/stack/erp5/buildout.cfg +++ b/stack/erp5/buildout.cfg @@ -801,7 +801,7 @@ objgraph = 3.1.0 oic = 1.6.1 olefile = 0.44 ordered-set = 4.1.0:whl -Pillow = 10.2.0+SlapOSPatched001 +Pillow = 10.2.0 polib = 1.2.0 pprofile = 2.1.0 Products.BTreeFolder2 = 4.4+SlapOSPatched001 diff --git a/stack/monitor/buildout.hash.cfg b/stack/monitor/buildout.hash.cfg index 11c51b6248453ecf20d20359aea3298c4f5b4269..1e904b7e7e925fdc71607a4f305d700cd2ba2c0f 100644 --- a/stack/monitor/buildout.hash.cfg +++ b/stack/monitor/buildout.hash.cfg @@ -14,7 +14,7 @@ # not need these here). [monitor2-template] filename = instance-monitor.cfg.jinja2.in -md5sum = 24c7f5527d994e231b4c2bf9fecb68a6 +md5sum = 3d6f2d3b30b722bb1dd7eca0a0d91382 [monitor-httpd-conf] _update_hash_filename_ = templates/monitor-httpd.conf.in diff --git a/stack/monitor/instance-monitor.cfg.jinja2.in b/stack/monitor/instance-monitor.cfg.jinja2.in index 63d5c28c94885d7df7bb766ae1fe4c42994b4bc7..eb032507500d1526345eb2ab4567fba177ed9a1b 100644 --- a/stack/monitor/instance-monitor.cfg.jinja2.in +++ b/stack/monitor/instance-monitor.cfg.jinja2.in @@ -9,6 +9,7 @@ cert = ${slap-connection:cert-file} # XXX Default values if doesn't exists root-instance-title = UNKNOWN H-S instance-title = UNKNOWN Instance +configuration.monitor-interface-url = https://monitor.app.officejs.com/#page=ojsm_landing [directory] recipe = slapos.cookbook:mkdirectory @@ -158,6 +159,9 @@ recipe = plone.recipe.command stop-on-error = true password-file = ${monitor-directory:etc}/.monitor-password htpasswd-path = ${monitor-directory:etc}/monitor-htpasswd +location = + ${:password-file} + ${:htpasswd-path} command = echo "${monitor-instance-parameter:password}" >${:password-file} {{ apache_location }}/bin/htpasswd -cib ${:htpasswd-path} "${monitor-instance-parameter:username}" "${monitor-instance-parameter:password}" @@ -324,6 +328,16 @@ monitor-url = ${:monitor-base-url}/public/feeds monitor-user = ${monitor-instance-parameter:username} monitor-password = ${monitor-instance-parameter:password} +[monitor-parameters-propagation] +config-monitor-interface-url = ${slap-configuration:configuration.monitor-interface-url} + +[monitor-interface-configuration] +recipe = slapos.recipe.build +url = ${monitor-parameters-propagation:config-monitor-interface-url} +init = + from six.moves.urllib.parse import urlparse + options['cors-domain'] = urlparse(options['url']).hostname + [monitor-instance-parameter] monitor-title = ${slap-configuration:instance-title} monitor-httpd-ipv6 = ${slap-configuration:ipv6-random} @@ -333,17 +347,15 @@ monitor-base-url = ${monitor-frontend:connection-secure_access} #monitor-base-url = ${monitor-httpd-conf-parameter:url} root-instance-title = ${slap-configuration:root-instance-title} monitor-url-list = -cors-domains = monitor.app.officejs.com +cors-domains = ${monitor-interface-configuration:cors-domain} # XXX Hard coded parameter collector-db = /srv/slapgrid/var/data-log/collector.db # Credentials password = ${monitor-htpasswd:passwd} username = admin instance-configuration = - configuration-file-path = ${monitor-directory:etc}/monitor_knowledge0.cfg - -interface-url = https://monitor.app.officejs.com +interface-url = ${monitor-interface-configuration:url} [monitor-frontend] <= slap-connection @@ -425,10 +437,32 @@ depends = ${logrotate-entry-monitor-data:name} ${logrotate-entry-monitor-promise-history:name} +[expand-monitor-uri-template] +recipe = slapos.recipe.build +template = ${monitor-instance-parameter:interface-url}{&url,username,password} +url = ${monitor-publish-parameters:monitor-url} +username = ${monitor-publish-parameters:monitor-user} +password = ${monitor-publish-parameters:monitor-password} +init = + import zc.buildout + import pkg_resources + from six.moves.urllib.parse import unquote + + buildout_options = self.buildout["buildout"] + zc.buildout.easy_install.install( + ["uritemplate"], + dest=None, + working_set=pkg_resources.working_set, + path=[ + buildout_options["develop-eggs-directory"], + buildout_options["eggs-directory"]]) + + import uritemplate + options['uri'] = unquote(uritemplate.URITemplate(options['template']).expand(options)) + [monitor-publish] monitor-base-url = ${monitor-publish-parameters:monitor-base-url} -monitor-setup-url = ${monitor-instance-parameter:interface-url}/#page=settings_configurator&url=${monitor-publish-parameters:monitor-url}&username=${monitor-publish-parameters:monitor-user}&password=${monitor-publish-parameters:monitor-password} - +monitor-setup-url = ${expand-monitor-uri-template:uri} [buildout] diff --git a/stack/slapos.cfg b/stack/slapos.cfg index 43efa51dfa3f781d093ec9cc52088f7be6d58a7d..8acd766678e3ef45f123e17174215dbe64ea1488 100644 --- a/stack/slapos.cfg +++ b/stack/slapos.cfg @@ -138,10 +138,10 @@ eggs = # The last version of setuptools compatible with Python 3.7 setuptools = 67.8.0 # Use SlapOS patched zc.buildout -zc.buildout = 3.0.1+slapos006 +zc.buildout = 3.0.1+slapos007 pip = 23.2.1 # Use SlapOS patched zc.recipe.egg (zc.recipe.egg 2.x is for Buildout 2) -zc.recipe.egg = 2.0.8.dev0+slapos006 +zc.recipe.egg = 2.0.8.dev0+slapos007 aiofiles = 23.1.0:whl aiohttp = 3.8.5:whl