Skip to content

Commit

Permalink
use service account file injected into image
Browse files Browse the repository at this point in the history
  • Loading branch information
mralext20 committed Apr 20, 2024
1 parent 25f83e9 commit 6f20192
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

load_dotenv()

import base64
import json
import os

if os.environ.get("GOOGLE_SERVICE_ACCOUNT"):
# get data, it's b64 encoded
google_service_account = json.loads(base64.b64decode(os.environ.get("GOOGLE_SERVICE_ACCOUNT").encode("ascii")))
else:
google_service_account = None
google_service_account = None
# check if file exists;
if os.path.exists('GOOGLE_SERVICE_ACCOUNT.json'):
google_service_account = json.load(open('GOOGLE_SERVICE_ACCOUNT.json'))


mqtt_url = os.environ.get('MQTT_URL')

Expand Down

0 comments on commit 6f20192

Please sign in to comment.