config.sh (3810B)
1 #!/bin/bash 2 3 # This file is part of TALER 4 # (C) 2014, 2015, 2016 INRIA 5 # TALER is free software; you can redistribute it and/or modify it under the 6 # terms of the GNU Affero General Public License as published by the Free Software 7 # Foundation; either version 3, or (at your option) any later version. 8 # TALER is distributed in the hope that it will be useful, but WITHOUT ANY 9 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 10 # A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 # You should have received a copy of the GNU General Public License along with 12 # TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 13 14 # @author Marcello Stanisci 15 # @brief Walkthrough configuration steps 16 17 echo -e "\nThis script will set and show all the configuration\n\ 18 values needed to run an example backend. The backend will listen on port 8888\n\ 19 and cooperate with exchange at https://exchange.demo.taler.net/.\n\ 20 Additionally, the script will also generate the backend's private\n\ 21 key and banking details' file.\n\n" 22 23 # FIXME: 24 # 1) banking details generator missing 25 26 echo -n "Press ENTER to start > " 27 read 28 echo 29 30 echo -n "Setting section [merchant]<ENTER> " 31 read 32 echo 33 34 echo -n "taler-config -s merchant -o serve -V TCP<ENTER> " 35 read 36 echo 37 taler-config -s merchant -o serve -V TCP 38 39 echo -n "taler-config -s merchant -o port -V 8888<ENTER> " 40 read 41 echo 42 taler-config -s merchant -o port -V 8888 43 44 echo -n "taler-config -s merchant -o database -V postgres<ENTER> " 45 read 46 echo 47 taler-config -s merchant -o database -V postgres 48 49 echo -n "taler-config -s merchant -o currency -V KUDOS<ENTER> " 50 read 51 echo 52 taler-config -s merchant -o currency -V KUDOS 53 54 echo -n "taler-config -s merchant -o wireformat -V TEST<ENTER> " 55 read 56 echo 57 taler-config -s merchant -o wireformat -V TEST 58 59 echo -n "Setting section [merchant-instance-default]<ENTER> " 60 read 61 echo 62 63 echo -ne "taler-config -s merchant-instance-default -o keyfile -V \${TALER_DATA_HOME}/key.priv\n\n\ 64 (The key will be dynamically generated once the backend starts)<ENTER> " 65 read 66 echo 67 taler-config -s merchant-instance-default -o keyfile -V '${TALER_DATA_HOME}/key.priv' 68 69 echo -n "Setting section [merchant-instance-wireformat-default]<ENTER> " 70 read 71 echo 72 73 echo -n "taler-config -s merchant-instance-wireformat-default -o test_response_file -V \${TALER_DATA_HOME}/test.json<ENTER> " 74 read 75 echo 76 taler-config -s merchant-instance-wireformat-default -o test_response_file -V '${TALER_DATA_HOME}/test.json' 77 78 sleep 1 79 echo -ne "Generating test.json..\n\n" 80 DEST=$(taler-config -s merchant-instance-wireformat-default -o test_response_file -f) 81 echo '{ 82 "type": "test", 83 "bank_uri": "https://bank.test.taler.net/", 84 "sig": "MERCHANTSIGNATURE", 85 "account_number": 6, 86 "salt": "SALT" 87 }' > $DEST 88 89 echo -n "Setting section [merchantdb-postgres]<ENTER> " 90 read 91 echo 92 93 echo -n "taler-config -s merchantdb-postgres -o config -V postgres:///donations<ENTER> " 94 read 95 echo 96 taler-config -s merchantdb-postgres -o config -V "postgres:///donations" 97 98 echo -n "Setting section [merchant-demoexchange]<ENTER> " 99 read 100 echo 101 102 echo -n "taler-config -s merchant-demoexchange -o uri -V https://exchange.demo.taler.net/<ENTER> " 103 read 104 echo 105 taler-config -s merchant-demoexchange -o uri -V "https://exchange.demo.taler.net/" 106 107 echo -n "taler-config -s merchant-demoexchange -o master_key -V CQQZ9DY3MZ1ARMN5K1VKDETS04Y2QCKMMCFHZSWJWWVN82BTTH00<ENTER> " 108 read 109 echo 110 taler-config -s merchant-demoexchange -o master_key -V "CQQZ9DY3MZ1ARMN5K1VKDETS04Y2QCKMMCFHZSWJWWVN82BTTH00" 111 112 echo -ne "Done. Launch the backend with:\n\ 113 \$ taler-merchant-httpd\n\nTest it with:\n\ 114 \$ curl http://127.0.0.1:8888/\n\nIf everything worked \ 115 fine, you should see:\n\n\ 116 'Hello, I'm a merchant's Taler backend. This HTTP server is not for humans.'\n\n"