@@ -51,13 +51,15 @@ local all all trust
51
51
local replication all trust
52
52
53
53
# LAN/WAN autogenerated configurations
54
+ {extra_hba}
54
55
{extra_conf}
55
56
"""
56
57
WAN_CIDRS = ("0.0.0.0/0" , "::0/0" )
57
58
58
59
# Configuration helpers
59
60
hba_conf = []
60
61
ssl_conf = []
62
+ extra_hba = []
61
63
62
64
63
65
def permissions_fix (filename , client = False ):
@@ -135,12 +137,12 @@ if WAN_CONNECTION != "hostssl" or ssl_conf:
135
137
)
136
138
)
137
139
138
- # Append extra rules to hba_conf
140
+ # Append extra rules to extra_hba
139
141
for rule in extra_hba_rules :
140
142
if not isinstance (rule , str ):
141
143
print ("Each rule in HBA_EXTRA_RULES must be a string" , file = sys .stderr )
142
144
sys .exit (1 )
143
- hba_conf .append (rule )
145
+ extra_hba .append (rule )
144
146
145
147
# Write postgres configuration files
146
148
with open (CONF_FILE , "w" ) as conf_file :
@@ -151,7 +153,9 @@ with open(CONF_FILE, "w") as conf_file:
151
153
)
152
154
permissions_fix (CONF_FILE )
153
155
with 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
+ )
155
159
permissions_fix (HBA_FILE )
156
160
157
161
# Continue normal execution
0 commit comments