28 lines
542 B
Python
28 lines
542 B
Python
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',
|
|
)
|
|
def firewall(metadata):
|
|
return {
|
|
'firewall': {
|
|
'port_rules': {
|
|
str(metadata.get('webfs/port')): atomic(metadata.get('webfs/restrict-to', {'*'})),
|
|
},
|
|
},
|
|
}
|