taler-deployment

Deployment scripts and configuration files
Log | Files | Refs | README

commit 4fd465d1423694d5629d162ba92c38cea40ce3e4
parent ae648b3d47d7b9a9204b8a2a331ce01d5d8b8890
Author: Florian Dold <florian@dold.me>
Date:   Wed,  8 Mar 2023 19:23:46 +0100

detect distro

Diffstat:
Mnetzbon/functions.sh | 10++++++++++
Dnetzbon/install_debian_packages.sh | 43-------------------------------------------
Anetzbon/install_packages.sh | 57+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mnetzbon/main.sh | 4++--
4 files changed, 69 insertions(+), 45 deletions(-)

diff --git a/netzbon/functions.sh b/netzbon/functions.sh @@ -52,3 +52,13 @@ function assign_user_permissions() su - postgres -c "createdb -O $n taler-$n" done } + +# Set DISTRO to the detected distro or return non-zero +# status if distro not supported. +function detect_distro() +{ + unset DISTRO + uname -a | grep Ubuntu >/dev/null && DISTRO=ubuntu && return 0 + uname -a | grep Debian >/dev/null && DISTRO=debian && return 0 + return 1 +} diff --git a/netzbon/install_debian_packages.sh b/netzbon/install_debian_packages.sh @@ -1,43 +0,0 @@ -#!/bin/bash -# This file is in the public domain. - -set -eu - -source functions.sh -source config/user.conf -source config/internal.conf - -# Program versions -PG_VERSION=14 - -## Update - -apt update - -## General requirements - -apt install uuid-runtime \ - curl \ - jq \ - wget \ - nginx \ - postgresql-${PG_VERSION} \ - postgresql-client-${PG_VERSION} \ - dbconfig-pgsql \ - certbot -y - -## Add GNU Taler deb.taler.net to /etc/apt/sources.list - -say "Adding GNU Taler Debian repository" - -echo "deb [signed-by=/etc/apt/keyrings/taler-systems.gpg] https://deb.taler.net/apt/debian stable main" > /etc/apt/sources.list.d/taler.list - -wget -P /etc/apt/keyrings https://taler.net/taler-systems.gpg - -## Specific GNU Taler packages - -apt update -apt install taler-exchange -y -apt install taler-merchant -y -apt install taler-harness -y -apt install libeufin-sandbox libeufin-nexus -y diff --git a/netzbon/install_packages.sh b/netzbon/install_packages.sh @@ -0,0 +1,57 @@ +#!/bin/bash +# This file is in the public domain. + +set -eu + +source functions.sh +source config/user.conf +source config/internal.conf + +detect_distro + +# Program versions +PG_VERSION=14 + +## Update + +apt update + +## General requirements + +apt install uuid-runtime \ + curl \ + jq \ + wget \ + nginx \ + postgresql-${PG_VERSION} \ + postgresql-client-${PG_VERSION} \ + dbconfig-pgsql \ + certbot -y + +## Add GNU Taler deb.taler.net to /etc/apt/sources.list + +say "Adding GNU Taler apt repository" + +case $DISTRO in + debian) + echo "deb [signed-by=/etc/apt/keyrings/taler-systems.gpg] https://deb.taler.net/apt/ubuntu stable main" > /etc/apt/sources.list.d/taler.list + ;; + ubuntu) + echo "deb [signed-by=/etc/apt/keyrings/taler-systems.gpg] https://deb.taler.net/apt/debian stable main" > /etc/apt/sources.list.d/taler.list + ;; + *) + say "Unsupported distro: $DISTRO" + exit 1 + ;; +esac + + +wget -P /etc/apt/keyrings https://taler.net/taler-systems.gpg + +## Specific GNU Taler packages + +apt update +apt install taler-exchange -y +apt install taler-merchant -y +apt install taler-harness -y +apt install libeufin-sandbox libeufin-nexus -y diff --git a/netzbon/main.sh b/netzbon/main.sh @@ -79,8 +79,8 @@ fi # Check if the user is root, otherwise EXIT. check_user -# Installation of Debian packages required -. install_debian_packages.sh +# Installation of deb packages required +. install_packages.sh if test -z "${NEXUS_EXCHANGE_PASSWORD:-}" then