bundlewrap/bundles/nextcloud/metadata.py

91 lines
2.1 KiB
Python
Raw Permalink Normal View History

2023-09-02 19:14:38 +00:00
defaults = {
'backups': {
'paths': {
'/var/www/nextcloud',
},
},
'php': {
'clear_env': False,
'memory_limit': 512,
'post_max_size': 500, # MB
2023-09-02 19:14:38 +00:00
'packages': {
2023-09-03 10:19:34 +00:00
'apcu',
2023-09-02 19:14:38 +00:00
'bcmath',
'bz2',
'curl',
'gd',
'gmp',
'imagick',
'intl',
'mbstring',
'opcache',
'pgsql',
'redis',
'xml',
'yaml',
'zip',
},
},
'postgresql': {
'roles': {
'nextcloud': {
'password': repo.vault.password_for(f'{node.name} postgresql nextcloud'),
},
},
'databases': {
'nextcloud': {
'owner': 'nextcloud',
},
},
},
'systemd-timers': {
'timers': {
'nextcloud-cron': {
'command': '/usr/bin/php -f /var/www/nextcloud/cron.php',
'pwd': '/var/www/nextcloud',
'user': 'www-data',
'when': '*:00/5',
},
},
},
'zfs': {
'datasets': {
'tank/nextcloud': {
'mountpoint': '/var/www/nextcloud',
'needed_by': {
'directory:/var/www/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'),
'php': True,
'extras': True,
'max_body_size': '500M',
2023-09-02 19:14:38 +00:00
'index': [
'index.php',
'index.html',
'/index.php$request_uri',
],
'webroot_config': {
'owner': 'www-data',
},
},
},
},
}