bundles/ntfy: update config to more recent version

This commit is contained in:
Franzi 2023-04-09 12:09:28 +02:00
parent 2297f1dacf
commit 95d5c0cfc8
Signed by: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 104 additions and 39 deletions

View file

@ -1,43 +1,55 @@
ratelimit_exempt_hosts = set()
files = {
'/etc/ntfy/server.yml': {
'content_type': 'mako',
'needs': {
'pkg_apt:ntfy',
},
'triggers': {
'svc_systemd:ntfy:restart',
},
for identifier in node.metadata.get('ntfy/ratelimit-exempt-hosts', set()):
ips = repo.libs.tools.resolve_identifier(repo, identifier)
ratelimit_exempt_hosts |= {str(ip) for ip in ips['ipv4']}
ratelimit_exempt_hosts |= {str(ip) for ip in ips['ipv6']}
files['/etc/ntfy/server.yml'] = {
'content_type': 'mako',
'context': {
'ratelimit_exempt_hosts': ratelimit_exempt_hosts,
},
'after': {
'pkg_apt:ntfy',
},
'triggers': {
'svc_systemd:ntfy:restart',
},
}
directories = {
'/opt/ntfy': {},
'/var/lib/ntfy': {
'owner': 'ntfy',
'group': 'ntfy',
},
'/var/cache/ntfy': {
'owner': 'ntfy',
'group': 'ntfy',
},
'/var/opt/ntfy': {
'owner': 'ntfy',
'group': 'ntfy',
directories['/var/lib/ntfy'] = {
'owner': 'ntfy',
'group': 'ntfy',
'before': {
'pkg_apt:ntfy',
},
}
svc_systemd = {
'ntfy': {
'needs': {
'file:/etc/ntfy/server.yml',
'pkg_apt:ntfy',
},
directories['/var/cache/ntfy'] = {
'owner': 'ntfy',
'group': 'ntfy',
'before': {
'pkg_apt:ntfy',
},
}
users = {
'ntfy': {
'home': '/opt/ntfy',
directories['/var/opt/ntfy'] = {
'owner': 'ntfy',
'group': 'ntfy',
'before': {
'pkg_apt:ntfy',
},
}
svc_systemd['ntfy'] = {
'needs': {
'file:/etc/ntfy/server.yml',
'pkg_apt:ntfy',
},
}
users['ntfy'] = {
'home': '/var/lib/ntfy',
}