bundles/webfs: introduce
This commit is contained in:
parent
30efde6eb3
commit
3de85e6717
3 changed files with 61 additions and 0 deletions
16
bundles/webfs/files/webfsd.conf
Normal file
16
bundles/webfs/files/webfsd.conf
Normal file
|
@ -0,0 +1,16 @@
|
|||
web_root="${webroot}"
|
||||
web_host="${node.hostname}"
|
||||
web_ip=""
|
||||
web_port="${port}"
|
||||
web_virtual="false"
|
||||
web_timeout=""
|
||||
web_conn=""
|
||||
web_index=""
|
||||
web_dircache=""
|
||||
web_accesslog=""
|
||||
web_logbuffering="true"
|
||||
web_syslog="true"
|
||||
web_user="${user}"
|
||||
web_group="${group}"
|
||||
web_cgipath=""
|
||||
web_extras=""
|
17
bundles/webfs/items.py
Normal file
17
bundles/webfs/items.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
files = {
|
||||
'/etc/webfsd.conf': {
|
||||
'content_type': 'mako',
|
||||
'context': node.metadata['webfs'],
|
||||
'triggers': {
|
||||
'svc_systemd:webfs:restart',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
svc_systemd = {
|
||||
'webfs': {
|
||||
'needs': {
|
||||
'pkg_apt:webfs',
|
||||
},
|
||||
},
|
||||
}
|
28
bundles/webfs/metadata.py
Normal file
28
bundles/webfs/metadata.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
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', {'*'})),
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Reference in a new issue