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