bundlewrap/bundles/webfs/metadata.py

29 lines
542 B
Python
Raw Normal View History

2021-04-30 17:40:45 +00:00
from bundlewrap.metadata import atomic
defaults = {
'apt': {
'packages': {
'webfs': {},
},
},
'webfs': {
'webroot': '/var/www',
'port': 8000,
'user': 'www-data',
'group': 'www-data',
},
}
@metadata_reactor.provides(
'firewall/port_rules',
2021-04-30 17:40:45 +00:00
)
def firewall(metadata):
2021-04-30 17:40:45 +00:00
return {
'firewall': {
2021-04-30 17:40:45 +00:00
'port_rules': {
str(metadata.get('webfs/port')): atomic(metadata.get('webfs/restrict-to', {'*'})),
},
},
}