gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-deployment] branch master updated: log database on mounted volume


From: gnunet
Subject: [taler-deployment] branch master updated: log database on mounted volume
Date: Wed, 19 Oct 2022 15:50:26 +0200

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository deployment.

The following commit(s) were added to refs/heads/master by this push:
     new 4435abc  log database on mounted volume
4435abc is described below

commit 4435abcdec253ebfcd54219193a27eb7e395719d
Author: MS <ms@taler.net>
AuthorDate: Wed Oct 19 15:50:00 2022 +0200

    log database on mounted volume
---
 docker/hybrid/README                  | 42 ++++++++++++++++++++---------------
 docker/hybrid/docker-compose.yml      |  8 +++----
 docker/hybrid/images/postgres/init.sh | 11 +++++++--
 3 files changed, 37 insertions(+), 24 deletions(-)

diff --git a/docker/hybrid/README b/docker/hybrid/README
index 4326c33..8ec84e3 100644
--- a/docker/hybrid/README
+++ b/docker/hybrid/README
@@ -6,6 +6,7 @@ This setup orchestrates the following containers:
 1.  Banking (libEufin)
 2.  Shop(s)
 3.  Payment service provider (Taler exchange and helpers)
+4.  Database
 
 Note: one stratagem was however needed to make it work.
 The merchant container needs to redirect requests to
@@ -39,9 +40,30 @@ From this folder, run:
 How to run
 ==========
 
+Configuration
+-------------
+
 Export the env variable TALER_DEPLOYMENT_CONFIG to an
-absolute path of a host-specific configuration file.  See
-config/deployment.conf for an example.
+absolute path of a configuration file.  See config/deployment.conf
+for an example.
+
+Volumes
+-------
+
+The environment variable TALER_DEPLOYMENT_DATA controls
+where on the host's filesystem the services' data gets stored.
+It defaults to ~/taler-data, and contains exchange, libeufin,
+and postgresql data.
+
+The environment variable TALER_DEPLOYMENT_LOGS controls
+where on the host's filesystem the logs get stored.  It defaults
+to ~/taler-logs, and contains exchange, libeufin, and postgresql
+data.  NOTE: Postgres needs permissions to write in
+TALER_DEPLOYMENT_LOGS because it runs as the 'postgres' user
+(uid=999).
+
+Run
+---
 
 From this folder, run:
   $ docker-compose up --remove-orphans --abort-on-container-exit
@@ -103,19 +125,3 @@ Nginx configuration example deploys this sandbox under
       proxy_pass http://localhost:15000/;
     }
   }
-
-Below is an example of a global configuration that
-sets the currency for the entire sandbox.  Its file's
-path must be then exported via the TALER_DEPLOYMENT_CONFIG
-env variable (see "How to run" section above).
-
-  [taler-deployment]
-  currency = EUR
-
-How to persist data on the host
-===============================
-
-The environment variable TALER_DEPLOYMENT_DATA controls
-where on the host's filesystem the services' data gets stored.
-It defaults to ~/taler-data, and contains exchange, libeufin,
-and postgresql data.
diff --git a/docker/hybrid/docker-compose.yml b/docker/hybrid/docker-compose.yml
index f85c0a5..b29cab8 100644
--- a/docker/hybrid/docker-compose.yml
+++ b/docker/hybrid/docker-compose.yml
@@ -1,12 +1,12 @@
 version: '3' # it's a constant
 
 services:
-
   talerdb:
     build: ./images/postgres
     ports:
       - 8888:5432
     volumes:
+      - ${TALER_DEPLOYMENT_LOGS:-~/taler-logs}:/logs
       - 
${TALER_DEPLOYMENT_DATA:-~/taler-data}/postgresql:/var/lib/postgresql/data
       - ${TALER_DEPLOYMENT_CONFIG:?Please export 
TALER_DEPLOYMENT_CONFIG}:/config/deployment.conf
     environment:
@@ -21,9 +21,9 @@ services:
     ports:
       - 5555:80
     volumes:
-      - ${TALER_DEPLOYMENT_CONFIG:?Please export 
TALER_DEPLOYMENT_CONFIG}:/config/deployment.conf
-      - ${TALER_DEPLOYMENT_DATA:-~/taler-data}/exchange:/data
       - ${TALER_DEPLOYMENT_LOGS:-~/taler-logs}:/logs
+      - ${TALER_DEPLOYMENT_DATA:-~/taler-data}/exchange:/data
+      - ${TALER_DEPLOYMENT_CONFIG:?Please export 
TALER_DEPLOYMENT_CONFIG}:/config/deployment.conf
 
   merchant:
     build: ./images/merchant
@@ -33,8 +33,8 @@ services:
       - 5556:80
       - 5559:8080 # Blog TBD.
     volumes:
-      - ${TALER_DEPLOYMENT_CONFIG:?Please export 
TALER_DEPLOYMENT_CONFIG}:/config/deployment.conf
       - ${TALER_DEPLOYMENT_LOGS:-~/taler-logs}:/logs
+      - ${TALER_DEPLOYMENT_CONFIG:?Please export 
TALER_DEPLOYMENT_CONFIG}:/config/deployment.conf
 
   bank:
     build: ./images/libeufin
diff --git a/docker/hybrid/images/postgres/init.sh 
b/docker/hybrid/images/postgres/init.sh
index faf93df..cc28f0d 100644
--- a/docker/hybrid/images/postgres/init.sh
+++ b/docker/hybrid/images/postgres/init.sh
@@ -2,7 +2,14 @@
 
 set -eu
 
-# Fixme: use taler-config.
-CUSTOM_PASSWORD=$(grep db-password < /config/deployment.conf | awk -F= '{print 
$2}' | tr -d "[:space:]")
+# FIXME: use taler-config.
+CUSTOM_PASSWORD=$(grep ^db-password < /config/deployment.conf | awk -F= 
'{print $2}' | tr -d "[:space:]")
+if test -z "${CUSTOM_PASSWORD}"; then
+  echo ERROR: database password empty.
+fi
 echo "ALTER ROLE root WITH PASSWORD '"${CUSTOM_PASSWORD}"';" | psql -U root
 createdb -U root -O root taler
+echo "ALTER SYSTEM SET logging_collector TO 'true';" | psql -U root
+echo "ALTER SYSTEM SET log_directory TO '/logs';" | psql -U root
+echo "ALTER SYSTEM SET log_filename TO 'postgres-%Y-%m-%d';" | psql -U root
+pg_ctl restart

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]