{"action":"created","issue":{"url":"https://api.github.com/repos/sameersbn/docker-postgresql/issues/14","labels_url":"https://api.github.com/repos/sameersbn/docker-postgresql/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/sameersbn/docker-postgresql/issues/14/comments","events_url":"https://api.github.com/repos/sameersbn/docker-postgresql/issues/14/events","html_url":"https://github.com/sameersbn/docker-postgresql/issues/14","id":57071907,"number":14,"title":"PSQL_TRUST_LOCALNET order incorrect","user":{"login":"lgfausak","id":2189483,"avatar_url":"https://avatars.githubusercontent.com/u/2189483?v=3","gravatar_id":"","url":"https://api.github.com/users/lgfausak","html_url":"https://github.com/lgfausak","followers_url":"https://api.github.com/users/lgfausak/followers","following_url":"https://api.github.com/users/lgfausak/following{/other_user}","gists_url":"https://api.github.com/users/lgfausak/gists{/gist_id}","starred_url":"https://api.github.com/users/lgfausak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lgfausak/subscriptions","organizations_url":"https://api.github.com/users/lgfausak/orgs","repos_url":"https://api.github.com/users/lgfausak/repos","events_url":"https://api.github.com/users/lgfausak/events{/privacy}","received_events_url":"https://api.github.com/users/lgfausak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-09T18:45:00Z","updated_at":"2015-02-10T04:19:43Z","closed_at":null,"body":"The addition to support PSQL_TRUST_LOCALNET needs to set the samenet pg_hba.conf file BEFORE the host all 0.0.0.0 line.  I swapped the order, the new order looks like this:\r\n\r\n```\r\nif [ ${PSQL_TRUST_LOCALNET} = \"true\" ]; then\r\n  echo \"Enabling trust samenet in pg_hba.conf...\"\r\n  cat >> ${PG_CONFDIR}/pg_hba.conf <<EOF\r\nhost    all             all             samenet                 trust\r\nEOF\r\nfi\r\n\r\n# allow remote connections to postgresql database\r\ncat >> ${PG_CONFDIR}/pg_hba.conf <<EOF\r\nhost    all             all             0.0.0.0/0               md5\r\nEOF\r\n```\r\n\r\nNote the PSQL_TRUST_LOCALNET comes first.  Otherwise, the second one masks the first one.\r\n\r\nI added this code to my pull request for uid/gid postgres/postgres 600/600, if merged, this will come along with it.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/sameersbn/docker-postgresql/issues/comments/73642042","html_url":"https://github.com/sameersbn/docker-postgresql/issues/14#issuecomment-73642042","issue_url":"https://api.github.com/repos/sameersbn/docker-postgresql/issues/14","id":73642042,"user":{"login":"sameersbn","id":410147,"avatar_url":"https://avatars.githubusercontent.com/u/410147?v=3","gravatar_id":"","url":"https://api.github.com/users/sameersbn","html_url":"https://github.com/sameersbn","followers_url":"https://api.github.com/users/sameersbn/followers","following_url":"https://api.github.com/users/sameersbn/following{/other_user}","gists_url":"https://api.github.com/users/sameersbn/gists{/gist_id}","starred_url":"https://api.github.com/users/sameersbn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sameersbn/subscriptions","organizations_url":"https://api.github.com/users/sameersbn/orgs","repos_url":"https://api.github.com/users/sameersbn/repos","events_url":"https://api.github.com/users/sameersbn/events{/privacy}","received_events_url":"https://api.github.com/users/sameersbn/received_events","type":"User","site_admin":false},"created_at":"2015-02-10T04:19:43Z","updated_at":"2015-02-10T04:19:43Z","body":"@lgfausak understood, please send a separate PR for this fix."}}