bundlewrap/bundles/nextcloud/metadata.py

84 lines
2.1 KiB
Python
Raw Normal View History

2021-12-17 20:17:22 +00:00
defaults = {
'php': {
'version': '8.0',
'packages': {
'apcu',
'bcmath',
'bz2',
'curl',
'gd',
'gmp',
'imagick',
'intl',
'ldap',
'mbstring',
'memcached',
'pgsql',
'redis',
'xml',
'zip',
},
'memory_limit': 512,
'post_max_size': 500,
'clear_env': False,
},
'postgresql': {
'version': '13',
'roles': {
'nextcloud': {
'password': repo.vault.password_for(f'{node.name} postgresql nextcloud'),
},
},
'databases': {
'nextcloud': {
'owner': 'nextcloud',
},
},
},
}
@metadata_reactor.provides(
'nginx/vhosts/nextcloud',
)
def nginx(metadata):
if not node.has_bundle('nginx'):
raise DoNotRunAgain
return {
'nginx': {
'vhosts': {
'nextcloud': {
'domain': metadata.get('nextcloud/domain'),
'webroot_config': {
'owner': 'www-data',
'group': 'www-data',
},
'max_body_size': '500M',
'extras': True,
#'website_check_path': '/user/login',
#'website_check_string': 'Sign In',
},
},
},
}
@metadata_reactor.provides(
'icinga2_api/nextcloud/services',
)
def icinga_check_for_new_release(metadata):
return {
'icinga2_api': {
'nextcloud': {
'services': {
'NEXTCLOUD UPDATE': {
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_github_for_new_release nextcloud/server {}'.format(metadata.get('nextcloud/version')),
'vars.notification.mail': True,
'check_interval': '60m',
},
},
},
},
}