sync

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

commit c4d9a5be2d7a22f6d925457b012e7597c42a0aad
parent e838c2881998fe7dd9b186b5fa06af433541bc32
Author: Iván Ávalos <avalos@disroot.org>
Date:   Sat,  8 Aug 2026 03:19:47 +0200

cleanup: obsolete files, scripts, etc.

Diffstat:
M.gitignore | 49++++---------------------------------------------
M.gitmodules | 2+-
Mconfigure | 2+-
Mcontrib/bump | 14+++++++-------
Mcontrib/ci/Containerfile | 2+-
Mdebian/.gitignore | 1-
Mdebian/etc/apache2/sites-available/sync.conf | 2+-
Mdebian/etc/sync/sync.conf | 7++-----
Mdebian/rules | 1+
Mdebian/sync-httpd.postinst | 3+++
Mdebian/sync-httpd.prerm | 1+
Adebian/sync-httpd2.service | 31+++++++++++++++++++++++++++++++
Adebian/sync-httpd2.socket | 13+++++++++++++
Mdoc/doxygen/sync.doxy | 2+-
Mflake.nix | 5++---
Mmeson.build | 4++--
Mmeson.options | 2+-
Msrc/sync/sync-httpd2.c | 4++--
Msrc/sync/sync-httpd2_config.c | 1-
Msrc/sync/sync.conf | 6+++---
20 files changed, 77 insertions(+), 75 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -1,60 +1,19 @@ *~ *.log -*.trs *.a *.o *.orig *.rej -.deps/ -.libs/ +*.swp .version Makefile -aclocal.m4 -autom4te.cache/ -compile -config.cache -config.guess -config.log config.status -config.sub -contrib/uncrustify.sh -depcomp -doc/Makefile -install-sh -libtool -ltmain.sh -missing -src/Makefile -src/Makefile.in -src/util/.deps/ -src/util/.libs/ -src/backend/Makefile -src/backend/Makefile.in -src/include/Makefile -src/include/Makefile.in -src/lib/.deps/ -src/lib/Makefile -src/lib/Makefile.in -stamp-h1 -test-driver +build/ +compile_commands.json uncrustify.cfg -doc/Makefile.in -m4/libtool.m4 -m4/ltoptions.m4 -m4/ltsugar.m4 -m4/ltversion.m4 -m4/lt~obsolete.m4 -*.swp -src/lib/.libs -*.lo -*.o -*.la -src/util/.deps/ -doc/Makefile.in -src/include/Makefile.in sync_config.h sync_config.h.in src/sync/sync-httpd +src/sync/sync-httpd2 src/testing/test_sync_api_home/.local/share/taler/auditors/ src/testing/test_sync_api_home/.local/share/taler/exchange-secmod-cs/ -compile_commands.json diff --git a/.gitmodules b/.gitmodules @@ -1,4 +1,4 @@ [submodule "doc/prebuilt"] path = doc/prebuilt - url = git://git.taler.net/taler-docs.git + url = ../taler-docs.git branch = prebuilt diff --git a/configure b/configure @@ -1,7 +1,7 @@ #!/bin/sh pkg_name="sync" -pkg_default_features="" +pkg_default_features="doc" pkg_optional_features="coverage logging only-doc install-rpath" pkg_optional_dependencies="" diff --git a/contrib/bump b/contrib/bump @@ -21,16 +21,16 @@ function updated { fi } -# update configure.ac -function configure_ac { - if [[ $(grep AC_INIT configure.ac | grep "${VERSION}") ]]; +# update .version (source of the version for get_version.sh) +function version_file { + if [[ -f .version ]] && grep -q "${VERSION}" .version; then - echo "configure.ac already in ${VERSION}" + echo ".version already in ${VERSION}" return 0 fi - sed -i "/AC_INIT/s/,\\[\\(.*\\)\\],/,[${VERSION}],/" configure.ac - echo "configure.ac ${VERSION}" + echo "${VERSION}" > .version + echo ".version ${VERSION}" } # update debian/changelog @@ -57,6 +57,6 @@ function doc_doxygen_taler_doxy { echo "doc/doxygen/sync.doxy ${VERSION}" } -configure_ac +version_file debian_changelog doc_doxygen_taler_doxy diff --git a/contrib/ci/Containerfile b/contrib/ci/Containerfile @@ -78,4 +78,4 @@ RUN apt-get update -yqq && \ WORKDIR /workdir -CMD ["bash", "/workdir/ci/ci.sh"] +CMD ["bash", "/workdir/contrib/ci/ci.sh"] diff --git a/debian/.gitignore b/debian/.gitignore @@ -4,7 +4,6 @@ libsync/ libsync-dev/ sync-httpd/ -sync-cli/ *.debhelper debhelper-build-stamp files diff --git a/debian/etc/apache2/sites-available/sync.conf b/debian/etc/apache2/sites-available/sync.conf @@ -7,5 +7,5 @@ --> <Location "/sync/"> -ProxyPass "unix:/var/lib/sync/httpd/sync.sock|http://example.com/" +ProxyPass "unix:/run/sync/httpd/sync-http.sock|http://example.com/" </Location> diff --git a/debian/etc/sync/sync.conf b/debian/etc/sync/sync.conf @@ -1,5 +1,6 @@ [sync] -DATABASE = postgres +# Currency used for GNU Taler payments. +CURRENCY = KUDOS SERVE = unix # Which HTTP port does the backend listen on? Only used if "SERVE" is 'tcp'. @@ -28,10 +29,6 @@ PAYMENT_BACKEND_URL = http://localhost:9966/ # API key to pass when accessing the merchant backend. # API_KEY = SECRET_VALUE -[taler] -# Currency accepted by anastasis via GNU Taler payments. -CURRENCY = KUDOS - @inline-secret@ syncdb-postgres secrets/sync-db.secret.conf # Configuration overrides set by tooling diff --git a/debian/rules b/debian/rules @@ -30,6 +30,7 @@ override_dh_auto_clean: override_dh_installsystemd: dh_installsystemd -psync-httpd --name=sync-httpd --no-start --no-enable + dh_installsystemd -psync-httpd --name=sync-httpd2 --no-start --no-enable # final invocation to generate daemon reload dh_installsystemd diff --git a/debian/sync-httpd.postinst b/debian/sync-httpd.postinst @@ -8,6 +8,7 @@ fi if [ "$1" = "remove" ]; then if [ -x "/usr/bin/deb-systemd-helper" ]; then deb-systemd-helper mask 'sync-httpd.service' >/dev/null || true + deb-systemd-helper mask 'sync-httpd2.service' >/dev/null || true fi fi @@ -15,6 +16,8 @@ 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 + deb-systemd-helper purge 'sync-httpd2.service' >/dev/null || true + deb-systemd-helper unmask 'sync-httpd2.service' >/dev/null || true fi fi diff --git a/debian/sync-httpd.prerm b/debian/sync-httpd.prerm @@ -4,6 +4,7 @@ set -e if [ -d /run/systemd/system ] && [ "$1" = remove ]; then deb-systemd-invoke stop 'sync-httpd.service' >/dev/null || true + deb-systemd-invoke stop 'sync-httpd2.service' >/dev/null || true fi exit 0 diff --git a/debian/sync-httpd2.service b/debian/sync-httpd2.service @@ -0,0 +1,31 @@ +[Unit] +Description=Sync backup backend (MHD2) +After=postgresql.service network.target +Requires=sync-httpd2.socket + +[Service] +User=sync-httpd +Type=simple +Restart=always +RestartMode=direct +RestartSec=1s +RestartPreventExitStatus=9 + +# Disable the service if more than 5 restarts are encountered within 5s. +# These are usually the systemd defaults, but can be overwritten, thus we set +# them here explicitly, as the exchange code assumes StartLimitInterval +# to be >=5s. +StartLimitBurst=5 +StartLimitInterval=5s + +RuntimeMaxSec=3600s +ExecStart=/usr/bin/sync-httpd2 -c /etc/sync/sync.conf -L INFO + +StandardOutput=journal +StandardError=journal +PrivateTmp=yes +PrivateDevices=yes +ProtectSystem=full + +[Install] +WantedBy=multi-user.target diff --git a/debian/sync-httpd2.socket b/debian/sync-httpd2.socket @@ -0,0 +1,13 @@ +[Unit] +Description=Sync Socket (MHD2) + +[Socket] +ListenStream=/run/sync/httpd/sync-httpd2.sock +Accept=no +Service=sync-httpd2.service +SocketUser=sync-httpd +SocketGroup=www-data +SocketMode=0660 + +[Install] +WantedBy=sockets.target diff --git a/doc/doxygen/sync.doxy b/doc/doxygen/sync.doxy @@ -38,7 +38,7 @@ PROJECT_NAME = "GNU Taler: Sync" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.5.1 +PROJECT_NUMBER = 1.6.0-dev.1-19-ge838c28 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/flake.nix b/flake.nix @@ -47,7 +47,7 @@ (pkgs.python3.withPackages (python-pkgs: [ python-pkgs.jinja2 ])) - pkgs.libmicrohttpd + pkgs.libmicrohttpd2 pkgs.libsodium pkgs.libgcrypt pkgs.libunistring @@ -59,13 +59,12 @@ donaupkgs.donau ]; preConfigure = '' - patchShebangs --build contrib/check-prebuilt ./bootstrap ''; }; } ); - defaultPackage = forEachSystem (system: self.packages.${system}.gnunet); + defaultPackage = forEachSystem (system: self.packages.${system}.sync); # This defines a development shell in which you can compile # (and use) exchange devShells = forEachSystem diff --git a/meson.build b/meson.build @@ -344,7 +344,7 @@ if not get_option('only-doc') pkg = import('pkgconfig') subdir('contrib') subdir('src') - if not get_option('disable-doc') + if get_option('doc') subdir('doc') endif @@ -363,7 +363,7 @@ if not get_option('only-doc') ) else subdir('contrib') - if not get_option('disable-doc') + if get_option('doc') subdir('doc') endif endif diff --git a/meson.options b/meson.options @@ -1,5 +1,5 @@ # Build options option('only-doc', type : 'boolean', value : false, description: 'whether to compile documentation ONLY') -option('disable-doc', type : 'boolean', value : false, description: 'whether to disable documentation') +option('doc', type : 'boolean', value : true, description: 'whether to build the documentation') option('install-rpath', type : 'boolean', value : false, description: 'Add rpath to installed binaries if set') option('logging', type : 'string', value: 'yes', description: 'Log setting. Can be set to "yes" (logging, default), "no" (no logging), "verbose" (extra logging"), "veryverbose" (even more logging)') diff --git a/src/sync/sync-httpd2.c b/src/sync/sync-httpd2.c @@ -706,7 +706,7 @@ run (void *cls, enum TALER_MHD2_GlobalOptions go; GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Starting sync-httpd\n"); + "Starting sync-httpd2\n"); go = TALER_MHD2_GO_NONE; if (SH_sync_connection_close) go |= TALER_MHD2_GO_FORCE_CONNECTION_CLOSE; @@ -951,7 +951,7 @@ main (int argc, ret = GNUNET_PROGRAM_run (SYNC_project_data (), argc, argv, - "sync-httpd", + "sync-httpd2", "sync HTTP interface", options, &run, NULL); diff --git a/src/sync/sync-httpd2_config.c b/src/sync/sync-httpd2_config.c @@ -32,7 +32,6 @@ * to be created * 2: block upload signatures are stored server-side and returned with * the block list, so wallets can verify the backup before applying - * (see PROMPTS.md P1) * 3: adds GET /backups/$ACCOUNT_KEY, reporting when the account expires * and how much of the storage allowance it uses */ diff --git a/src/sync/sync.conf b/src/sync/sync.conf @@ -6,6 +6,9 @@ # General settings for the backend. [sync] +# Currency used for GNU Taler payments. +CURRENCY = TESTKUDOS + # Use TCP or UNIX domain sockets? SERVE = tcp @@ -22,9 +25,6 @@ UNIXPATH = ${SYNC_RUNTIME_DIR}/backend.http # What should be the file access permissions (see chmod) for "UNIXPATH"? UNIXPATH_MODE = 660 -# Which database backend do we use? -DB = postgres - # Annual fee for an account ANNUAL_FEE = TESTKUDOS:0.1