1Make sure to use git clone --recursive on this repository to get the submodule.
2
3 sudo apt install postgresql-11 postgresql-client
4 sudo -u postgres psql
5 CREATE DATABASE jmp;
6 GRANT ALL ON DATABASE jmp TO unix_user;
7 \c jmp
8 CREATE EXTENSION btree_gist;
9 CREATE EXTENSION citext;
10 CREATE EXTENSION pgcrypto;
11 exit
12 sudo apt install sqitch
13 cd schemas
14 sqitch deploy
15 bundle install --path=.gems
16 cp config.dhall.sample config.dhall
17 $EDITOR config.dhall # Set up appropriately for local prosody, braintree, etc
18 bundle exec ruby sgx_jmp.rb ./config.dhall
19
20
21## Helpful keys for registration
22
23If you want to register with the backend without going through braintree or electrum, you can set the following two keys in Redis:
24
25 SET "jmp_customer_id-<USER>\\40<DOMAIN>@cheogram" 0001
26 SET "jmp_customer_jid-0001" "jmp_customer_id-<USER>\\40<DOMAIN>@cheogram"
27
28Where cheogram is whatever the component is called, and 0001 is whatever you want the user's customer ID to be.
29
30And then in psql:
31 INSERT INTO plan_log (customer_id, plan_name, date_range) VALUES ('0001', 'plan_name', tsrange('1990-01-01', '2023-01-01'));
32
33These together will ensure that the customer already has an ID, and so braintree doesn't need to be asked to create one, and the plan is activated, so we don't need to attempt to accept payment.
34
35Then when you run "register" from cheogram, it will skip right to the end and allow you to begin routing to this component.