defaults = {
    'backups': {
        'paths': {
            '/var/opt/matrix-stickerpicker',
        },
    },
    'zfs': {
        'datasets': {
            'tank/matrix-stickerpicker': {
                'mountpoint': '/var/opt/matrix-stickerpicker',
                'needed_by': {
                    'directory:/var/opt/matrix-stickerpicker',
                },
            },
        },
    },
}


@metadata_reactor.provides(
    'nginx/vhosts/matrix-stickerpicker',
)
def nginx(metadata):
    if not node.has_bundle('nginx'):
        raise DoNotRunAgain

    return {
        'nginx': {
            'vhosts': {
                'matrix-stickerpicker': {
                    'domain': metadata.get('matrix-stickerpicker/domain'),
                    'do_not_set_content_security_headers': True,
                    'webroot': '/opt/matrix-stickerpicker/src/web/',
                },
            },
        },
    }
