@@ -51,13 +51,15 @@ local all all trust
5151local replication all trust
5252
5353# LAN/WAN autogenerated configurations
54+ {extra_hba}
5455{extra_conf}
5556"""
5657WAN_CIDRS = ("0.0.0.0/0" , "::0/0" )
5758
5859# Configuration helpers
5960hba_conf = []
6061ssl_conf = []
62+ extra_hba = []
6163
6264
6365def permissions_fix (filename , client = False ):
@@ -135,12 +137,12 @@ if WAN_CONNECTION != "hostssl" or ssl_conf:
135137 )
136138 )
137139
138- # Append extra rules to hba_conf
140+ # Append extra rules to extra_hba
139141for rule in extra_hba_rules :
140142 if not isinstance (rule , str ):
141143 print ("Each rule in HBA_EXTRA_RULES must be a string" , file = sys .stderr )
142144 sys .exit (1 )
143- hba_conf .append (rule )
145+ extra_hba .append (rule )
144146
145147# Write postgres configuration files
146148with open (CONF_FILE , "w" ) as conf_file :
@@ -151,7 +153,9 @@ with open(CONF_FILE, "w") as conf_file:
151153 )
152154permissions_fix (CONF_FILE )
153155with open (HBA_FILE , "w" ) as conf_file :
154- conf_file .write (HBA_TPL .format (extra_conf = "\n " .join (hba_conf )))
156+ conf_file .write (
157+ HBA_TPL .format (extra_hba = "\n " .join (extra_hba ), extra_conf = "\n " .join (hba_conf ))
158+ )
155159permissions_fix (HBA_FILE )
156160
157161# Continue normal execution
0 commit comments