Changeset 10748 in genesis


Ignore:
Timestamp:
May 9, 2012, 5:18:18 PM (13 years ago)
Author:
rick
Message:

Setup for boxes which are _only_ incoming portforward and NAT units.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/gformat.py

    r10734 r10748  
    9999  gfile = os.path.join(NODE_DIR,item,'wleiden.yaml')
    100100
    101   # Use some boring defaults
    102101  datadump = {}
    103102  f = open(gfile, 'r')
    104103  datadump.update(yaml.load(f,Loader=Loader))
    105104  if datadump['nodetype'] == 'Hybrid':
    106     defaults = { 'service_proxy_normal' : False, 'service_proxy_ileiden' : False, 'service_accesspoint' : True }
     105    # Some values are defined implicitly
     106    if datadump.has_key('rdr_rules') and datadump['rdr_rules'] and not datadump.has_key('service_incoming_rdr'):
     107      datadump['service_incoming_rdr'] = True
     108    # Use some boring defaults
     109    defaults = {
     110      'service_proxy_normal' : False,
     111      'service_proxy_ileiden' : False,
     112      'service_accesspoint' : True,
     113      'service_incoming_rdr' : False
     114    }
    107115    for (key,value) in defaults.iteritems():
    108116      if not datadump.has_key(key):
     
    560568  service_proxy_normal="{{ service_proxy_normal|yesorno }}"
    561569  service_accesspoint="{{ service_accesspoint|yesorno }}"
     570  service_incoming_rdr="{{ service_incoming_rdr|yesorno }}"
    562571  #
    563572
     
    566575    pf_flags="-D ext_if=$externalif -D ext_if_net=$externalif:network -D masterip=$masterip"
    567576    pf_flags="$pf_flags -D publicnat=80,443"
    568   {% elif service_proxy_normal %}
     577  {% elif service_proxy_normal or service_incoming_rdr %}
    569578    pf_rules="/etc/pf.hybrid.conf"
    570579    pf_flags="-D ext_if=$externalif -D ext_if_net=$externalif:network -D masterip=$masterip"
     
    849858{% if service_proxy_ileiden -%}
    850859 - iLeiden Proxy
     860{% endif -%}
     861{% if service_incoming_rdr -%}
     862 - Incoming port redirects
    851863{% endif %}
    852864Interlinks:\n
Note: See TracChangeset for help on using the changeset viewer.