Skip to content

Commit

Permalink
load google service account from b64 in environment
Browse files Browse the repository at this point in the history
  • Loading branch information
mralext20 committed Mar 24, 2024
1 parent ee9e344 commit ece69e6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 0 additions & 4 deletions bot.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from dotenv import load_dotenv

load_dotenv()


import asyncio
import logging
Expand Down
13 changes: 13 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
from dotenv import load_dotenv

load_dotenv()

import json
import os
import base64


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

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

Expand Down

0 comments on commit ece69e6

Please sign in to comment.