dutu / poloLender

Free, open source, high performance bot for lending funds on Poloniex exchange
https://github.com/dutu/poloLender
Other
160 stars 47 forks source link

Setting POLOLENDER_APIKEY via "heroku config:set" command is ingesting key/secret values improperly #41

Closed sunweiyang closed 7 years ago

sunweiyang commented 7 years ago

While following the instructions for setting up poloLender in Heroku, I attempted to set my environmental variable using the following command: heroku config:set POLOLENDER_APIKEY={\"key\":\"MYKEY\",\"secret\":\"MYSECRET\"}

This resulted in the following output, which suggested that only the "secret" value was ingested (no "key" value): Setting POLOLENDER_APIKEY, POLOLENDER_APIKEY and restarting ⬢ rocky-atoll-57901... done, v17 POLOLENDER_APIKEY: "secret":"MYSECRET"

Sure enough, "heroku config" shows only the "secret" value. This issue causes app deployment to fail.

dutu commented 7 years ago

@sunweiyang , could you let me know the heroku config:set command you are using and its output? Please just replace with * characters from the key and secret and copy+paste.

sunweiyang commented 7 years ago

Here are my heroku config:set and heroku config commands. I've obfuscated my own key and secret values.

You'll notice that I have only ETH listed in my POLOLENDER_LENDMAX and POLOLENDER_MINRATE environment variables. That's because when I try to have both BTC and ETH, the same thing happens; only the last key-value pair gets set.

$ heroku config:set POLOLENDER_APIKEY={\"key\":\"------------------\",\"secret\":\"------------------\"}
Setting POLOLENDER_APIKEY, POLOLENDER_APIKEY and restarting ⬢ rocky-atoll-57901... done, v17
POLOLENDER_APIKEY: "secret":"------------------"
$ heroku config
=== rocky-atoll-57901 Config Vars
PAPERTRAIL_API_TOKEN:      ------------------
POLOLENDER_APIKEY:         "secret":"------------------"
POLOLENDER_LENDMAX:        {"ETH":"#"}
POLOLENDER_MINRATE:        {"ETH":"#"}
POLOLENDER_REPORTINTERVAL: 30
POLOLENDER_STARTBALANCE:   {"#"}
POLOLENDER_STARTTIME:      2017-05-24T10:17:00+07:00
dutu commented 7 years ago

it looks that on Ubuntu you have to use this format

heroku config:set POLOLENDER_APIKEY='{"key":"----","secret":"-----"}'
Shoananas commented 7 years ago

For those who may have similar errors, you can setup the config vars through the Heroku website, the last tab when you browse your app on Heroku lets you edit the config vars and it restarts the app automatically to apply the new values.