add bundle:weechat, migrate weechat from rx300 to carlene
This commit is contained in:
parent
c6120accc1
commit
8cf2dde6e0
3 changed files with 111 additions and 61 deletions
98
bundles/weechat/metadata.py
Normal file
98
bundles/weechat/metadata.py
Normal file
|
@ -0,0 +1,98 @@
|
|||
defaults = {
|
||||
'apt': {
|
||||
'packages': {
|
||||
'libpod-parser-perl': {},
|
||||
'mosh': {},
|
||||
'weechat': {},
|
||||
'weechat-core': {},
|
||||
'weechat-curses': {},
|
||||
'weechat-perl': {},
|
||||
'weechat-plugins': {},
|
||||
'weechat-python': {},
|
||||
'weechat-ruby': {},
|
||||
},
|
||||
'repos': {
|
||||
'weechat': {
|
||||
'items': {
|
||||
'deb https://weechat.org/{os} {os_release} main',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
'nftables': {
|
||||
'rules': {
|
||||
'weechat-mosh': {
|
||||
'inet filter input udp dport { 60000-61000 } accept',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@metadata_reactor.provides(
|
||||
'backup-client/pre-hooks',
|
||||
'backups/paths',
|
||||
'users',
|
||||
'zfs/datasets',
|
||||
)
|
||||
def paths(metadata):
|
||||
user = metadata.get('weechat/user')
|
||||
|
||||
return {
|
||||
'backup-client': {
|
||||
'pre-hooks': {
|
||||
'weechat': f"""
|
||||
echo 'core.weechat */layout store' >> /home/{user}/.weechat/fifo
|
||||
echo 'core.weechat */save' >> /home/{user}/.weechat/fifo
|
||||
""",
|
||||
},
|
||||
},
|
||||
'backups': {
|
||||
'paths': {
|
||||
f'/home/{user}/.weechat',
|
||||
},
|
||||
},
|
||||
'users': {
|
||||
user: {
|
||||
'enable_linger': True,
|
||||
},
|
||||
},
|
||||
'zfs': {
|
||||
'datasets': {
|
||||
f'tank/{user}': {},
|
||||
f'tank/{user}/weechat': {
|
||||
'mountpoint': f'/home/{user}/.weechat',
|
||||
'compression': 'on',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@metadata_reactor.provides(
|
||||
'nginx/vhosts',
|
||||
)
|
||||
def relay_vhost(metadata):
|
||||
if not node.has_bundle('nginx'):
|
||||
raise DoNotRunAgain
|
||||
|
||||
relay_domain = metadata.get('weechat/relay_domain', None)
|
||||
if relay_domain is None:
|
||||
return {}
|
||||
|
||||
return {
|
||||
'nginx': {
|
||||
'vhosts': {
|
||||
'weechat': {
|
||||
'domain': relay_domain,
|
||||
'locations': {
|
||||
'/weechat': {
|
||||
'proxy_read_timeout': '12h',
|
||||
'target': 'http://[::1]:9000',
|
||||
'websockets': True,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue