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:
Tyler Sammons
2025-09-14 13:10:04 -10:00
parent 36cf8f18f8
commit 5d568f7f89
19 changed files with 2625 additions and 990 deletions
+29
View File
@@ -45,8 +45,24 @@
<!-- File Info -->
<div class="form-group">
<p style="color: #00ff99; margin-bottom: 15px;">File ID: <code>{{ file_id }}</code></p>
{% if require_2fa %}
<p style="color: #ffaa00; margin-bottom: 15px;">🔒 This file requires 2FA (TOTP) authentication.</p>
{% endif %}
</div>
{% if require_2fa %}
<div class="form-group" style="border: 2px solid #ffaa00; padding: 15px; margin-bottom: 20px; border-radius: 5px;">
<h3 style="color: #ffaa00; margin-top: 0;">⚠️ 2FA Required</h3>
<p style="color: #ccc;">
<strong>You should have already set up 2FA when uploading this file.</strong><br>
Enter the 6-digit code from your authenticator app below.
</p>
<p style="color: #ff6b6b; font-size: 0.9em;">
If you didn't set up 2FA during upload, you won't be able to access this file.
</p>
</div>
{% endif %}
<!-- Pickup Form -->
<form method="POST" class="form-group">
<div class="form-group">
@@ -65,6 +81,19 @@
autocomplete="off" />
</div>
{% if require_2fa %}
<div class="form-group">
<input type="text"
name="totp_code"
placeholder="6-Digit Authenticator Code"
required
maxlength="6"
pattern="[0-9]{6}"
autocomplete="off"
style="text-align: center; font-size: 1.2em; letter-spacing: 0.2em;" />
</div>
{% endif %}
<div class="button-group">
<button type="submit">Decrypt and Download</button>
</div>