bundles/radicale: add metadata reactor for nginx vhost

This commit is contained in:
Franzi 2021-07-23 12:56:29 +02:00
parent ca9e661b97
commit ff90f8cbca
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -14,9 +14,44 @@ defaults = {
'tank/radicale': {
'mountpoint': '/var/lib/radicale',
'needed_by': {
'directory:/var/lib/radicale/collections',
'pkg_apt:python3-radicale',
},
},
},
},
}
@metadata_reactor.provides(
'nginx/vhosts/radicale',
)
def nginx(metadata):
if not node.has_bundle('nginx'):
raise DoNotRunAgain
return {
'nginx': {
'vhosts': {
'radicale': {
'domain': metadata.get('radicale/domain'),
'locations': {
'/': {
'target': 'http://[::1]:22050',
'auth': {
'file': '/etc/radicale/htpasswd',
},
'proxy_set_header': {
'X-Remote-User': '$remote_user',
},
},
'/.web/': {
'target': 'http://[::1]:22050',
}
},
'website_check_path': '/.web/',
'website_check_string': 'Radicale',
},
},
},
}