bundles/ntfy: first draft
This commit is contained in:
parent
deba777a80
commit
a8cf858d44
7 changed files with 338 additions and 5 deletions
83
bundles/ntfy/metadata.py
Normal file
83
bundles/ntfy/metadata.py
Normal file
|
@ -0,0 +1,83 @@
|
|||
|
||||
defaults = {
|
||||
'apt': {
|
||||
'repos': {
|
||||
'ntfy': {
|
||||
'items': {
|
||||
'deb [arch=amd64] https://archive.heckel.io/apt debian main',
|
||||
},
|
||||
},
|
||||
},
|
||||
'packages': {
|
||||
'ntfy': {},
|
||||
},
|
||||
},
|
||||
'backups': {
|
||||
'paths': {
|
||||
"/var/cache/ntfy"
|
||||
"/var/lib/ntfy"
|
||||
"/var/opt/ntfy"
|
||||
},
|
||||
},
|
||||
'zfs': {
|
||||
'datasets': {
|
||||
'tank/ntfy': {},
|
||||
'tank/ntfy/cache': {
|
||||
'mountpoint': '/var/cache/ntfy',
|
||||
'needed_by': {
|
||||
'directory:/var/cache/ntfy',
|
||||
},
|
||||
},
|
||||
'tank/ntfy/lib': {
|
||||
'mountpoint': '/var/lib/ntfy',
|
||||
'needed_by': {
|
||||
'directory:/var/lib/ntfy',
|
||||
},
|
||||
},
|
||||
'tank/ntfy/attachmetns': {
|
||||
'mountpoint': '/var/opt/ntfy',
|
||||
'needed_by': {
|
||||
'directory:/var/opt/ntfy',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@metadata_reactor.provides(
|
||||
'nginx/vhosts',
|
||||
)
|
||||
def nginx(metadata):
|
||||
if not node.has_bundle('nginx'):
|
||||
raise DoNotRunAgain
|
||||
|
||||
locations = {
|
||||
'/': {
|
||||
'target': 'http://127.0.0.1:22091',
|
||||
'proxy_set_header': {
|
||||
'X-Real-IP': '$remote_addr',
|
||||
},
|
||||
'websockets': True,
|
||||
'proxy_read_timeout': '3m',
|
||||
'max_body_size': '20m',
|
||||
'additional_config': {
|
||||
'proxy_connect_timeout 3m',
|
||||
'proxy_send_timeout 3m',
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
vhosts = {
|
||||
'ntfy': {
|
||||
'domain': metadata.get('ntfy/baseurl'),
|
||||
'locations': locations,
|
||||
'website_check_path': '/',
|
||||
'website_check_string': 'ntfy',
|
||||
},
|
||||
}
|
||||
|
||||
return {
|
||||
'nginx': {
|
||||
'vhosts': vhosts
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue