mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-07-06 18:01:18 +02:00
2fa.ini
This commit is contained in:
+2
-3
@@ -89,9 +89,8 @@ def call_external_script(message, script="script/runShell.sh"):
|
||||
logger.warning(f"FileMon: Error calling external script: {e}")
|
||||
return None
|
||||
|
||||
xCmd2factor = True # Enable 2FA for x: commands
|
||||
|
||||
waitingXroom = {} # {message_from_id: (expected_answer, original_command, timestamp)}
|
||||
xCmd2factor_timeout = 100 # seconds
|
||||
def handleShellCmd(message, message_from_id, channel_number, isDM, deviceID):
|
||||
if not allowXcmd:
|
||||
return "x: command is disabled"
|
||||
@@ -102,7 +101,7 @@ def handleShellCmd(message, message_from_id, channel_number, isDM, deviceID):
|
||||
return "x: command not authorized in group chat"
|
||||
|
||||
# 2FA logic
|
||||
if xCmd2factor:
|
||||
if xCmd2factorEnabled:
|
||||
timeNOW = datetime.utcnow()
|
||||
# If user is waiting for 2FA, treat message as answer
|
||||
if message_from_id in waitingXroom:
|
||||
|
||||
@@ -373,6 +373,8 @@ try:
|
||||
news_random_line_only = config['fileMon'].getboolean('news_random_line', False) # default False
|
||||
enable_runShellCmd = config['fileMon'].getboolean('enable_runShellCmd', False) # default False
|
||||
allowXcmd = config['fileMon'].getboolean('allowXcmd', False) # default False
|
||||
xCmd2factorEnabled = config['fileMon'].getboolean('2factor_enabled', False) # default False
|
||||
xCmd2factor_timeout = config['fileMon'].getint('2factor_timeout', 100) # default 100 seconds
|
||||
|
||||
# games
|
||||
game_hop_limit = config['games'].getint('game_hop_limit', 5) # default 5 hops
|
||||
|
||||
@@ -49,7 +49,6 @@ def cleanup_memory():
|
||||
if cleaned_count > 0:
|
||||
logger.debug(f"System: Cleaned up {cleaned_count} stale entries from waitingXroom")
|
||||
|
||||
|
||||
# Clean up old seenNodes entries
|
||||
if 'seenNodes' in globals():
|
||||
initial_count = len(seenNodes)
|
||||
|
||||
Reference in New Issue
Block a user