bundles: code style improvements
All checks were successful
bundlewrap/pipeline/head This commit looks good
All checks were successful
bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
2af911c29f
commit
f52df58517
24 changed files with 80 additions and 95 deletions
|
@ -42,17 +42,16 @@ def cpu_cores_to_config_values(metadata):
|
|||
)
|
||||
def iptables(metadata):
|
||||
interfaces = metadata.get('unbound/restrict-to-interfaces', set())
|
||||
iptables = []
|
||||
rules = []
|
||||
|
||||
for iface in sorted(interfaces):
|
||||
iptables.append(f'iptables_both -A INPUT -i {iface} -p tcp --dport 53 -j ACCEPT')
|
||||
iptables.append(f'iptables_both -A INPUT -i {iface} -p udp --dport 53 -j ACCEPT')
|
||||
rules.append(f'iptables_both -A INPUT -i {iface} -p tcp --dport 53 -j ACCEPT')
|
||||
rules.append(f'iptables_both -A INPUT -i {iface} -p udp --dport 53 -j ACCEPT')
|
||||
|
||||
return {
|
||||
'iptables': {
|
||||
'bundle_rules': {
|
||||
'unbound': iptables,
|
||||
'unbound': rules,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue