From af89962a64394dd1317261cc1f9167007ae4b519 Mon Sep 17 00:00:00 2001
From: Dan Notestein <dan@syncad.com>
Date: Fri, 14 Mar 2025 21:56:08 +0000
Subject: [PATCH 1/2] Only log tempfiles over 200B to avoid log spam

---
 logging.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/logging.conf b/logging.conf
index 8e8a412..64e8863 100644
--- a/logging.conf
+++ b/logging.conf
@@ -6,7 +6,7 @@ log_checkpoints = on
 log_connections = on
 log_disconnections = on
 log_lock_waits = on
-log_temp_files = 0
+log_temp_files = 200
 log_autovacuum_min_duration = 0
 log_error_verbosity = default
 log_filename = 'postgresql.log'
-- 
GitLab


From 046c2adeb81f0e580e367aebc57b8525f68117c5 Mon Sep 17 00:00:00 2001
From: Dan Notestein <dan@syncad.com>
Date: Fri, 14 Mar 2025 18:36:35 -0400
Subject: [PATCH 2/2] Make hivemind's PostgREST server use the hivemind_user
 role instead of the hivemind role.  We set the statement timeout on the
 hivemind_user role, so this is needed to make the HIVEMIND_STATEMENT_TIMEOUT
 in the .env file work

---
 haf_base.yaml | 1 +
 hivemind.yaml | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/haf_base.yaml b/haf_base.yaml
index fb5c18e..5656a0f 100644
--- a/haf_base.yaml
+++ b/haf_base.yaml
@@ -58,6 +58,7 @@ services:
         host    haf_block_log    haf_admin        ${COMPOSE_PROJECT_NAME}-hivemind-server-1.${NETWORK_NAME}                     trust\n
         host    haf_block_log    hivemind         ${COMPOSE_PROJECT_NAME}-hivemind-server-1.${NETWORK_NAME}                     trust\n
         host    haf_block_log    hivemind         ${COMPOSE_PROJECT_NAME}-hivemind-postgrest-server-1.${NETWORK_NAME}           trust\n
+        host    haf_block_log    hivemind_user    ${COMPOSE_PROJECT_NAME}-hivemind-postgrest-server-1.${NETWORK_NAME}           trust\n
 
         host    haf_block_log    haf_admin        ${COMPOSE_PROJECT_NAME}-hivemind-uninstall-1.${NETWORK_NAME}                  trust\n
 
diff --git a/hivemind.yaml b/hivemind.yaml
index 655e0ac..03f5aa1 100644
--- a/hivemind.yaml
+++ b/hivemind.yaml
@@ -77,10 +77,10 @@ services:
     environment:
       PGRST_ADMIN_SERVER_PORT: 3001
       PGRST_SERVER_PORT: 8080
-      PGRST_DB_URI: "postgresql://hivemind@haf/haf_block_log?application_name=hive-mind-postgrest" # warning hivemind improperly matches all connections starting from `hivemind` and crashes if they are made externally (not from python)
+      PGRST_DB_URI: "postgresql://hivemind_user@haf/haf_block_log?application_name=hive-mind-postgrest" # warning hivemind improperly matches all connections starting from `hivemind` and crashes if they are made externally (not from python)
       PGRST_DB_SCHEMA: hivemind_endpoints
       # PGRST_DB_ROOT_SPEC: home
-      PGRST_DB_ANON_ROLE: hivemind
+      PGRST_DB_ANON_ROLE: hivemind_user
       PGRST_DB_POOL: 40
       PGRST_DB_POOL_ACQUISITION_TIMEOUT: 10
       PGRST_OPENAPI_MODE: "disabled" # unclear why this is set, I guess because we currently only support json-rpc?
-- 
GitLab