blob: a29c3c09000976df6b353cbff5e2d7e4818db5e4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
#!/bin/bash
# This file is in the public domain.
# main.sh is the main script that asks the questions and
# puts the answers into environment variables located at "config/taler-internal.conf or config/taler.conf" files
# Nginx configuration - Reads values directly from these "config files".
set -eu
# include functions source file
source functions.sh
# include variables from configuration
mkdir -p config/
touch config/user.conf config/internal.conf
# Values supplied by user
source config/user.conf
# Values we generated
source config/internal.conf
# Ask questions to user
# START USER INTERACTION
say "Welcome to the GNU Taler Debian setup!"
say ""
say "All configuration values asked during the setup script"
say "can be changed in config/user.conf"
ask_questions
# END USER INTERACTION
# Check DNS settings
if ! ping -c1 "exchange.${DOMAIN_NAME}" &>/dev/null; then
say "Could not ping exchange.${DOMAIN_NAME}."
say "Please make sure your DNS/network are working."
exit 1
fi
if ! ping -c1 "bank.${DOMAIN_NAME}" &>/dev/null; then
say "Could not ping bank.${DOMAIN_NAME}."
say "Please make sure your DNS/network are working."
exit 1
fi
if test -z "${BANK_EXCHANGE_PASSWORD:-}"; then
BANK_EXCHANGE_PASSWORD=$(uuidgen)
echo "BANK_EXCHANGE_PASSWORD=\"${BANK_EXCHANGE_PASSWORD}\"" >>config/internal.conf
fi
if test -z "${BANK_PORT:-}"; then
echo "BANK_PORT=8080" >>config/user.conf
fi
if test -z "${PROTO:-}"; then
if test "${ENABLE_TLS:-}" == "y"; then
PROTO="https"
else
PROTO="http"
fi
echo "PROTO=$PROTO">>config/internal.conf
fi
# Check if the user is root, otherwise EXIT.
check_user
# Installation of deb packages required
. install_packages.sh
config_services
# Final message to the user
say "Congratulations, you have successfully installed GNU Taler"
say "Your bank is at ${PROTO}://bank.${DOMAIN_NAME}/"
say "A merchant is at ${PROTO}://backend.${DOMAIN_NAME}/"
say "You should set credentials for the merchant soon."
exit 0
# END INSTALLATION
|