1 <% from invirt.config import structs as cfg %>\
2 # PostgreSQL Client Authentication Configuration File
3 # ===================================================
5 # Refer to the PostgreSQL Administrator's Guide, chapter "Client
6 # Authentication" for a complete description. A short synopsis
9 # This file controls: which hosts are allowed to connect, how clients
10 # are authenticated, which PostgreSQL user names they can use, which
11 # databases they can access. Records take one of these forms:
13 # local DATABASE USER METHOD [OPTION]
14 # host DATABASE USER CIDR-ADDRESS METHOD [OPTION]
15 # hostssl DATABASE USER CIDR-ADDRESS METHOD [OPTION]
16 # hostnossl DATABASE USER CIDR-ADDRESS METHOD [OPTION]
18 # (The uppercase items must be replaced by actual values.)
20 # The first field is the connection type: "local" is a Unix-domain socket,
21 # "host" is either a plain or SSL-encrypted TCP/IP socket, "hostssl" is an
22 # SSL-encrypted TCP/IP socket, and "hostnossl" is a plain TCP/IP socket.
24 # DATABASE can be "all", "sameuser", "samerole", a database name, or
25 # a comma-separated list thereof.
27 # USER can be "all", a user name, a group name prefixed with "+", or
28 # a comma-separated list thereof. In both the DATABASE and USER fields
29 # you can also write a file name prefixed with "@" to include names from
32 # CIDR-ADDRESS specifies the set of hosts the record matches.
33 # It is made up of an IP address and a CIDR mask that is an integer
34 # (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that specifies
35 # the number of significant bits in the mask. Alternatively, you can write
36 # an IP address and netmask in separate columns to specify the set of hosts.
38 # METHOD can be "trust", "reject", "md5", "crypt", "password",
39 # "krb5", "ident", or "pam". Note that "password" sends passwords
40 # in clear text; "md5" is preferred since it sends encrypted passwords.
42 # OPTION is the ident map or the name of the PAM service, depending on METHOD.
44 # Database and user names containing spaces, commas, quotes and other special
45 # characters must be quoted. Quoting one of the keywords "all", "sameuser" or
46 # "samerole" makes the name lose its special character, and just match a
47 # database or username with that name.
49 # This file is read on server startup and when the postmaster receives
50 # a SIGHUP signal. If you edit the file on a running system, you have
51 # to SIGHUP the postmaster for the changes to take effect. You can use
52 # "pg_ctl reload" to do that.
54 # Put your actual configuration here
55 # ----------------------------------
57 # If you want to allow non-local connections, you need to add more
58 # "host" records. In that case you will also need to make PostgreSQL listen
59 # on a non-local interface via the listen_addresses configuration parameter,
60 # or via the -i or -h command line switches.
67 # If you change this first entry you will need to make sure that the
69 # super user can access the database using some other method.
71 # access to all databases is required during automatic maintenance
72 # (autovacuum, daily cronjob, replication, and similar tasks).
74 # Database administrative login by UNIX sockets
75 local all postgres ident sameuser
77 # TYPE DATABASE USER CIDR-ADDRESS METHOD
79 # "local" is for Unix domain socket connections only
80 local all all ident sameuser
81 % for m in cfg.hosts + [cfg.db, cfg.remote, cfg.console]:
82 host ${cfg.db.dbname} ${cfg.db.user} ${m.ip}/32 trust