taler-merchant-demos

Python-based Frontends for the Demonstration Web site
Log | Files | Refs | Submodules | README | LICENSE

README.md (3180B)


      1 # Taler Merchant Demos Setup
      2 
      3 _Warning: This page is not completed yet. Follow the instructions at your own risk_
      4 
      5 ## Installing the dependencies
      6 
      7 ### Automatically
      8 
      9 The [Makefile](./Makefile) contains premade scripts for some distros;
     10 
     11 ```bash
     12 # Arch-based (Manjaro, Arco, etc...)
     13 $ make setup-arch
     14 
     15 # Debian-based (Ubuntu, Mint, etc...)
     16 $ make setup-deb
     17 ```
     18 
     19 ### Manually
     20 
     21 <!--
     22   TODO: Migrate to per-distro instructions
     23   -> We need to consider if we should incrase the README.md's size, or if we should split said per-distro instructions into multiple files
     24 -->
     25 
     26 _Note: These instructions assume you are on a debian-based distribution. Other distributions may vary!_
     27 
     28 1. Update Apt Repositories (Recommended);
     29    > ```bash
     30    > $ sudo apt update
     31    > ```
     32 2. Step 2: Ensure Python 3.5 or above and Flask with the Babel extension are installed;
     33    > ```bash
     34    > $ sudo apt install python3 python-is-python3 python3-flask-babel -y
     35    > ```
     36 3. Ensure Python3 Pip is installed;
     37    > ```bash
     38    > # you may need to use python3-pip on some systems
     39    > $ sudo apt install python3-pip -y
     40    > ```
     41 4. Configure things using:
     42    > ```bash
     43    > $ ./configure --prefix=local
     44    > ```
     45 5. Install UWSGI
     46    > ```bash
     47    > $ pip install uwsgi # You may need to use pip3 on some systems
     48    > ```
     49 6. Install LXML
     50    > ```bash
     51    > $ pip install lxml # You may need to use pip3 on some systems
     52    > ```
     53 7. Install NodeJS <!-- NOTE: Likely redundant, legacy -->
     54    > ```bash
     55    > $ sudo apt install npm nodejs
     56    > ```
     57 8. Install Poetry
     58    > ```bash
     59    > $ pip install poetry
     60    > ```
     61 
     62 ## Configuring the demo
     63 
     64 _This is just how I did it, and not necessarily the optimal method. You should only use this in testing._
     65 
     66 Step 1: Open the config:
     67 
     68 > `$ editor ~/.config/taler.conf`
     69 
     70 <br>
     71 
     72 Step 2: Adding the required configuration values:
     73 
     74 > ```
     75 > [frontend-demo-blog]
     76 > backend_apikey = "secret-token:secret"
     77 > backend_url = https://backend.demo.taler.net/
     78 > http_port = 8080
     79 > serve = http
     80 >
     81 > [taler]
     82 > currency = KUDOS
     83 > ```
     84 
     85 <br>
     86 
     87 Step 3: Configure the config:
     88 
     89 > 1. Replace the backend api key with the api key for the backend<br>
     90 > 2. Replace the backend URL with the actual backend link<br>
     91 > 3. Replace the http port with whichever port you desire<br>
     92 > 4. _In Production:_ Replace the currency with your currency
     93 
     94 <br>
     95 
     96 ## Applying Changes
     97 
     98 To apply changes, use
     99 
    100 > `$ make install`
    101 
    102 ## Running the program
    103 
    104 To start the server, use the following command:<br>
    105 
    106 > `$ taler-merchant-demos blog`
    107 
    108 _Note: If zsh asks you if you want to correct it to talermerchantdemos, select **no**_
    109 
    110 ## More configuration options.
    111 
    112 This makes the blog speak UWSGI over TCP:
    113 
    114 > ```
    115 > [frontend-demo-blog]
    116 > backend_apikey = "secret-token:secret"
    117 > backend_url = https://backend.demo.taler.net/
    118 > serve = uwsgi
    119 > uwsgi_serve = tcp
    120 > uwsgi_port = XYZ
    121 >
    122 > [taler]
    123 > currency = KUDOS
    124 > ```
    125 
    126 <br>
    127 
    128 This makes the blog speak UWSGI over unix domain socket:
    129 
    130 > ```
    131 > [frontend-demo-blog]
    132 > backend_apikey = "secret-token:secret"
    133 > backend_url = https://backend.demo.taler.net/
    134 > serve = uwsgi
    135 > uwsgi_serve = unix
    136 > uwsgi_unixpath = "/tmp/blog.uwsgi"
    137 > uwsgi_unixpath_mode = XZY
    138 >
    139 > [taler]
    140 > currency = KUDOS
    141 > ```