From 4ff25f68c89ac181e2cbc61e15d1be7554a50321 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Wed, 26 May 2021 14:40:56 +0200 Subject: [PATCH] Postgres socket authentication (#1052) * Allow to connect to postgres via socket auth * Add changelog entry for new env-vars Co-authored-by: Uku Taht --- CHANGELOG.md | 2 ++ config/runtime.exs | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2a047733..16c4172d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ All notable changes to this project will be documented in this file. - New parameter `metrics` for the `/api/v1/stats/timeseries` endpoint plausible/analytics#952 - CSV export now includes pageviews, bounce rate and visit duration in addition to visitors plausible/analytics#952 - Send stats to multiple dashboards by configuring a comma-separated list of domains plausible/analytics#968 +- To authenticate against a local postgresql via socket authentication, the environment-variables + `DATABASE_SOCKET_DIR` & `DATABASE_NAME` were added. - Time on Page metric available in detailed Top Pages report plausible/analytics#1007 - Glob (wildcard) based page, entry page and exit page filters plausible/analytics#1067 - Exclusion filters for page, entry page and exit page filters plausible/analytics#1067 diff --git a/config/runtime.exs b/config/runtime.exs index 4b2e30f85..78336643f 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -109,7 +109,15 @@ config :plausible, PlausibleWeb.Endpoint, http: [port: port], secret_key_base: secret_key_base -config :plausible, Plausible.Repo, url: db_url +case System.get_env("DATABASE_SOCKET_DIR", "") do + "" -> + config :plausible, Plausible.Repo, url: db_url + + x -> + config :plausible, Plausible.Repo, + socket_dir: x, + database: System.get_env("DATABASE_NAME") +end config :sentry, dsn: sentry_dsn,