made config file
This commit is contained in:
parent
bd824583ed
commit
197a1d44b4
7
config.txt
Normal file
7
config.txt
Normal file
@ -0,0 +1,7 @@
|
||||
[config]
|
||||
dbhost = postgres.eggtech.net
|
||||
dbname = CNSA-276-FP-DAS
|
||||
dbusername = FP-DEV-USER
|
||||
dbpassword = purchase-immortal-prescribe-repave-detention-seizing-candied-antiques-episode-list
|
||||
|
||||
doorID = 0
|
19
main.py
19
main.py
@ -32,6 +32,7 @@ This works with both FIDO 2.0 devices as well as with U2F devices.
|
||||
On Windows, the native WebAuthn API will be used.
|
||||
"""
|
||||
import time
|
||||
import configparser
|
||||
import RPi.GPIO as GPIO
|
||||
import pickle
|
||||
import psycopg2
|
||||
@ -44,7 +45,15 @@ import sys
|
||||
import ctypes
|
||||
from fido2.ctap2 import Ctap2
|
||||
|
||||
DOOR_ID = 0
|
||||
config = configparser.ConfigParser()
|
||||
|
||||
config.read('config.txt')
|
||||
|
||||
dbusername = config.get('config', 'dbusername')
|
||||
dbpassword = config.get('config', 'dbpassword')
|
||||
dbname = config.get('config', 'dbname')
|
||||
dbhost = config.get('config', 'dbhost')
|
||||
doorID = config.get('config', 'doorID')
|
||||
|
||||
gotAaguid = None
|
||||
GPIO.setmode(GPIO.BCM)
|
||||
@ -113,10 +122,10 @@ while True:
|
||||
|
||||
|
||||
# Replace these variables with your connection parameters
|
||||
dbname = "CNSA-276-FP-DAS"
|
||||
user = "FP-DEV-USER"
|
||||
password = "purchase-immortal-prescribe-repave-detention-seizing-candied-antiques-episode-list"
|
||||
host = "postgres.eggtech.net"
|
||||
|
||||
user = dbusername
|
||||
password = dbpassword
|
||||
host = dbhost
|
||||
|
||||
# Define the SQL query for retrieving data
|
||||
select_query = '''
|
||||
|
Loading…
Reference in New Issue
Block a user