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(
|
2021-06-03 11:59:15 +00:00
|
|
|
'firewall/port_rules',
|
2021-04-30 17:40:45 +00:00
|
|
|
)
|
2021-06-03 11:59:15 +00:00
|
|
|
def firewall(metadata):
|
2021-04-30 17:40:45 +00:00
|
|
|
return {
|
2021-06-03 11:59:15 +00:00
|
|
|
'firewall': {
|
2021-04-30 17:40:45 +00:00
|
|
|
'port_rules': {
|
|
|
|
str(metadata.get('webfs/port')): atomic(metadata.get('webfs/restrict-to', {'*'})),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|