bundles/webfs: introduce

This commit is contained in:
Franzi 2021-04-30 19:40:45 +02:00
parent 30efde6eb3
commit 3de85e6717
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 61 additions and 0 deletions

View 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
View 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
View 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', {'*'})),
},
},
}