[24.02.20] deleted api tokens and load from env

This commit is contained in:
andrewso 2020-02-24 10:41:03 +00:00
parent 92b5dd1e6c
commit 57f69ecade
3 changed files with 4 additions and 8 deletions

View File

@ -4,6 +4,6 @@ RUN apk update && \
apk add py-pip libc-dev gcc apk add py-pip libc-dev gcc
RUN pip install utils pycryptodome && \ RUN pip install utils pycryptodome && \
pip install python-env coinbase pip install python-env coinbase
COPY /* /home/price-collector/ COPY /price-collector /home/price-collector/
EXPOSE 9090 EXPOSE 9090
CMD ["python", "/home/price-collector/src/main.py"] CMD ["python", "/home/price-collector/src/main.py"]

View File

@ -1,2 +0,0 @@
API_KEY=B1efIaTHpUk5Bh1W
API_SECRET=nqBiADFQ2I8UeyLhHaSH0IdeqkFcCq1K

View File

@ -5,15 +5,13 @@ import sys, os
from coinbase.wallet.client import Client from coinbase.wallet.client import Client
from dotenv import load_dotenv from dotenv import load_dotenv
from pathlib import Path # python3 only load_dotenv()
env_path = Path('.') / 'configuration/coinbase.env'
load_dotenv(dotenv_path=env_path)
class keys(): class keys():
def __init__(self): def __init__(self):
self.api_key = os.getenv('API_KEY') self.api_key = os.getenv('COINBASE_KEY')
self.api_secret = os.getenv("API_SECRET") self.api_secret = os.getenv("COINBASE_SECRET")
def coinbasePublicTicker(type): def coinbasePublicTicker(type):