Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Parse build information
Uku Taht892133d03686
diff --git a/lib/plausible_web/controllers/api/external_controller.ex b/lib/plausible_web/controllers/api/external_controller.exindex 1303f566c1..6ed4a0771f 100644--- a/lib/plausible_web/controllers/api/external_controller.ex+++ b/lib/plausible_web/controllers/api/external_controller.ex@@ -56,16 +56,6 @@ defmodule PlausibleWeb.Api.ExternalController doenddef info(conn, _params) do- version_file = Application.app_dir(:plausible, "priv/version.json")-- version =- with {:ok, file} <- File.read(version_file),- {:ok, json} <- Jason.decode(file) do- json- else- _ -> %{}- end-build_metadata = System.get_env("BUILD_METADATA", "{}") |> Jason.decode!()geo_database =@@ -77,11 +67,15 @@ defmodule PlausibleWeb.Api.ExternalController do"(not configured)"end- info =- Map.merge(version, %{- geo_database: geo_database,- build: build_metadata- })+ info = %{+ geo_database: geo_database,+ build: %{+ version: get_in(build_metadata, ["labels", "org.opencontainers.image.version"]),+ commit: get_in(build_metadata, ["labels", "org.opencontainers.image.revision"]),+ created: get_in(build_metadata, ["labels", "org.opencontainers.image.created"]),+ tags: get_in(build_metadata, ["tags"])+ }+ }json(conn, info)enddiff --git a/lib/plausible_web/router.ex b/lib/plausible_web/router.exindex ac04b287da..fd2ac76151 100644--- a/lib/plausible_web/router.ex+++ b/lib/plausible_web/router.ex@@ -114,6 +114,8 @@ defmodule PlausibleWeb.Router doget "/error", Api.ExternalController, :errorget "/health", Api.ExternalController, :healthget "/info", Api.ExternalController, :info+ get "/system/metadata", Api.ExternalController, :info+ get "/system/health", Api.ExternalController, :healthpost "/paddle/webhook", Api.PaddleController, :webhook