modify setup to not do DB, cannot be fully done anyway

This commit is contained in:
Christian Grothoff 2021-01-01 22:12:59 +01:00
parent e4dc1ecc5d
commit fbc0542e0c
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
12 changed files with 59 additions and 114 deletions

2
debian/control vendored
View File

@ -65,7 +65,7 @@ Section: libdevel
Architecture: any
Depends:
libtalerexchange (= ${binary:Version}),
libgnunet-dev (>=1:0.14.0),
libgnunet-dev (>=0.14.0),
libgcrypt20-dev (>=1.6),
libmicrohttpd-dev (>=0.9.33),
${misc:Depends}

View File

@ -1,2 +0,0 @@
#!/bin/sh
taler-exchange-dbinit -c /etc/taler.conf

View File

@ -1,2 +0,0 @@
#!/bin/sh
taler-exchange-dbinit -c /etc/taler.conf

View File

@ -1,3 +0,0 @@
[taler-exchangdb-postgres]
CONFIG = postgres:///taler-exchange

View File

@ -1,5 +1,3 @@
@INLINE@ /etc/taler-exchange-db.conf
[PATHS]
# Move runtime data "tmp" directory to /var/lib/taler-exchange/

View File

@ -1 +0,0 @@
@INLINE@ /etc/taler-exchange-db.conf

View File

@ -1,12 +1,22 @@
taler-exchange
--------------
Note that the configuration installed in /etc/taler.conf is incomplete and
that Debian cannot launch an exchange with this minimal template. You must
setup the currency, denominations and bank account access details before
launching the Taler exchange can possibly succeed.
Note that the configuration is incomplete, and that Debian cannot launch an
exchange with this minimal template. You must:
In order to start, stop or restart manually the server, use:
* Configure the Postgres database for the exchange, ideally including
remote replication of the database to the auditor.
* Run taler-exchange-dbinit (also after package upgrades).
* Edit /etc/taler-exchange.conf to must setup the currency and denominations
details.
* Edit /etc/taler-wire.conf to provide details about the bank account access.
None of these are done by the Debian package because we cannot provide the
required complete configuration details.
Once you have done this, you can use the following commands to start, stop or
restart the Taler exchange:
# systemctl start taler-exchange
# systemctl stop taler-exchange
@ -16,7 +26,5 @@ To permanently the exchange whenever the system boots, use:
# systemctl enable taler-exchange
None of these are done by the Debian package because we cannot provide the
required complete configuration details.
-- Christian Grothoff <grothoff@gnu.org> Mon 28 Dec 2020 11:37:14 AM CET

View File

@ -22,10 +22,4 @@ db_go
db_input low taler-exchange/groupname || true
db_go
if [ -f /usr/share/dbconfig-common/dpkg/config.pgsql ]; then
. /usr/share/dbconfig-common/dpkg/config.pgsql
dbc_go taler-exchange "$@"
fi
db_stop

View File

@ -1,6 +1,4 @@
usr/bin/
usr/lib/*/taler/*.so
debian/etc/* etc/
debian/db/install/* usr/share/dbconfig-common/scripts/taler-exchange/install/
debian/db/upgrade/* usr/share/dbconfig-common/scripts/taler-exchange/upgrade/
debian/conf/* etc/taler-exchange/

View File

@ -55,13 +55,19 @@ case "${1}" in
CONFIG_FILE="/etc/default/taler-exchange"
TALER_HOME="/var/lib/taler-exchange"
# Creating taler group if needed
# Creating taler groups as needed
if ! getent group ${_GROUPNAME} > /dev/null
then
echo -n "Creating new Taler group ${_GROUPNAME}:"
addgroup --quiet --system ${_GROUPNAME}
echo " done."
fi
if ! getent group ${_DBGROUPNAME} > /dev/null
then
echo -n "Creating new Taler group ${_DBGROUPNAME}:"
addgroup --quiet --system ${_DBGROUPNAME}
echo " done."
fi
# Creating taler users if needed
if ! getent passwd ${_EUSERNAME} > /dev/null
@ -87,14 +93,14 @@ case "${1}" in
then
echo -n "Creating new Taler user ${_WIREUSERNAME}:"
adduser --quiet --system --home ${TALER_HOME}/wire ${_WIREUSERNAME}
adduser ${_WIREUSERNAME} ${_DBGROUPNAME}
adduser --quiet ${_WIREUSERNAME} ${_DBGROUPNAME}
echo " done."
fi
if ! getent passwd ${_AGGRUSERNAME} > /dev/null
then
echo -n "Creating new Taler user ${_AGGRUSERNAME}:"
adduser --quiet --system --home ${TALER_HOME}/aggregator ${_AGGRUSERNAME}
adduser ${_AGGRUSERNAME} ${_DBGROUPNAME}
adduser --quiet ${_AGGRUSERNAME} ${_DBGROUPNAME}
echo " done."
fi
@ -194,58 +200,26 @@ Restart=on-failure
ExecStart=/usr/bin/taler-exchange-aggregator -c /etc/taler.conf
EOF
systemctl daemon-reload
cp -f "${CONFIG_NEW}" "${CONFIG_FILE}"
rm -f "${CONFIG_NEW}"
echo " done."
echo -n "Setting up system services "
mkdir -p /var/lib/taler-exchange/tmp
chown root:taler /var/lib/taler-exchange/tmp
chown root:${_GROUPNAME} /var/lib/taler-exchange/tmp
chmod 770 /var/lib/taler-exchange/tmp
chmod +s /var/lib/taler-exchange/tmp
# 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_dbfile_* should not apply for Postgres, but better be safe...
dbc_dbfile_owner="${_EUSERNAME}:${_DBGROUPNAME}"
dbc_dbfile_perms="0660"
dbc_pgsql_createdb_encoding="UTF8"
dbc_go taler-exchange "$@"
fi
# get database settings from dbconfig-common
if [ -f /etc/dbconfig-common/taler-exchange.conf ]; then
. /etc/dbconfig-common/taler-exchange.conf
case "$dbc_dbtype" in
pgsql)
taler-config -c /etc/taler-exchange-db.conf \
-s "exchangedb-postgres" \
-o "CONFIG" \
-V "postgres://$dbc_dbuser:$dbc_dbpass@$dbc_dbserver/$dbc_dbname"
taler-config -c /etc/taler-exchange-db.conf \
-s "exchange" \
-o "DB" \
-V "postgres"
chown ${_EUSERNAME}:${_DBGROUPNAME} /etc/taler-exchange-db.conf
chmod 440 /etc/taler-exchange-db.conf
;;
"")
;;
*)
echo "Unsupported database type $dbc_type."
exit 1
;;
esac
fi
systemctl daemon-reload
echo "done."
# Cleaning
rm -f "${CONFIG_NEW}"
echo "All done."
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)

View File

@ -29,61 +29,47 @@ nginx_remove() {
fi
}
if [ -f /usr/share/dbconfig-common/dpkg/postrm.pgsql ]; then
. /usr/share/dbconfig-common/dpkg/postrm.pgsql
dbc_go taler-exchange "$@"
if [ -f /usr/share/debconf/confmodule ];
then
. /usr/share/debconf/confmodule
fi
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
if [ -f /usr/share/debconf/confmodule ]; then
db_version 2.0
db_get taler-exchange/reconfigure-webserver
webservers="$RET"
for webserver in $webservers; do
webserver=${webserver%,}
if [ "$webserver" = "nginx" ] ; then
nginx_remove
else
apache_remove
fi
done
fi
db_version 2.0
db_get taler-exchange/reconfigure-webserver
webservers="$RET"
for webserver in $webservers; do
webserver=${webserver%,}
if [ "$webserver" = "nginx" ] ; then
nginx_remove
else
apache_remove
fi
done
fi
case "${1}" in
purge)
if [ -e /usr/share/debconf/confmodule ]
then
. /usr/share/debconf/confmodule
db_version 2.0
db_version 2.0
db_get taler-exchange/eusername
_EUSERNAME="${RET:-taler-exchange-httpd}"
db_get taler-exchange/eusername
_EUSERNAME="${RET:-taler-exchange-httpd}"
db_get taler-exchange/rsecusername
_RSECUSERNAME="${RET:-taler-exchange-helper-rsa}"
db_get taler-exchange/rsecusername
_RSECUSERNAME="${RET:-taler-exchange-helper-rsa}"
db_get taler-exchange/esecusername
_ESECUSERNAME="${RET:-taler-exchange-helper-eddsa}"
db_get taler-exchange/esecusername
_ESECUSERNAME="${RET:-taler-exchange-helper-eddsa}"
db_get taler-exchange/wireusername
_WIREUSERNAME="${RET:-taler-exchange-wire}"
db_get taler-exchange/wireusername
_WIREUSERNAME="${RET:-taler-exchange-wire}"
db_get taler-exchange/aggrusername
_AGGRUSERNAME="${RET:-taler-exchange-aggregator}"
db_get taler-exchange/aggrusername
_AGGRUSERNAME="${RET:-taler-exchange-aggregator}"
db_get taler-exchange/groupname
_GROUPNAME="${RET:-taler-private}"
else
_EUSERNAME="taler-exchange-httpd"
_RSECUSERNAME="taler-exchange-helper-rsa"
_ESECUSERNAME="taler-exchange-helper-eddsa"
_WIREUSERNAME="taler-exchange-wire"
_AGGRUSERNAME="taler-exchange-aggregator"
_GROUPNAME="taler-private"
fi
db_get taler-exchange/groupname
_GROUPNAME="${RET:-taler-private}"
if pathfind deluser
then

View File

@ -8,10 +8,5 @@ if [ -f /usr/share/debconf/confmodule ]; then
fi
. /usr/share/dbconfig-common/dpkg/prerm
if [ -f /usr/share/dbconfig-common/dpkg/prerm.pgsql ]; then
. /usr/share/dbconfig-common/dpkg/prerm.pgsql
dbc_go taler-exchange "$@"
fi
db_stop
exit 0