polyledger/connect

No doc with ENV vars needed

Closed this issue · 2 comments

There should be a doc of all the ENV vars needed in .env.development.

Maybe we should add them to https://github.com/polyledger/polyledger/wiki/Development:-Getting-Started?

Right now mine looks like

DOCKER_TLS_VERIFY="1"
DOCKER_HOST="tcp://192.168.99.100:2376"
DOCKER_CERT_PATH="/Users/mpigassou/.docker/machine/machines/polyledger"
DOCKER_MACHINE_NAME="polyledger"

SECRET_KEY=yj1^cc7-tmpyr+xqt6n&1da!epea3@l_l6jj(@aa!_p_3d+tqi
EMAIL_HOST_PASSWORD=foobar

# Settings module will vary depending on the environment
DJANGO_SETTINGS_MODULE=polyledger.settings.local

BITBUTTER_API_KEY=foo
BITBUTTER_API_SECRET=foo
BITBUTTER_BASE_URI=http://example.com
BITBUTTER_PARTNERSHIP_ID=123
BITBUTTER_PARTNER_ID=123

But I still see errors about currency stuff:

server        | [2018-05-16 02:47:18 +0000] [25] [INFO] Starting gunicorn 19.7.0
server        | [2018-05-16 02:47:18 +0000] [25] [INFO] Listening at: http://0.0.0.0:80 (25)
server        | [2018-05-16 02:47:18 +0000] [25] [INFO] Using worker: sync
server        | [2018-05-16 02:47:18 +0000] [28] [INFO] Booting worker with pid: 28
server        | [2018-05-16 02:47:18,840: ERROR/ForkPoolWorker-1] Task api.tasks.get_current_prices[23acbb39-c966-41e2-8466-971b95054cf3] raised unexpected: TypeError('string indices must be integers',)
server        | Traceback (most recent call last):
server        |   File "/usr/local/lib/python3.6/site-packages/celery/app/trace.py", line 374, in trace_task
server        |     R = retval = fun(*args, **kwargs)
server        |   File "/usr/local/lib/python3.6/site-packages/celery/app/trace.py", line 629, in __protected_call__
server        |     return self.run(*args, **kwargs)
server        |   File "/srv/polyledger/api/tasks.py", line 209, in get_current_prices
server        |     price = data[symbol]['USD']

Similarly, something should be said about having NPM_TOKEN available even on the host, because there is a git hook setup to use it (not sure it's a very good idea IMO).

A couple of notes -

  1. I've read somewhere that Docker for Mac is recommended for macOS instead of installing docker-machine. Whatever Docker tool we use, it should be standard, and the documentation should use this tool.

  2. I've added documentation for the environment variables in the updated readme. Check it out

  3. I think that error was due to the API provider returning missing data. That's a separate issue, we need better exception handling there.