summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorfeld <feld@feld.me>2020-10-27 17:47:56 +0000
committerrinpatch <rinpatch@sdf.org>2020-11-05 16:22:35 +0300
commit86b4149a1350b23a122f3ea8e2ef79ab3e8785e1 (patch)
tree0595c4de429fe5a37c9004dab8895c45d2ff97fd /config
parent5f27a39152cfee4746313ee8c63fb5f600fdb1a2 (diff)
Merge branch '1668-prometheus-access-restrictions' into 'develop'
[#1668] App metrics endpoint (Prometheus) access restrictions Closes #1668 See merge request pleroma/pleroma!3093
Diffstat (limited to 'config')
-rw-r--r--config/config.exs7
-rw-r--r--config/description.exs37
2 files changed, 43 insertions, 1 deletions
diff --git a/config/config.exs b/config/config.exs
index 170e4e1c7..99c33010f 100644
--- a/config/config.exs
+++ b/config/config.exs
@@ -637,7 +637,12 @@ config :pleroma, Pleroma.Emails.UserEmail,
config :pleroma, Pleroma.Emails.NewUsersDigestEmail, enabled: false
-config :prometheus, Pleroma.Web.Endpoint.MetricsExporter, path: "/api/pleroma/app_metrics"
+config :prometheus, Pleroma.Web.Endpoint.MetricsExporter,
+ enabled: false,
+ auth: false,
+ ip_whitelist: [],
+ path: "/api/pleroma/app_metrics",
+ format: :text
config :pleroma, Pleroma.ScheduledActivity,
daily_user_limit: 25,
diff --git a/config/description.exs b/config/description.exs
index fa843ea8c..71b12326f 100644
--- a/config/description.exs
+++ b/config/description.exs
@@ -3709,5 +3709,42 @@ config :pleroma, :config_description, [
suggestions: [2]
}
]
+ },
+ %{
+ group: :prometheus,
+ key: Pleroma.Web.Endpoint.MetricsExporter,
+ type: :group,
+ description: "Prometheus app metrics endpoint configuration",
+ children: [
+ %{
+ key: :enabled,
+ type: :boolean,
+ description: "[Pleroma extension] Enables app metrics endpoint."
+ },
+ %{
+ key: :ip_whitelist,
+ type: [{:list, :string}, {:list, :charlist}, {:list, :tuple}],
+ description:
+ "[Pleroma extension] If non-empty, restricts access to app metrics endpoint to specified IP addresses."
+ },
+ %{
+ key: :auth,
+ type: [:boolean, :tuple],
+ description: "Enables HTTP Basic Auth for app metrics endpoint.",
+ suggestion: [false, {:basic, "myusername", "mypassword"}]
+ },
+ %{
+ key: :path,
+ type: :string,
+ description: "App metrics endpoint URI path.",
+ suggestions: ["/api/pleroma/app_metrics"]
+ },
+ %{
+ key: :format,
+ type: :atom,
+ description: "App metrics endpoint output format.",
+ suggestions: [:text, :protobuf]
+ }
+ ]
}
]