1. 20 Mar, 2024 3 commits
    • Jérome Perrin's avatar
      ERP5: rework frontend instance parameter · 93f1e220
      Jérome Perrin authored
      This change the format or the (mostly) unused frontend parameter to
      support requesting more than one frontend and also enable the request of
      a frontend by default, so that requesting a frontend separately is no
      longer needed.
      
      The `frontend` parameter now also supports requesting frontends for
      specific paths on the ERP5 backend, the example below requests a
      frontend serving directly a web site, with the necessary rewrite rules:
      
      ```js
      {
        "frontend": {
          "default": {
            "internal-path": "/erp5/web_site_module/renderjs_runner/"
          }
        }
      }
      ```
      
      The example below requests a default frontend to the erp5 root, to
      access the ZMI or erp5_xhtml_style interface and two web sites:
      
      ```js
      {
        "frontend": {
          "default": {},
          "erp5js": {
            "internal-path": "/erp5/web_site_module/renderjs_runner/"
          },
          "crm": {
            "internal-path": "/erp5/web_site_module/erp5_officejs_support_request_ui/"
          }
        }
      }
      ```
      
      The example below has an explicit definition of the zope families using
      `zope-partition-dict` parameter, because there is more than one zope
      family, no frontend is requested by default:
      
      ```js
      {
        "zope-partition-dict": {
          "backoffice": {
            "family": "backoffice"
          },
          "web": {
            "family": "web"
          },
          "activities": {
            "family": "activities"
          }
        }
      }
      ```
      
      Continuing this example, to have frontends for backoffice and web
      families, the frontend request can specify the families, like it is
      demonstrated in the example below. In this example, we don't specify an
      entry for "activities" family, so no frontend will be requested for
      this family.
      
      ```js
      {
        "frontend": {
          "backoffice": {
            "zope-family": "backoffice"
          },
          "web": {
            "zope-family": "web",
            "internal-path": "/erp5/web_site_module/web_site/"
          }
        }
        "zope-partition-dict": {
          "backoffice": {
            "family": "backoffice"
          },
          "web": {
            "family": "web"
          },
          "activities": {
            "family": "activities"
          }
        }
      }
      ```
      93f1e220
    • Jérome Perrin's avatar
      stack/erp5: serve balancer requests when client certificate is not verified · 8fa7ec94
      Jérome Perrin authored
      We configure haproxy with "verify optional", which makes haproxy request
      a client certificate, but accept the case where client does not present
      a certificate, but as described in [1], if client present a certificate
      and this certificate can not be verified, handshake is aborted. This is
      not what we want, we want to treat the case of a non verified
      certificate same as the case of the absence of certificate.
      
      This configures haproxy accordingly, using "crt-ignore-err all" to allow
      handshake anyway.
      
      Once this was fixed, there was a remaining problem with
      client_cert_verified acl, haproxy acl are OR, but this rule was supposed
      to be a AND (client present a certificate AND it is verified), this was
      rewritten to use inline condition which are AND.
      
      [1]: https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#5.1-verify
      
      Also adjust test_x_forwarded_for_stripped_when_no_certificate to assert
      that there is no X-Forwarded-For header at all when no client
      certificate.
      8fa7ec94
    • Levin Zimmermann's avatar
      software/erp5/test: Run tests with ZEO & NEO · 361c990b
      Levin Zimmermann authored
      Before this patch all ERP5 SlapOS Integration tests only run with ZEO
      storage. We should also run them against NEO, because we are using
      ERP5 with NEO in SlapOS.
      
      In order to do so we implemented parameterized test classes for our ERP5
      integration tests. Each test case can be configured via its __test_matrix__
      attribute. A test matrix is a dict which maps the flavoured class name suffix to
      a tuple of parameters. A parameter is a function which receives the
      instance_parameter_dict and modifies it in place. You can use the
      'matrix' helper function to construct a test matrix. If .__test_matrix__
      is 'None' the test case is ignored.
      
      /reviewed-by @kirr & @jerome
      /reviewed-on nexedi/slapos!1306
      361c990b
  2. 23 Jun, 2022 1 commit
  3. 21 Jun, 2022 2 commits
  4. 20 Jun, 2022 3 commits
  5. 17 Jun, 2022 7 commits
  6. 16 Jun, 2022 3 commits
  7. 15 Jun, 2022 7 commits
  8. 14 Jun, 2022 2 commits
  9. 13 Jun, 2022 5 commits
  10. 10 Jun, 2022 6 commits
    • Julien Muchembled's avatar
    • Jérome Perrin's avatar
    • Jérome Perrin's avatar
    • Jérome Perrin's avatar
      software/theia: fix typo in schemas · d1ae46a6
      Jérome Perrin authored
      d1ae46a6
    • Jérome Perrin's avatar
      software/{kvm,theia}: fix $ref in json schema · 0c3f66a0
      Jérome Perrin authored
      Fixes this warning when running test:
      
          UserWarning: Error validating request parameters against schema definition:
          RefResolutionError unknown url type: 'instance-input-schema.json'
      
      jsonschema (the python library) support this kind of refs when using
      version draft-06 but not when using draft-04.
      
      json-language-features (from theia text editor) does not understands
      file.json#/ references, it complains:
      
          $ref '/' in 'file://...' can not be resolved.(768)
      
      but not using the trailing / works fine
      0c3f66a0
    • Jérome Perrin's avatar
      software/theia: fix instance error when instance is not ASCII · faaebbf3
      Jérome Perrin authored
      b'💥' is a SyntaxError in python.
      
      Instead, switch to accessing options from option variable and apply
      this to other options from this part.
      
      This fixes this issue:
      
          While:
            Installing switch-softwaretype.
            Installing favicon.ico.
      
          An internal error occurred due to a bug in either zc.buildout or in a
          recipe being used:
          Traceback (most recent call last):
            File "zc.buildout-2.7.1+slapos019-py3.7.egg/zc/buildout/buildout.py", line 2360, in main
              getattr(buildout, command)(args)
            File "zc.buildout-2.7.1+slapos019-py3.7.egg/zc/buildout/buildout.py", line 640, in install
              self._install_parts(install_args)
            File "zc.buildout-2.7.1+slapos019-py3.7.egg/zc/buildout/buildout.py", line 820, in _install_parts
              installed_files = self[part]._call(recipe.install)
            File "zc.buildout-2.7.1+slapos019-py3.7.egg/zc/buildout/buildout.py", line 1668, in _call
              return f()
            File "slapos.cookbook-1.0.244-py3.7.egg/slapos/recipe/switch_softwaretype.py", line 108, in install
              sub_buildout.install([])
            File "zc.buildout-2.7.1+slapos019-py3.7.egg/zc/buildout/buildout.py", line 640, in install
              self._install_parts(install_args)
            File "zc.buildout-2.7.1+slapos019-py3.7.egg/zc/buildout/buildout.py", line 820, in _install_parts
              installed_files = self[part]._call(recipe.install)
            File "zc.buildout-2.7.1+slapos019-py3.7.egg/zc/buildout/buildout.py", line 1668, in _call
              return f()
            File "slapos.recipe.build-0.54-py3.7.egg/slapos/recipe/build/__init__.py", line 268, in install
              return self._shared.install(self.__install)
            File "slapos.recipe.build-0.54-py3.7.egg/slapos/recipe/__init__.py", line 150, in install
              install()
            File "slapos.recipe.build-0.54-py3.7.egg/slapos/recipe/build/__init__.py", line 278, in __install
              self._exec(self._install)
            File "slapos.recipe.build-0.54-py3.7.egg/slapos/recipe/build/__init__.py", line 261, in _exec
              code = compile(script, self.name, 'exec')
            File "favicon.ico", line 6
          SyntaxError: bytes can only contain ASCII literal characters.
      faaebbf3
  11. 09 Jun, 2022 1 commit