Create dotenv token value
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Argiris Deligiannidis 2024-02-03 14:00:25 +02:00
parent 4a870624c4
commit 51823b2c10
2 changed files with 3 additions and 1 deletions

View File

@ -5,3 +5,4 @@ DESTINATION = "/var/invoices/"
#DESTINATION = "../invoices/" #DESTINATION = "../invoices/"
CHUNK_SIZE =1048576 # = 2 ** 20 = 1MB CHUNK_SIZE =1048576 # = 2 ** 20 = 1MB
TOKEN="ZPOclCF5od59SgW6PLM2"

View File

@ -15,6 +15,7 @@ load_dotenv()
SERVICE_URL = os.getenv('SERVICE_URL') SERVICE_URL = os.getenv('SERVICE_URL')
DESTINATION = os.getenv('DESTINATION') DESTINATION = os.getenv('DESTINATION')
CHUNK_SIZE = int(os.getenv('CHUNK_SIZE')) CHUNK_SIZE = int(os.getenv('CHUNK_SIZE'))
env_TOKEN = os.getenv('TOKEN')
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
app = FastAPI() app = FastAPI()
@ -209,7 +210,7 @@ async def create_qr_code(code_content: Optional[str] = None, token: Optional[str
Returns: Returns:
Response: The QR code image as a Response object with media type "image/png". Response: The QR code image as a Response object with media type "image/png".
""" """
if token == 'ZPOclCF5od59SgW6PLM2': if token == env_TOKEN:
if code_content: if code_content:
qr_image = make_qrcode(code_content) qr_image = make_qrcode(code_content)
print("{} : QR Created".format(datetime.datetime.now())) print("{} : QR Created".format(datetime.datetime.now()))