Improve documentation of local docker-compose setup.

[?]
Oct 4, 2020, 5:28 PM
MJDIMD5BQEBC265AQAGYE2K6EHHS7ZMZY3I6WE5MCDSTA2E2VY7AC

Dependencies

  • [2] 3KPGZUJ2 Sendgrid supports port 587, which Comcast does not block.
  • [3] NJNMO72S Add zcash.com submodule and update client to modern halogen.
  • [4] EPOYLP7O A little .gitignore cleanup.
  • [5] GMYPBCWE Make docker-compose work.
  • [6] OBFPJS2G Project successfully builds and tests under nix.
  • [7] 6L5BK5EH Use generic SMTP rather than Sendmail-specific mail client.
  • [8] QO4NFWIY Added sample config file.
  • [9] 5FLAK3ME Fix nginx mime types.
  • [10] XZLSHL4D The server is now (tenuously) running, and serving pages via SSL!
  • [11] PGZJ736C Update aftok.cfg.example and revise INSTALL instructions
  • [12] 4U7F3CPI THE GREAT RENAMING OF THINGS!
  • [13] 3TAMXHCZ Add migrations to server startup.
  • [14] M3KUPGZK Add invitation email template.
  • [*] 4ZLEDBK7 Initial attempts at dockerizing, cabal isn't cooperating.
  • [*] 4B66XH43 Add sample billing config
  • [*] NSRSSSTR Update nginx.conf, make aftok host configurable for cli scripts.

Change contents

  • edit in DEVELOPMENT.md at line 15
    [3.209]
    [3.209]
    The easiest way to run local aftok infrastructure is using Docker and
    docker-compose. Several steps are necessary to set up your local environment
    for development.
    Obtaining Docker Images
    -----------------------
    The docker-compose setup requires 4 images:
    * `aftok/aftok-server:latest`
    * `nginx/nginx:latest`
    * `postgres/postgres:9.4`
    * `electriccoinco/zcashd:v4.0.0`
    You can obtain these images by running the following. This assumes the use of
    `sudo` under Linux; this may not be necessary on other platforms (e.g. OSX).
    ~~~bash
    make build-image # build the aftok-server image(s)
    docker pull nginx/nginx:lates
    docker pull postgres/postgres:9.4
    docker pull electriccoinco/zcashd:v4.0.0
    ~~~
    If you have problems building the aftok-server image, you can also obtain
    a prebuilt image by running
    ~~~bash
    docker pull aftok/aftok-server:latest
    ~~~
    Configuration Files
    -------------------
    A number of configuration files are required for docker-compose to be able
    to run all of the necessary containers successfully. You should create
    a `local` directory, which will have the following contents:
    ~~~
    local
    ├── conf
    │   ├── nginx
    │   │   ├── mime.types
    │   │   └── nginx.conf
    │   ├── nginx-certs
    │   │   ├── aftok.crt
    │   │   └── aftok.key
    │   ├── server
    │   │   ├── aftok.bip70-chain.cert.pem
    │   │   ├── aftok.bip70.key.pem
    │   │   ├── aftok.cfg
    │   │   ├── aftok-migrations.cfg
    │   │   └── snap-site-key
    │   └── zcashd
    │   ├── zcash-data
    │   │   └── zcash.conf
    │   └── zcash-params
    └── db-dumps
    └── aftok.sample.plsql
    ~~~
    Sample default versions of each of these files can be found in the `conf`
    directory; you can simply use the following to set up your local environment:
  • edit in DEVELOPMENT.md at line 80
    [3.210]
    [3.210]
    ~~~bash
    mkdir local
    cp -r conf local
    # The aftok-zcashd container runs zcashd as user 2001, so we change the
    # owner of the zcashd configuration directories to this user.
    sudo chown -R 2001.2001 local/conf/zcashd
    ~~~
    Database Initialization
    -----------------------
  • edit in Dockerfile at line 50
    [4.633]
    [4.709]
    RUN apt-get install -y --no-install-recommends pkg-config
  • file addition: daemon (d--r------)
    [4.54]
  • file move: aftok-payouts.cfg.example (----------)aftok-daemon.cfg (----------)
    [0.2248]
    [4.2884]
  • file addition: nginx (d--r------)
    [4.54]
  • file move: mime.types (----------)mime.types (----------)
    [0.2311]
    [4.1]
  • file move: nginx.conf (----------)nginx.conf (----------)
    [0.2311]
    [4.200]
  • file addition: server (d--r------)
    [4.54]
  • file move: aftok-migrations.cfg.example (----------)aftok-migrations.cfg (----------)
    [0.2402]
    [4.166]
  • file move: aftok.cfg.example (----------)aftok.cfg (----------)
    [0.2402]
    [4.19]
  • replacement in conf/server/aftok.cfg at line 6
    [4.625][4.124:145]()
    host = "127.0.0.1"
    [4.625]
    [4.646]
    host = "aftok-db"
  • replacement in conf/server/aftok.cfg at line 27
    [2.17][4.145:186](),[4.145][4.145:186]()
    smtpUser = "whoareyou"
    smtpPass = "iami"
    [2.17]
    [4.307]
    smtpUser = "your_sendgrid_username"
    smtpKey = "your_sendgrid_key"
  • edit in conf/server/aftok.cfg at line 32
    [17.31]
    [17.31]
    # Signing key for BIP-70 payment requests
  • edit in conf/server/aftok.cfg at line 39
    [4.355]
    recaptchaSecret = "your_secret_goes_here"
    zcashd {
    zcashdHost = "aftok-zcashd"
    zcashdPort = 8232
    }
  • file addition: zcashd (d--r------)
    [4.54]
  • file addition: zcash-data (d--r------)
    [0.2743]
  • file addition: zcash.conf (----------)
    [0.2763]
    testnet=1
    addnode=testnet.z.cash
  • edit in docker-compose.yml at line 11
    [4.23906]
    [4.23906]
    - zcashd
  • replacement in docker-compose.yml at line 31
    [4.24248][3.309387:309419]()
    source: ./deploy/nginx/
    [4.24248]
    [4.24285]
    source: ./local/conf/nginx/
  • edit in docker-compose.yml at line 63
    [18.521]
    [4.24689]
    networks:
    - back-tier
    zcashd:
    image: electriccoinco/zcashd:v4.0.0
    container_name: aftok-zcashd
    ports:
    - "8232:8232"
    volumes:
    - type: bind
    source: ./local/conf/zcashd/zcash-data
    target: /srv/zcashd/.zcash
    - type: bind
    source: ./local/conf/zcashd/zcash-params
    target: /srv/zcashd/.zcash-params