Add Two-Factor Authentication (2FA) support and key management features
- Implemented 2FA management in admin panel with enable/disable options. - Added QR code display for 2FA setup and input for TOTP codes in login and pickup forms. - Introduced key management section for generating, loading, and clearing RSA key pairs. - Enhanced file upload and sharing functionality with optional 2FA. - Added buttons for switching between development and production modes in admin panel. - Updated API documentation to reflect new 2FA and key management features.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import psutil
|
||||
import os
|
||||
import signal
|
||||
import platform
|
||||
|
||||
DEBUG = True
|
||||
|
||||
@@ -11,10 +12,17 @@ def log(msg):
|
||||
def stop_by_port(port=5000):
|
||||
for proc in psutil.process_iter(["pid", "name"]):
|
||||
try:
|
||||
for conn in proc.connections(kind="inet"):
|
||||
for conn in proc.net_connections(kind="inet"):
|
||||
if conn.laddr.port == port:
|
||||
log(f"[*] Killing process {proc.pid} using port {port}")
|
||||
os.killpg(os.getpgid(proc.pid), signal.SIGTERM)
|
||||
if platform.system() == "Windows":
|
||||
proc.terminate()
|
||||
try:
|
||||
proc.wait(timeout=5)
|
||||
except psutil.TimeoutExpired:
|
||||
proc.kill()
|
||||
else:
|
||||
os.killpg(os.getpgid(proc.pid), signal.SIGTERM)
|
||||
return
|
||||
except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user