2021-07-15 16:40:48 +00:00
|
|
|
defaults = {
|
|
|
|
'zfs': {
|
|
|
|
'datasets': {
|
|
|
|
'tank/element-web': {
|
|
|
|
'mountpoint': '/opt/element-web',
|
2021-07-17 17:40:41 +00:00
|
|
|
'needed_by': {
|
|
|
|
'directory:/opt/element-web',
|
|
|
|
},
|
2021-07-15 16:40:48 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2024-07-19 17:20:23 +00:00
|
|
|
@metadata_reactor.provides(
|
|
|
|
'nodejs/version',
|
|
|
|
)
|
|
|
|
def nodejs(metadata):
|
|
|
|
version = tuple([int(i) for i in metadata.get('element-web/version')[1:].split('.')])
|
|
|
|
|
|
|
|
if version >= (1, 11, 71):
|
|
|
|
return {
|
|
|
|
'nodejs': {
|
2024-12-22 03:59:29 +00:00
|
|
|
'version': 22,
|
2024-07-19 17:20:23 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
else:
|
|
|
|
return {
|
|
|
|
'nodejs': {
|
|
|
|
'version': 18,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-02-16 11:49:02 +00:00
|
|
|
@metadata_reactor.provides(
|
2021-07-16 12:20:01 +00:00
|
|
|
'nginx/vhosts/element-web',
|
2021-02-16 11:49:02 +00:00
|
|
|
)
|
|
|
|
def nginx_config(metadata):
|
|
|
|
return {
|
|
|
|
'nginx': {
|
|
|
|
'vhosts': {
|
2021-07-15 16:40:48 +00:00
|
|
|
'element-web': {
|
|
|
|
'domain': metadata.get('element-web/url'),
|
2021-07-15 16:44:02 +00:00
|
|
|
'webroot': '/opt/element-web/webapp/',
|
2021-02-16 11:49:02 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@metadata_reactor.provides(
|
|
|
|
'icinga2_api/element-web/services',
|
|
|
|
)
|
|
|
|
def icinga_check_for_new_release(metadata):
|
|
|
|
return {
|
|
|
|
'icinga2_api': {
|
|
|
|
'element-web': {
|
|
|
|
'services': {
|
|
|
|
'ELEMENT-WEB UPDATE': {
|
|
|
|
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_github_for_new_release vector-im/element-web {}'.format(metadata.get('element-web/version')),
|
|
|
|
'vars.notification.mail': True,
|
|
|
|
'check_interval': '60m',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|