Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions templates/pg_hba.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,20 @@ local all all ident <%= "sameuser" if sc
# IPv4 local connections:
host all postgres <%= @ip_mask_deny_postgres_user + "\t" %> reject
<% @ipv4acls.each do |acl|; parts = acl.split -%>
<% if parts.length <= 4 -%>
<%= parts[0] + "\t" + parts[1] + "\t" + parts[2] + "\t\t\t\t" + parts[3] %>
<% else -%>
<%= parts[0] + "\t" + parts[1] + "\t" + parts[2] + "\t\t" + parts[3] + "\t\t" + parts[4] + "\t" + parts.last(parts.length - 5).join(" ") %>
<% end -%>
<% end -%>
host all all <%= @ip_mask_allow_all_users + "\t" %> md5
# IPv6 local connections:
host all all ::1/128 md5
<% @ipv6acls.each do |acl|; parts = acl.split -%>
<% if parts.length <= 4 -%>
<%= parts[0] + "\t" + parts[1] + "\t" + parts[2] + "\t\t\t\t" + parts[3] %>
<% else -%>
<%= parts[0] + "\t" + parts[1] + "\t" + parts[2] + "\t\t" + parts[3] + "\t\t" + parts[4] + "\t" + parts.last(parts.length - 5).join(" ") %>
<% end -%>
<% end -%>