- Added copy quote functionality with clipboard integration - Implemented bulk moderation actions for admin - Created mobile responsive design with bash.org styling - Added API rate limiting per IP address - Implemented dark mode toggle with flash prevention - Enhanced error messages throughout application - Fixed all security vulnerabilities (SQL injection, XSS, CSRF) - Added comprehensive rate limiting on all endpoints - Implemented secure session configuration - Added input validation and length limits - Created centralized configuration system with config.json - Set up production deployment with Gunicorn - Added security headers and production hardening - Added password generation and config management tools
36 lines
971 B
Python
36 lines
971 B
Python
#!/usr/bin/env python3
|
|
"""
|
|
Password hash generator for ircquotes admin.
|
|
Generates Argon2 password hashes for secure storage.
|
|
"""
|
|
|
|
from argon2 import PasswordHasher
|
|
import getpass
|
|
import sys
|
|
|
|
def generate_password_hash():
|
|
"""Generate an Argon2 password hash."""
|
|
ph = PasswordHasher()
|
|
|
|
if len(sys.argv) > 1:
|
|
# Password provided as argument
|
|
password = sys.argv[1]
|
|
else:
|
|
# Prompt for password securely
|
|
password = getpass.getpass("Enter admin password: ")
|
|
confirm = getpass.getpass("Confirm password: ")
|
|
|
|
if password != confirm:
|
|
print("Passwords don't match!")
|
|
return
|
|
|
|
# Generate hash
|
|
hash_value = ph.hash(password)
|
|
|
|
print("\nGenerated password hash:")
|
|
print(hash_value)
|
|
print("\nTo set this as admin password, run:")
|
|
print(f'python config_manager.py admin.password_hash "{hash_value}"')
|
|
|
|
if __name__ == "__main__":
|
|
generate_password_hash() |