summaryrefslogtreecommitdiff
path: root/doc/config.sh
blob: 6448b38e55b92b3c2cc81d8a4d4a0c26fb84f836 (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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/bin/bash

# This file is part of TALER
# (C) 2014, 2015, 2016 INRIA
# TALER is free software; you can redistribute it and/or modify it under the
# terms of the GNU Affero General Public License as published by the Free Software
# Foundation; either version 3, or (at your option) any later version.
# TALER is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
# TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>

# @author Marcello Stanisci
# @brief Walkthrough configuration steps

echo -e "\nThis script will set and show all the configuration\n\
values needed to run an example backend. The backend will listen on port 8888\n\
and cooperate with exchange at https://exchange.demo.taler.net/.\n\
Additionally, the script will also generate the backend's private\n\
key and banking details' file.\n\n"

# FIXME:
#       1) banking details generator missing

echo -n "Press ENTER to start > "
read
echo 

echo -n "Setting section [merchant]<ENTER> "
read
echo 

echo -n "taler-config -s merchant -o serve -V TCP<ENTER> "
read
echo 
taler-config -s merchant -o serve -V TCP

echo -n "taler-config -s merchant -o port -V 8888<ENTER> "
read
echo 
taler-config -s merchant -o port -V 8888

echo -n "taler-config -s merchant -o database -V postgres<ENTER> "
read
echo 
taler-config -s merchant -o database -V postgres

echo -n "taler-config -s merchant -o currency -V KUDOS<ENTER> "
read
echo 
taler-config -s merchant -o currency -V KUDOS

echo -n "taler-config -s merchant -o wireformat -V TEST<ENTER> "
read
echo 
taler-config -s merchant -o wireformat -V TEST

echo -n "Setting section [merchant-instance-default]<ENTER> "
read
echo 

echo -ne "taler-config -s merchant-instance-default -o keyfile -V \${TALER_DATA_HOME}/key.priv\n\n\
(The key will be dynamically generated once the backend starts)<ENTER> "
read
echo 
taler-config -s merchant-instance-default -o keyfile -V '${TALER_DATA_HOME}/key.priv'

echo -n "Setting section [merchant-instance-wireformat-default]<ENTER> "
read
echo 

echo -n "taler-config -s merchant-instance-wireformat-default -o test_response_file -V \${TALER_DATA_HOME}/test.json<ENTER> "
read
echo 
taler-config -s merchant-instance-wireformat-default -o test_response_file -V '${TALER_DATA_HOME}/test.json'

sleep 1
echo -ne "Generating test.json..\n\n"
DEST=$(taler-config -s merchant-instance-wireformat-default -o test_response_file -f)
echo '{
  "type": "test",
  "bank_uri": "https://bank.test.taler.net/",
  "sig": "MERCHANTSIGNATURE",
  "account_number": 6,
  "salt": "SALT"
  }' > $DEST

echo -n "Setting section [merchantdb-postgres]<ENTER> "
read
echo 

echo -n "taler-config -s merchantdb-postgres -o config -V postgres:///donations<ENTER> "
read
echo 
taler-config -s merchantdb-postgres -o config -V "postgres:///donations"

echo -n "Setting section [merchant-demoexchange]<ENTER> "
read
echo 

echo -n "taler-config -s merchant-demoexchange -o uri -V https://exchange.demo.taler.net/<ENTER> "
read
echo 
taler-config -s merchant-demoexchange -o uri -V "https://exchange.demo.taler.net/"

echo -n "taler-config -s merchant-demoexchange -o master_key -V CQQZ9DY3MZ1ARMN5K1VKDETS04Y2QCKMMCFHZSWJWWVN82BTTH00<ENTER> "
read
echo 
taler-config -s merchant-demoexchange -o master_key -V "CQQZ9DY3MZ1ARMN5K1VKDETS04Y2QCKMMCFHZSWJWWVN82BTTH00"

echo -ne "Done. Launch the backend with:\n\
\$ taler-merchant-httpd\n\nTest it with:\n\
\$ curl http://127.0.0.1:8888/\n\nIf everything worked \
fine, you should see:\n\n\
'Hello, I'm a merchant's Taler backend. This HTTP server is not for humans.'\n\n"