gnunet-svn
[Top][All Lists]
Advanced

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

[taler-deployment] branch master updated: Created config files + Created


From: gnunet
Subject: [taler-deployment] branch master updated: Created config files + Created exchange/merchant sub-scripts
Date: Fri, 03 Mar 2023 19:13:47 +0100

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

javier-sepulveda pushed a commit to branch master
in repository deployment.

The following commit(s) were added to refs/heads/master by this push:
     new a069b85  Created config files + Created exchange/merchant sub-scripts
a069b85 is described below

commit a069b85f53847e4decf65c24370f067524e15ac3
Author: Javier Sepulveda <javier.sepulveda@uv.es>
AuthorDate: Fri Mar 3 19:12:05 2023 +0100

    Created config files + Created exchange/merchant sub-scripts
---
 netzbon/config/taler-internal.conf |  0
 netzbon/config/taler.conf          |  3 +++
 netzbon/functions.sh               | 34 ++++++++++++++++++++++++++++--
 netzbon/main.sh                    | 43 +++++++++++++++++++++++++++++---------
 netzbon/setup-exchange.sh          | 28 +++++++++++++++++++++++++
 netzbon/setup-merchant.sh          |  8 +++++++
 6 files changed, 104 insertions(+), 12 deletions(-)

diff --git a/netzbon/config/taler-internal.conf 
b/netzbon/config/taler-internal.conf
new file mode 100644
index 0000000..e69de29
diff --git a/netzbon/config/taler.conf b/netzbon/config/taler.conf
new file mode 100644
index 0000000..d69e8da
--- /dev/null
+++ b/netzbon/config/taler.conf
@@ -0,0 +1,3 @@
+DB_NAME="pgsql"
+ROLE_NAME="postgres"
+DATABASE_CONNECTION="jdbc:postgresql://localhost:5432/$DB_NAME?user=$ROLE_NAME"
diff --git a/netzbon/functions.sh b/netzbon/functions.sh
index d4e31a8..51365f5 100644
--- a/netzbon/functions.sh
+++ b/netzbon/functions.sh
@@ -8,8 +8,7 @@ function say()
 }
 
 
-# Check user
-
+# Check user if the user is root
 
 function check_user()
 {
@@ -18,5 +17,36 @@ function check_user()
         say "Please run this script as root"
         exit 1
     fi
+}
+
+# Create users "exchange" and "merchant"
+
+function create_users()
+{
+    for n in exchange merchant
+    do 
+       # In case users already exists, remove it
+       deluser $n || true
+       rm -rf /home/$n
+       adduser --disabled-password $n
+    done
+}
 
+# Assign group and permissions to users
+
+function assign_user_permissions()
+{
+    for n in exchange merchant
+    do 
+       adduser www-data $n
+       mkdir -p /home/$n/.config/
+       # FIXME
+       # cp -r $n/* /home/$n/
+       # TODO: No taler.conf is provided
+       # mv /home/$n/taler.conf /home/$n/.config/taler.conf
+       chmod 600 /home/$n/.config/taler.conf
+       chown -R $n:$n /home/$n/
+       su - postgres -c "createuser $n"
+       su - postgres -c "createdb -O $n taler-$n"
+    done
 }
diff --git a/netzbon/main.sh b/netzbon/main.sh
index e126fb8..ddc7004 100755
--- a/netzbon/main.sh
+++ b/netzbon/main.sh
@@ -2,13 +2,18 @@
 # This file is in the public domain.
 
 # main.sh is the main script that asks the questions and
-# puts the answers in environment variables in "deployment.conf" file
-# Nginx configuration - Reads values directly from "deployment.conf" file.
+# puts the answers into environment variables located at  
"config/taler-internal.conf or config/taler.conf" files
+# Nginx configuration - Reads values directly from these "config files".
 
 set -eu
 
+# include functions source file
+
 source functions.sh
 
+# include variables config/taler.conf
+source config/taler.conf
+
 # Check if the user is root, otherwise EXIT.
 
 check_user
@@ -31,20 +36,26 @@ SANDBOX_EXCHANGE_PASSWORD=`uuidgen`
 
 read -s -p "Enter the password for the Webui backend: " WEB_INTERFACE_PASSWORD
 
-# Database default values
-
-DB_NAME="pgsql"
-ROLE_NAME="postgres"
-DATABASE_CONNECTION="jdbc:postgresql://localhost:5432/$DB_NAME?user=$ROLE_NAME"
-
 # END USER INTERACTION
 
-# START INSTALLATION
+# Put variables into taler-internal.conf
+echo "SANDBOX_ADMIN_PASSWORD=${SANDBOX_ADMIN_PASSWORD}" > 
config/taler-internal.conf
+echo "CURRENCY=${CURRENCY}" >> config/taler-internal.conf
+echo "WEB_INTERFACE_PASSWORD=${WEB_INTERFACE_PASSWORD}" >> 
config/taler-internal.conf
+echo "NEXUS_EXCHANGE_PASSWORD}=${NEXUS_EXCHANGE_PASSWORD}" >> 
config/taler-internal.conf
+echo "SANDBOX_EXCHANGE_PASSWORD=${SANDBOX_EXCHANGE_PASSWORD}" >> 
config/taler-internal.conf
 
-. config_launch_libeufin.sh
+# ENABLE MERCHANT & EXCHANGE
+create_users
+assign_user_permissions
+. setup-exchange.sh
+. setup-merchant.sh
 
 # ENABLE LIBEUFIN
 
+# Please take into account if something fails in this section, the NGINX 
configuration won't be created.
+# Recall all the scripts have the set -eu header.
+
 . config_launch_libeufin.sh
 
 systemctl enable --now libeufin-sandbox 
@@ -65,6 +76,18 @@ ln -s ${SITES_AVAILABLE_DIR}/taler-exchange 
${SITES_ENABLED_DIR}/taler-exchange.
 
 systemctl reload nginx
 
+# Get SSL certificate for https - Certbot ???
+
+# letsencrypt certonly -d
+
+# taler.ti.bfh.ch
+# bank.chf.taler.net
+# exchange.chf.taler.net
+# backend.chf.taler.net
+# auditor.chf.taler.net
+
+# Final message to the user
+
 echo "Congratulations, you have successfully installed GNU Taler"
 echo "Please check your browser now at http://localhost:80";
 
diff --git a/netzbon/setup-exchange.sh b/netzbon/setup-exchange.sh
new file mode 100644
index 0000000..e3f851d
--- /dev/null
+++ b/netzbon/setup-exchange.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# Create master key
+
+su -c "mkdir -p ~/.local/share/taler/exchange/offline-keys" exchange
+su -c "gnunet-ecc -g1 ~/.local/share/taler/exchange/offline-keys/master.priv" 
exchange
+
+# Modify config/taler.conf
+
+# Then, modify the MASTER_PUBLIC_KEY option in taler.conf to contain
+# the public key. You can see the value to add using:
+
+su -c "gnunet-ecc -p ~/.local/share/taler/exchange/offline-keys/master.priv" 
exchange > MASTER_PUBLIC_KEY
+echo ${MASTER_PUBLIC_KEY} >> config/taler-internal.conf
+
+# Set a password for the exchange account at the bank
+
+# Next, set a password for the Exchange account at the bank, using
+# the 'bank' user:
+
+read -p "Exchange account bank password: " EXCHANGE_PASSWORD
+echo ${EXCHANGE_PASSWORD} >> config/taler-internal.conf
+
+# Now setup the wire responses, database and online signing keys:
+
+# taler-exchange-wire
+# taler-exchange-dbinit
+# taler-exchange-keyup -o auditor.in
diff --git a/netzbon/setup-merchant.sh b/netzbon/setup-merchant.sh
new file mode 100644
index 0000000..28f0889
--- /dev/null
+++ b/netzbon/setup-merchant.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+# To initialize the merchant, simply run
+
+taler-merchant-dbinit
+
+# and possibly adjust the configuration in
+# ~/.config/taler.conf

-- 
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]