Added local pleroma prometheus scraping.
authorLuke Hoersten <luke@hoersten.org>
Thu, 09 Jul 2020 19:57:16 -0500
changeset 123 e8d0308b94b2
parent 122 cde9702e3bff
child 124 870c04ac783b
Added local pleroma prometheus scraping.
pleroma/otp/templates/config.exs.j2
pleroma/otp/templates/pleroma.cloudflare.index.nginx.conf.j2
pleroma/otp/templates/pleroma.cloudflare.nginx.conf.j2
pleroma/otp/templates/pleroma.letsencrypt.nginx.conf.j2
--- a/pleroma/otp/templates/config.exs.j2	Thu Jul 09 18:49:48 2020 -0500
+++ b/pleroma/otp/templates/config.exs.j2	Thu Jul 09 19:57:16 2020 -0500
@@ -2,7 +2,7 @@
 
 config :pleroma, Pleroma.Web.Endpoint,
   url: [host: "{{pleroma_link_host}}", scheme: "{{pleroma_link_scheme}}", port: {{pleroma_link_port}}],
-  http: [port: {{pleroma_port}}, ip: {127, 0, 0, 1}],
+  http: [port: {{pleroma_port}}, ip: {0, 0, 0, 0}],
   secret_key_base: "{{pleroma_secret_key}}",
   secure_cookie_flag: true
 
@@ -30,7 +30,6 @@
 config :pleroma, :media_proxy,
   enabled: true,
   redirect_on_failure: true
-  #base_url: "https://cache.pleroma.social"
 
 config :pleroma, Pleroma.Repo,
   adapter: Ecto.Adapters.Postgres,
--- a/pleroma/otp/templates/pleroma.cloudflare.index.nginx.conf.j2	Thu Jul 09 18:49:48 2020 -0500
+++ b/pleroma/otp/templates/pleroma.cloudflare.index.nginx.conf.j2	Thu Jul 09 19:57:16 2020 -0500
@@ -72,4 +72,9 @@
         proxy_ignore_client_abort on;
         proxy_pass {{pleroma_proxy_pass}};
     }
+
+    # don't expose prometheus stats publicly
+    location /api/pleroma/app_metrics {
+        return 404;
+    }
 }
--- a/pleroma/otp/templates/pleroma.cloudflare.nginx.conf.j2	Thu Jul 09 18:49:48 2020 -0500
+++ b/pleroma/otp/templates/pleroma.cloudflare.nginx.conf.j2	Thu Jul 09 19:57:16 2020 -0500
@@ -64,4 +64,9 @@
         proxy_ignore_client_abort on;
         proxy_pass {{pleroma_proxy_pass}};
     }
+
+    # don't expose prometheus stats publicly
+    location /api/pleroma/app_metrics {
+        return 404;
+    }
 }
--- a/pleroma/otp/templates/pleroma.letsencrypt.nginx.conf.j2	Thu Jul 09 18:49:48 2020 -0500
+++ b/pleroma/otp/templates/pleroma.letsencrypt.nginx.conf.j2	Thu Jul 09 19:57:16 2020 -0500
@@ -69,4 +69,9 @@
         proxy_ignore_client_abort on;
         proxy_pass {{pleroma_proxy_pass}};
     }
+
+    # don't expose prometheus stats publicly
+    location /api/pleroma/app_metrics {
+        return 404;
+    }
 }