bundles/element-web: only set --openssl-legacy-provider if using nodejs >= 17

This commit is contained in:
Franzi 2022-11-27 19:56:36 +01:00
parent dd420c4574
commit 615f6107bc
Signed by: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 10 additions and 3 deletions

View file

@ -25,11 +25,15 @@ files = {
}, },
} }
extra_install_cmds = []
if node.metadata.get('nodejs/version') >= 17:
# TODO verify this is still needed when upgrading to 1.12
extra_install_cmds.append('export NODE_OPTIONS=--openssl-legacy-provider')
actions = { actions = {
'element-web_yarn': { 'element-web_yarn': {
'command': ' && '.join([ 'command': ' && '.join([
# TODO verify this is still needed when upgrading to 1.12 *extra_install_cmds,
'export NODE_OPTIONS=--openssl-legacy-provider',
'cd /opt/element-web', 'cd /opt/element-web',
'yarn install --pure-lockfile --ignore-scripts', 'yarn install --pure-lockfile --ignore-scripts',
'yarn build', 'yarn build',

View file

@ -9,13 +9,16 @@ defaults = {
'nodejs': {}, 'nodejs': {},
}, },
}, },
'nodejs': {
'version': 18,
},
} }
@metadata_reactor.provides( @metadata_reactor.provides(
'apt/repos/nodejs/items', 'apt/repos/nodejs/items',
) )
def nodejs_from_version(metadata): def nodejs_from_version(metadata):
version = metadata.get('nodejs/version', 18) version = metadata.get('nodejs/version')
return { return {
'apt': { 'apt': {
'repos': { 'repos': {