From 4f0d0870684ffb7980020dfe2280991c28b0b19b Mon Sep 17 00:00:00 2001
From: Dan Notestein <dan@syncad.com>
Date: Mon, 3 Mar 2025 20:12:45 +0000
Subject: [PATCH] Set default loglevels

---
 .env.example            | 10 +++++-----
 balance_tracker.yaml    |  2 +-
 haf_block_explorer.yaml |  2 +-
 hafah.yaml              |  2 +-
 hivemind.yaml           |  2 +-
 reputation_tracker.yaml |  2 +-
 swagger.yaml            | 10 ----------
 7 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/.env.example b/.env.example
index 09ab860..70ef6f8 100644
--- a/.env.example
+++ b/.env.example
@@ -194,11 +194,11 @@ PUBLIC_HOSTNAME="your.hostname.com"
 
 # PostgREST server log levels
 # https://docs.postgrest.org/en/latest/references/configuration.html#log-level
-BALANCE_TRACKER_SERVER_LOG_LEVEL=error
-BLOCK_EXPLORER_SERVER_LOG_LEVEL=error
-HAFAH_SERVER_LOG_LEVEL=error
-HIVEMIND_SERVER_LOG_LEVEL=error
-REPUTATION_TRACKER_SERVER_LOG_LEVEL=error
+#BALANCE_TRACKER_SERVER_LOG_LEVEL=error
+#BLOCK_EXPLORER_SERVER_LOG_LEVEL=error
+#HAFAH_SERVER_LOG_LEVEL=error
+#HIVEMIND_SERVER_LOG_LEVEL=error
+#REPUTATION_TRACKER_SERVER_LOG_LEVEL=error
 
 # There are several ways you can configure serving HTTP/HTTPS.  Some examples:
 # - to serve API using HTTPS with automatic redirect from HTTP -> HTTPS (the default), 
diff --git a/balance_tracker.yaml b/balance_tracker.yaml
index 3f44ae0..2098a20 100644
--- a/balance_tracker.yaml
+++ b/balance_tracker.yaml
@@ -74,7 +74,7 @@ services:
       PGRST_DB_POOL_ACQUISITION_TIMEOUT: 10
       PGRST_DB_EXTRA_SEARCH_PATH: ${BTRACKER_SCHEMA:-hafbe_bal}
       # PGRST_OPENAPI_SERVER_PROXY_URI: http://${PUBLIC_HOSTNAME}/btracker_api/
-      PGRST_LOG_LEVEL: ${BALANCE_TRACKER_SERVER_LOG_LEVEL}
+      PGRST_LOG_LEVEL: ${BALANCE_TRACKER_SERVER_LOG_LEVEL:-error}
     healthcheck:
       test: ["CMD-SHELL", "wget --timeout=2 -nv -t1 --spider 127.0.0.1:3001/ready || exit 1"]
       interval: 10s
diff --git a/haf_block_explorer.yaml b/haf_block_explorer.yaml
index f120ccb..7bf5d13 100644
--- a/haf_block_explorer.yaml
+++ b/haf_block_explorer.yaml
@@ -121,7 +121,7 @@ services:
       PGRST_DB_ROOT_SPEC: root
       PGRST_DB_EXTRA_SEARCH_PATH: hafbe_bal, reptracker_app
       # PGRST_OPENAPI_SERVER_PROXY_URI: http://${PUBLIC_HOSTNAME}/hafbe_api/
-      PGRST_LOG_LEVEL: ${BLOCK_EXPLORER_SERVER_LOG_LEVEL}
+      PGRST_LOG_LEVEL: ${BLOCK_EXPLORER_SERVER_LOG_LEVEL:-error}
     networks:
       haf-network:
     healthcheck:
diff --git a/hafah.yaml b/hafah.yaml
index 43ab4c9..1dd6347 100644
--- a/hafah.yaml
+++ b/hafah.yaml
@@ -44,7 +44,7 @@ services:
       PGRST_DB_POOL: 20
       PGRST_DB_POOL_ACQUISITION_TIMEOUT: 10
       PGRST_OPENAPI_SERVER_PROXY_URI: http://127.0.0.1:3000
-      PGRST_LOG_LEVEL: ${HAFAH_SERVER_LOG_LEVEL}
+      PGRST_LOG_LEVEL: ${HAFAH_SERVER_LOG_LEVEL:-error}
     networks:
       haf-network:
     healthcheck:
diff --git a/hivemind.yaml b/hivemind.yaml
index 4c321f1..cf3c6c1 100644
--- a/hivemind.yaml
+++ b/hivemind.yaml
@@ -86,7 +86,7 @@ services:
       PGRST_OPENAPI_MODE: "disabled" # unclear why this is set, I guess because we currently only support json-rpc?
       # when debugging, you can enable this
       # PGRST_DB_PLAN_ENABLED: true
-      PGRST_LOG_LEVEL: ${HIVEMIND_SERVER_LOG_LEVEL}
+      PGRST_LOG_LEVEL: ${HIVEMIND_SERVER_LOG_LEVEL:-error}
     healthcheck:
       test: ["CMD-SHELL", "wget --timeout=2 -nv -t1 --spider 127.0.0.1:3001/ready || exit 1"]
       interval: 10s
diff --git a/reputation_tracker.yaml b/reputation_tracker.yaml
index 08d6ba7..cf84b26 100644
--- a/reputation_tracker.yaml
+++ b/reputation_tracker.yaml
@@ -71,7 +71,7 @@ services:
       PGRST_DB_POOL_ACQUISITION_TIMEOUT: 10
       PGRST_DB_EXTRA_SEARCH_PATH: reptracker_app
       # PGRST_OPENAPI_SERVER_PROXY_URI: http://${PUBLIC_HOSTNAME}/reptracker_user/
-      PGRST_LOG_LEVEL: ${REPUTATION_TRACKER_SERVER_LOG_LEVEL}
+      PGRST_LOG_LEVEL: ${REPUTATION_TRACKER_SERVER_LOG_LEVEL:-error}
     healthcheck:
       test: ["CMD-SHELL", "wget --timeout=2 -nv -t1 --spider 127.0.0.1:3001/ready || exit 1"]
       interval: 10s
diff --git a/swagger.yaml b/swagger.yaml
index c18fbe8..341adba 100644
--- a/swagger.yaml
+++ b/swagger.yaml
@@ -14,13 +14,3 @@ services:
       haf-network:
     #healthcheck:
     #  test: ["CMD-SHELL","curl -f localhost:8080"]
-    # Only HAfAH is started by default
-    depends_on:
-    #   balance-tracker-postgrest:
-    #     condition: service_started
-    #   reputation-tracker-postgrest:
-    #     condition: service_started
-      hafah-postgrest:
-        condition: service_started
-    #   block-explorer-postgrest:
-    #     condition: service_started
-- 
GitLab