gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated: improve logging in anastasis po


From: gnunet
Subject: [taler-anastasis] branch master updated: improve logging in anastasis postinst script
Date: Thu, 01 Jul 2021 22:06:46 +0200

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

grothoff pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new cbad720  improve logging in anastasis postinst script
cbad720 is described below

commit cbad720826c3402b3c738cf20b14ae54351cf003
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Thu Jul 1 22:06:43 2021 +0200

    improve logging in anastasis postinst script
---
 debian/anastasis-httpd.postinst                    | 127 +++++++++++----------
 .../authorization-email-messages.json              |   2 +-
 2 files changed, 68 insertions(+), 61 deletions(-)

diff --git a/debian/anastasis-httpd.postinst b/debian/anastasis-httpd.postinst
index 4e60a19..01cb190 100644
--- a/debian/anastasis-httpd.postinst
+++ b/debian/anastasis-httpd.postinst
@@ -10,89 +10,93 @@ dbc_dbfile_perms="0600"
 
 # 1st argument will be the SECURITYTOKEN to use.
 apache_install() {
-       mkdir -p /etc/apache2/conf-available
+    echo -n "Starting Apache setup..."
+    mkdir -p /etc/apache2/conf-available
     if [ ! -f /etc/apache2/conf-available/anastasis.conf ];
     then
-           cat /etc/anastasis/apache.conf | sed -e "s/%SECURITYTOKEN%/$1/" > 
/etc/apache2/conf-available/anastasis.conf
+       echo -n "..."
+       cat /etc/anastasis/apache.conf | sed -e "s/%SECURITYTOKEN%/$1/" > 
/etc/apache2/conf-available/anastasis.conf
     fi
+    echo "Done"
 }
 
 # 1st argument will be the SECURITYTOKEN to use.
 nginx_install() {
-       mkdir -p /etc/nginx/conf-available
+    echo -n "Starting Nginx setup..."
+    mkdir -p /etc/nginx/conf-available
     if [ ! -f /etc/nginx/conf-available/anastasis.conf ];
     then
-           cat /etc/anastasis/nginx.conf | sed -e "s/%SECURITYTOKEN%/$1/" > 
/etc/nginx/conf-available/anastasis.conf
+       echo -n "..."
+       cat /etc/anastasis/nginx.conf | sed -e "s/%SECURITYTOKEN%/$1/" > 
/etc/nginx/conf-available/anastasis.conf
     fi
+    echo "Done"
 }
 
 . /usr/share/debconf/confmodule
 
 
 case "${1}" in
-       configure)
-               db_version 2.0
-
-               db_get anastasis/username
-               _USERNAME="${RET:-anastasis-httpd}"
-
-               db_get anastasis/groupname
-               _GROUPNAME="${RET:-www-data}"
-
-               # Read default values
-               CONFIG_FILE="/etc/default/anastasis"
-               TALER_HOME="/var/lib/anastasis"
-
-        # Creating taler group if needed
-               if ! getent group ${_GROUPNAME} > /dev/null
-               then
-                       echo -n "Creating new Taler group ${_GROUPNAME}:"
-                       addgroup --quiet --system ${_GROUPNAME}
-                       echo " done."
-               fi
-               # Creating taler users if needed
-               if ! getent passwd ${_USERNAME} > /dev/null
-               then
-                       echo -n "Creating new Taler user ${_USERNAME}:"
-                       adduser --quiet --system --ingroup ${_GROUPNAME} --home 
${TALER_HOME}/httpd ${_USERNAME}
-                       echo " done."
-               fi
-
-
-        # Setup postgres database (needs dbconfig-pgsql package)
-        if [ -f /usr/share/dbconfig-common/dpkg/postinst.pgsql ]; then
-            . /usr/share/dbconfig-common/dpkg/postinst.pgsql
-            dbc_pgsql_createdb_encoding="UTF8"
-            dbc_go anastasis "$@"
-        fi
-
-        chown ${_USERNAME}:postgres /etc/anastasis.conf
-        chmod 460 /etc/anastasis.conf
-
-
-        # Create access secret
-        SECRET=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1`
-        echo SECRET > ${TALER_HOME}/master-api-key.txt
-        chown ${_USERNAME}:${_GROUPNAME} ${TALER_HOME}/master-api-key.txt
-        chmod 440 ${TALER_HOME}/master-api-key.txt
-
-        # Writing new values to configuration file
-        echo -n "Writing new configuration file:"
-        CONFIG_NEW=$(tempfile)
+    configure)
+       echo "Configuring package..."
+       db_version 2.0
+       
+       db_get anastasis/username
+       _USERNAME="${RET:-anastasis-httpd}"
+
+       db_get anastasis/groupname
+       _GROUPNAME="${RET:-www-data}"
+
+       # Read default values
+       CONFIG_FILE="/etc/default/anastasis"
+       TALER_HOME="/var/lib/anastasis"
+
+       echo "  Group setup"
+       # Creating anastasis group if needed
+       if ! getent group ${_GROUPNAME} > /dev/null
+       then
+           echo -n "    Creating new Anastasis group ${_GROUPNAME}:"
+           addgroup --quiet --system ${_GROUPNAME}
+           echo " done."
+       fi
+       echo "  User setup"
+       # Creating taler users if needed
+       if ! getent passwd ${_USERNAME} > /dev/null
+       then
+           echo -n "    Creating new Taler user ${_USERNAME}:"
+           adduser --quiet --system --ingroup ${_GROUPNAME} --home 
${TALER_HOME}/httpd ${_USERNAME}
+           echo " done."
+       fi
+
+       echo "  Setting up postgres database"
+       # Setup postgres database (needs dbconfig-pgsql package)
+       if [ -f /usr/share/dbconfig-common/dpkg/postinst.pgsql ];
+       then
+           . /usr/share/dbconfig-common/dpkg/postinst.pgsql
+           dbc_pgsql_createdb_encoding="UTF8"
+           dbc_go anastasis "$@"
+       fi
+
+       echo "  Setting rights on /etc/anastasis.conf"
+       chown ${_USERNAME}:postgres /etc/anastasis.conf
+       chmod 460 /etc/anastasis.conf
+
+       # Writing new values to configuration file
+       echo -n "  Writing new configuration file:"
+       CONFIG_NEW=$(tempfile)
 
 cat > "${CONFIG_NEW}" <<EOF
-# This file controls the behaviour of the Taler init script.
+# This file controls the behaviour of the Anastasis init script.
 # It will be parsed as a shell script.
 # please do not edit by hand, use 'dpkg-reconfigure anastasis'.
 
-TALER_USER=${_USERNAME}
-TALER_GROUP=${_GROUPNAME}
+ANASTASIS_USER=${_USERNAME}
+ANASTASIS_GROUP=${_GROUPNAME}
 EOF
 
 
 cat > "/etc/systemd/system/anastasis-httpd.service" <<EOF
 [Unit]
-Description=GNU Taler payment system merchant backend
+Description=Anastasis key recovery backend
 
 [Service]
 EnvironmentFile=/etc/default/anastasis
@@ -102,12 +106,13 @@ Restart=on-failure
 ExecStart=/usr/bin/anastasis-httpd -c /etc/anastasis.conf
 EOF
 
-        systemctl daemon-reload >/dev/null 2>&1 || true
+                systemctl daemon-reload >/dev/null 2>&1 || true
 
-        cp -f "${CONFIG_NEW}" "${CONFIG_FILE}"
-           echo " done."
+               cp -f "${CONFIG_NEW}" "${CONFIG_FILE}"
+               echo " done."
 
                # Configure Webserver
+               echo "  Configuring Webserver"
                db_get anastasis/reconfigure-webserver
                webservers="$RET"
                for webserver in $webservers; do
@@ -118,6 +123,8 @@ EOF
                                apache_install "$SECRET"
                        fi
                done
+               echo "Done."
+               
                db_stop
 
                # Cleaning
diff --git a/src/authorization/authorization-email-messages.json 
b/src/authorization/authorization-email-messages.json
index ef3ecdb..56f648c 100644
--- a/src/authorization/authorization-email-messages.json
+++ b/src/authorization/authorization-email-messages.json
@@ -1,5 +1,5 @@
 {
-    "instructions" : "Recovery TAN send to email %.*s@DOMAIN",
+    "instructions" : "Recovery TAN was sent to email %.*s@DOMAIN",
     "instructions_i18n" : {
         "de_DE" : "Ein Authorisierungscode wurde an %.*s@DOMAIN geschickt"
     },

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