5d568f7f89
- 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.
35 lines
809 B
Python
35 lines
809 B
Python
import os
|
|
import subprocess
|
|
import time
|
|
import sys
|
|
import platform
|
|
|
|
APP_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../app.py"))
|
|
|
|
def start_prod():
|
|
env = os.environ.copy()
|
|
env["PRODUCTION"] = "true"
|
|
|
|
if platform.system() == "Windows":
|
|
return subprocess.Popen(
|
|
["python", APP_PATH],
|
|
env=env,
|
|
stdout=subprocess.DEVNULL,
|
|
stderr=subprocess.DEVNULL
|
|
)
|
|
else:
|
|
return subprocess.Popen(
|
|
["python3", APP_PATH],
|
|
env=env,
|
|
preexec_fn=os.setsid,
|
|
stdout=subprocess.DEVNULL,
|
|
stderr=subprocess.DEVNULL
|
|
)
|
|
|
|
def main():
|
|
print("[*] Starting PacCrypt in PRODUCTION mode with Waitress...")
|
|
start_prod()
|
|
|
|
if __name__ == "__main__":
|
|
main()
|