Spaces:
Running
Running
Download scripts/hash_generator.py from RamkumarShan/portiq-backend: direct link, hf CLI and curl.
- Browser
- Download file 726 Bytes
-
https://huggingface.co/spaces/RamkumarShan/portiq-backend/resolve/main/scripts/hash_generator.py
- Command line
-
hf download hf://spaces/RamkumarShan/portiq-backend/scripts/hash_generator.py
-
curl -L -o hash_generator.py https://huggingface.co/spaces/RamkumarShan/portiq-backend/resolve/main/scripts/hash_generator.py
726 Bytes
| """ | |
| Helper script to generate SHA-256 password hashes for use in .env. | |
| Usage: | |
| python scripts/hash_generator.py | |
| Copy the output hash into OWNER_PASSWORD_HASH or GUEST_PASSWORD_HASH in your .env file. | |
| """ | |
| import hashlib | |
| import getpass | |
| def main(): | |
| print("--- PortIQ Password Hash Generator ---") | |
| password = getpass.getpass("Enter your desired password: ") | |
| confirm = getpass.getpass("Confirm password: ") | |
| if password != confirm: | |
| print("Error: Passwords do not match!") | |
| return | |
| hashed = hashlib.sha256(password.encode('utf-8')).hexdigest() | |
| print("\nSuccess! Add the following line to your .env file:") | |
| print(f"APP_PASSWORD_HASH={hashed}") | |
| if __name__ == "__main__": | |
| main() | |