mirror of
https://github.com/WGDashboard/WGDashboard-PRW.git
synced 2026-08-03 22:42:57 +00:00
chore: add more debug lines
This commit is contained in:
+2
-2
@@ -25,10 +25,10 @@ log_level = DEBUG
|
|||||||
|
|
||||||
[account]
|
[account]
|
||||||
username = dselen
|
username = dselen
|
||||||
password = $2b$12$bUcVL2v0OoJnraXtx.mHsOKFRnKEf/kmewqKXHOebitDZcJviPusm
|
password = $2b$12$LId4p4WP3N0RLFi/TjNxseA1U.yybg2bJ8ufvcbpclUxckEX6OH.y
|
||||||
enable_totp = False
|
enable_totp = False
|
||||||
totp_verified = False
|
totp_verified = False
|
||||||
totp_key = CEBHHGL4HLYUDYXKTLIL34SVLXYPVHIO
|
totp_key = NY7VFZFYIUM7FUZCDW7UMXQ7DMGGLSJU
|
||||||
|
|
||||||
[other]
|
[other]
|
||||||
welcome_session = False
|
welcome_session = False
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ if __name__ == '__main__':
|
|||||||
# Read the config file (ini)
|
# Read the config file (ini)
|
||||||
ok, config_data = config.read()
|
ok, config_data = config.read()
|
||||||
if not ok:
|
if not ok:
|
||||||
|
log.error("failed to read the config from disk")
|
||||||
exit(1)
|
exit(1)
|
||||||
found, config_server = config.filter(config_data, 'SERVER')
|
found, config_server = config.filter(config_data, 'SERVER')
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ class config():
|
|||||||
|
|
||||||
ok, config_data = config_utils.read_data(candidate_path)
|
ok, config_data = config_utils.read_data(candidate_path)
|
||||||
if not ok:
|
if not ok:
|
||||||
|
log.error("failed to read data from filepath")
|
||||||
return False, {}
|
return False, {}
|
||||||
|
|
||||||
return True, config_data
|
return True, config_data
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ class database():
|
|||||||
def create_session(database_config: dict) -> tuple[bool, sqlalchemy.engine.Engine | None, sqlalchemy.orm.Session | None]:
|
def create_session(database_config: dict) -> tuple[bool, sqlalchemy.engine.Engine | None, sqlalchemy.orm.Session | None]:
|
||||||
ok, connection_string = database_utils.generate_connection_string(database_config)
|
ok, connection_string = database_utils.generate_connection_string(database_config)
|
||||||
if not ok:
|
if not ok:
|
||||||
|
log.error("failed to generate the connection string")
|
||||||
return False, None, None
|
return False, None, None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ class localeman:
|
|||||||
def get_language(self):
|
def get_language(self):
|
||||||
ok, server_config = config.filter(self.wgd_config, "SERVER")
|
ok, server_config = config.filter(self.wgd_config, "SERVER")
|
||||||
if not ok:
|
if not ok:
|
||||||
|
log.error("failed to filter the config in-memory")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
lang = server_config.get("wgdashboard_language", "en")
|
lang = server_config.get("wgdashboard_language", "en")
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ def api_welcome_get_totp():
|
|||||||
if "totp_verified" not in config_account or not config_account["totp_verified"]:
|
if "totp_verified" not in config_account or not config_account["totp_verified"]:
|
||||||
totp_key = pyotp.random_base32()
|
totp_key = pyotp.random_base32()
|
||||||
|
|
||||||
log.debug(totp_key)
|
|
||||||
ok = config.update('ACCOUNT', 'totp_key', totp_key)
|
ok = config.update('ACCOUNT', 'totp_key', totp_key)
|
||||||
if not ok:
|
if not ok:
|
||||||
log.error("failed to update the key in the configuration file")
|
log.error("failed to update the key in the configuration file")
|
||||||
|
|||||||
Reference in New Issue
Block a user