cashless2ecash

cashless2ecash: pay with cards for digital cash (experimental)
Log | Files | Refs | README

commit 1135b1636d351f2b7dbd38036cb8235b7e0fc465
parent 62cce7fac9bc1a2dfad440ea126d6dacd5e0af1d
Author: Joel-Haeberli <haebu@rubigen.ch>
Date:   Wed,  1 May 2024 14:51:42 +0200

feat: build cli script

Diffstat:
Ac2ec/install/build_cli.sh | 20++++++++++++++++++++
Mc2ec/install/installation_notes.md | 30+++++++++++++++++++++++++++++-
2 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/c2ec/install/build_cli.sh b/c2ec/install/build_cli.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +if [ "$#" -ne 2 ]; then + echo "Usage: $0 <source-root> <install-dir>" + exit 1 +fi + +REPO_ROOT=$1 +INSTALL_DIR=$2 + +build_c2ec_cli() { + go build -o $INSTALL_DIR $REPO_ROOT + if [ $? -ne 0 ]; then + echo "Failed to build C2EC using Go" + exit 1 + fi +} + +build_c2ec_cli +\ No newline at end of file diff --git a/c2ec/install/installation_notes.md b/c2ec/install/installation_notes.md @@ -76,10 +76,38 @@ find src directory of cashless2ecash, find c2ec/install/setup_db.sh export PGHOST=localhost` export PGPORT=5432 ./setup_db.sh c2ec_admin [PASSWORD OBFUSCATED] c2ec ./.. +su postgres +psql -d c2ec +``` + +Grant rights on tables, triggers and functions to the users `c2ec_api` and `c2ec_operator` + +```sql +GRANT ALL PRIVILEGES ON c2ec.withdrawal TO c2ec_api; +GRANT SELECT ON c2ec.terminal TO c2ec_api; +GRANT SELECT ON c2ec.provider TO c2ec_api; +GRANT EXECUTE ON FUNCTION c2ec.emit_withdrawal_status TO c2ec_api; +GRANT EXECUTE ON FUNCTION c2ec.emit_payment_notification TO c2ec_api; +GRANT EXECUTE ON FUNCTION c2ec.emit_retry_notification TO c2ec_api; +GRANT EXECUTE ON FUNCTION c2ec.emit_transfer_notification TO c2ec_api; +GRANT ALL PRIVILEGES ON c2ec.terminal TO c2ec_operator; +GRANT ALL PRIVILEGES ON c2ec.provider TO c2ec_operator; +``` + +### Building and Running the app + +Building the cli (used to manage terminals and providers) + +```bash +./build_cli.sh ./../../cli $HOME +.$HOME/cli ``` -### Building the app +Building c2ec ```bash ./build_app.sh ./.. $HOME +cp $HOME/cashless2ecash/c2ec/c2ec-config.yaml $HOME +# configure correctly +.$HOME/c2ec ```