From 57f69ecade108056aade377eb087f4a930dcc677 Mon Sep 17 00:00:00 2001 From: andrewso <9V5f1FkzI2LD> Date: Mon, 24 Feb 2020 10:41:03 +0000 Subject: [PATCH] [24.02.20] deleted api tokens and load from env --- Dockerfile | 2 +- configuration/coinbase.env | 2 -- src/pricing/coinbase.py | 8 +++----- 3 files changed, 4 insertions(+), 8 deletions(-) delete mode 100644 configuration/coinbase.env diff --git a/Dockerfile b/Dockerfile index cf1906f..d2e68a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,6 @@ RUN apk update && \ apk add py-pip libc-dev gcc RUN pip install utils pycryptodome && \ pip install python-env coinbase -COPY /* /home/price-collector/ +COPY /price-collector /home/price-collector/ EXPOSE 9090 CMD ["python", "/home/price-collector/src/main.py"] \ No newline at end of file diff --git a/configuration/coinbase.env b/configuration/coinbase.env deleted file mode 100644 index 5193b2d..0000000 --- a/configuration/coinbase.env +++ /dev/null @@ -1,2 +0,0 @@ -API_KEY=B1efIaTHpUk5Bh1W -API_SECRET=nqBiADFQ2I8UeyLhHaSH0IdeqkFcCq1K \ No newline at end of file diff --git a/src/pricing/coinbase.py b/src/pricing/coinbase.py index 4e5ce81..732cd13 100644 --- a/src/pricing/coinbase.py +++ b/src/pricing/coinbase.py @@ -5,15 +5,13 @@ import sys, os from coinbase.wallet.client import Client from dotenv import load_dotenv -from pathlib import Path # python3 only -env_path = Path('.') / 'configuration/coinbase.env' -load_dotenv(dotenv_path=env_path) +load_dotenv() class keys(): def __init__(self): - self.api_key = os.getenv('API_KEY') - self.api_secret = os.getenv("API_SECRET") + self.api_key = os.getenv('COINBASE_KEY') + self.api_secret = os.getenv("COINBASE_SECRET") def coinbasePublicTicker(type):