bundlewrap/bundles/nextcloud/metadata.py

89 lines
2 KiB
Python
Raw Normal View History

2023-09-02 19:14:38 +00:00
defaults = {
'backups': {
'paths': {
'/var/www/nextcloud',
},
},
'php': {
'clear_env': False,
'memory_limit': 512,
'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,
'index': [
'index.php',
'index.html',
'/index.php$request_uri',
],
'webroot_config': {
'owner': 'www-data',
},
},
},
},
}