diff --git a/autoconf-entrypoint b/autoconf-entrypoint index 710526f..3b8490e 100755 --- a/autoconf-entrypoint +++ b/autoconf-entrypoint @@ -51,6 +51,7 @@ local all all trust local replication all trust # LAN/WAN autogenerated configurations +{extra_hba} {extra_conf} """ WAN_CIDRS = ("0.0.0.0/0", "::0/0") @@ -58,6 +59,7 @@ WAN_CIDRS = ("0.0.0.0/0", "::0/0") # Configuration helpers hba_conf = [] ssl_conf = [] +extra_hba = [] def permissions_fix(filename, client=False): @@ -135,12 +137,12 @@ if WAN_CONNECTION != "hostssl" or ssl_conf: ) ) -# Append extra rules to hba_conf +# Append extra rules to extra_hba for rule in extra_hba_rules: if not isinstance(rule, str): print("Each rule in HBA_EXTRA_RULES must be a string", file=sys.stderr) sys.exit(1) - hba_conf.append(rule) + extra_hba.append(rule) # Write postgres configuration files with open(CONF_FILE, "w") as conf_file: @@ -151,7 +153,9 @@ with open(CONF_FILE, "w") as conf_file: ) permissions_fix(CONF_FILE) with open(HBA_FILE, "w") as conf_file: - conf_file.write(HBA_TPL.format(extra_conf="\n".join(hba_conf))) + conf_file.write( + HBA_TPL.format(extra_hba="\n".join(extra_hba), extra_conf="\n".join(hba_conf)) + ) permissions_fix(HBA_FILE) # Continue normal execution