sync

Backup service to store encrypted wallet databases (experimental)
Log | Files | Refs | Submodules | README | LICENSE

commit 67d9eff0193a5ebc360a4200fa560d883177068f
parent e03d7255f55b517f174b1f0157a5d9e6c55f23ff
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon, 20 Jun 2022 22:09:35 +0200

fix debian package, in particular DB setup

Diffstat:
Mdebian/changelog | 6++++++
Mdebian/control | 25++++++++++++-------------
Mdebian/db/install/pgsql | 2+-
Ddebian/etc/sync/override.conf | 2--
Ddebian/etc/sync/secrets/sync-db.secret.conf | 3---
Mdebian/rules | 5+++++
Mdebian/sync-httpd.config | 1-
Mdebian/sync-httpd.install | 7+++++--
Mdebian/sync-httpd.postinst | 16++++++++++++++++
Mdebian/sync-httpd.postrm | 1+
Mdebian/sync-httpd.prerm | 4++++
11 files changed, 50 insertions(+), 22 deletions(-)

diff --git a/debian/changelog b/debian/changelog @@ -1,3 +1,9 @@ +sync (0.9.0) unstable; urgency=low + + * Updating to latest pre-release from Git. + + -- Christian Grothoff <grothoff@taler.net> Mon, 20 Jun 2022 13:12:58 +0200 + sync (0.8.3) unstable; urgency=medium * Initial Debian package. diff --git a/debian/control b/debian/control @@ -8,16 +8,14 @@ Build-Depends: autopoint, debhelper-compat (= 12), gettext, - libgnunet-dev, - libtalerexchange-dev (>= 0.8.5), - libtalermerchant-dev (>= 0.8.4), - libpq-dev (>=9.5), + libgnunet-dev (>=0.17.0), + libtalerexchange-dev (>= 0.9.0), + libtalermerchant-dev (>= 0.9.0), + libpq-dev (>=13.0), pkg-config, po-debconf, - zlib1g-dev -Build-Conflicts: - autoconf2.13, - automake1.4 + zlib1g-dev, + texinfo Standards-Version: 4.5.0 Vcs-Git: https://salsa.debian.org/debian/sync.git Vcs-browser: https://salsa.debian.org/debian/sync @@ -39,12 +37,13 @@ Architecture: any Pre-Depends: ${misc:Pre-Depends} Depends: - libtalerexchange (>= 0.8.4), - libtalermerchant (>= 0.8.3), + libtalerexchange (>= 0.9.0), + libtalermerchant (>= 0.9.0), libgnutls30 (>= 3.7.1), adduser, lsb-base, netbase, + sudo, apache2 | nginx | httpd, postgresql, dbconfig-pgsql | dbconfig-no-thanks, @@ -56,9 +55,9 @@ Package: libsync-dev Section: libdevel Architecture: any Depends: - libtalermerchant-dev (>= 0.8.3), - libtalerexchange-dev (>= 0.8.4), - libgnunet-dev (>=0.15.3), + libtalermerchant-dev (>= 0.9.0), + libtalerexchange-dev (>= 0.9.0), + libgnunet-dev (>=0.17.0), ${misc:Depends}, ${shlibs:Depends} Description: libraries to talk to a Sync provider (development) diff --git a/debian/db/install/pgsql b/debian/db/install/pgsql @@ -17,7 +17,7 @@ if [ -f /etc/dbconfig-common/sync-httpd.conf ]; then $conf_sync_db # Allow the taler-merchant-httpd user to create schemas, needed by dbinit - echo "GRANT CREATE on database \"$dbc_dbname\" to \"sync-httpd\";" | sudo -u postgres psql -f - + echo "GRANT CREATE ON DATABASE \"${dbc_dbname}\" TO \"sync-httpd\";" | sudo -u postgres psql -f - # Run database initialization logic sudo -u sync-httpd sync-dbinit -c /etc/sync/sync.conf ;; diff --git a/debian/etc/sync/override.conf b/debian/etc/sync/override.conf @@ -1,2 +0,0 @@ -# Do not edit by hand. -# This file is used by tooling to override configuration settings. diff --git a/debian/etc/sync/secrets/sync-db.secret.conf b/debian/etc/sync/secrets/sync-db.secret.conf @@ -1,3 +0,0 @@ -[syncdb-postgres] -#The connection string the plugin has to use for connecting to the database -CONFIG = postgres:///sync diff --git a/debian/rules b/debian/rules @@ -30,6 +30,11 @@ override_dh_auto_install-indep: override_dh_auto_clean: dh_auto_clean +override_dh_installsystemd: + dh_installsystemd -psync-httpd --name=sync-httpd --no-start --no-enable + # final invocation to generate daemon reload + dh_installsystemd + override_dh_install: dh_install # Done manually for debhelper-compat<13 diff --git a/debian/sync-httpd.config b/debian/sync-httpd.config @@ -10,7 +10,6 @@ _GROUPNAME=www-data # For now, we only support postgres dbc_dbtypes=pgsql dbc_dbuser=${_USERNAME} -dbc_dbname="sync" dbc_authmethod_user=ident dbc_authmethod_admin=ident diff --git a/debian/sync-httpd.install b/debian/sync-httpd.install @@ -3,7 +3,10 @@ usr/lib/*/libsyncdb.so.* usr/lib/*/sync/libsync_plugin*.* usr/share/sync/sql/* usr/share/sync/config.d/* -debian/etc/* /etc/ -debian/db/install/* usr/share/dbconfig-common/scripts/sync/install/ usr/share/man/man1/sync-dbinit.1 usr/share/man/man1/sync-httpd.1 + +debian/etc/* /etc/ + +# Files needed by dbconf +debian/db/install/* usr/share/dbconfig-common/scripts/sync-httpd/install/ diff --git a/debian/sync-httpd.postinst b/debian/sync-httpd.postinst @@ -2,6 +2,22 @@ set -e +if [ -d /run/systemd/system ]; then + systemctl --system daemon-reload >/dev/null || true +fi +if [ "$1" = "remove" ]; then + if [ -x "/usr/bin/deb-systemd-helper" ]; then + deb-systemd-helper mask 'sync-httpd.service' >/dev/null || true + fi +fi + +if [ "$1" = "purge" ]; then + if [ -x "/usr/bin/deb-systemd-helper" ]; then + deb-systemd-helper purge 'sync-httpd.service' >/dev/null || true + deb-systemd-helper unmask 'sync-httpd.service' >/dev/null || true + fi +fi + SYNC_HOME="/var/lib/sync/" _USERNAME=sync-httpd _GROUPNAME=www-data diff --git a/debian/sync-httpd.postrm b/debian/sync-httpd.postrm @@ -14,6 +14,7 @@ fi case "${1}" in purge) rm -rf /var/lib/sync/httpd/ + rm -f /etc/sync/override.conf ;; remove | upgrade | failed-upgrade | abort-install | abort-upgrade | disappear) ;; diff --git a/debian/sync-httpd.prerm b/debian/sync-httpd.prerm @@ -2,6 +2,10 @@ set -e +if [ -d /run/systemd/system ] && [ "$1" = remove ]; then + deb-systemd-invoke stop 'sync-httpd.service' >/dev/null || true +fi + if [ -f /usr/share/debconf/confmodule ]; then . /usr/share/debconf/confmodule fi