- pin bundlewrap ~=5.0 - rewrite non-reading and KeyError-driven metadata reactors per https://docs.bundlewrap.org/guide/migrate_45/ (defaults / metadata.get paths / MetadataUnavailable) - rename custom Download item methods (cdict/sdict/get_auto_deps -> expected_state/actual_state/get_auto_attrs) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
46 lines
1.1 KiB
Python
46 lines
1.1 KiB
Python
defaults = {
|
|
'users': {
|
|
'downloads': {
|
|
'home': '/var/lib/downloads',
|
|
'needs': {
|
|
'zfs_dataset:tank/downloads'
|
|
},
|
|
'authorized_users': {
|
|
f'build-server@{other_node.name}': {}
|
|
for other_node in repo.nodes
|
|
if other_node.has_bundle('build-server')
|
|
},
|
|
},
|
|
},
|
|
'zfs': {
|
|
'datasets': {
|
|
'tank/downloads': {
|
|
'mountpoint': '/var/lib/downloads',
|
|
},
|
|
},
|
|
},
|
|
'systemd-mount': {
|
|
'/var/lib/downloads_nginx': {
|
|
'source': '/var/lib/downloads',
|
|
'user': 'www-data',
|
|
},
|
|
},
|
|
}
|
|
|
|
|
|
@metadata_reactor.provides(
|
|
'nginx/vhosts',
|
|
)
|
|
def nginx(metadata):
|
|
return {
|
|
'nginx': {
|
|
'vhosts': {
|
|
metadata.get('download-server/hostname'): {
|
|
'content': 'nginx/directory_listing.conf',
|
|
'context': {
|
|
'directory': '/var/lib/downloads_nginx',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|