Spaces:
Sleeping
Sleeping
github-actions[bot]
chore: Sync deployment files to HF Space (excludes test data to stay within storage limits)
b25b944 Download scripts/utils/encode_password.py from f007kht/osprey-experimental: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/spaces/f007kht/osprey-experimental/resolve/main/scripts/utils/encode_password.py
- Command line
-
hf download hf://spaces/f007kht/osprey-experimental/scripts/utils/encode_password.py
-
curl -L -o encode_password.py https://huggingface.co/spaces/f007kht/osprey-experimental/resolve/main/scripts/utils/encode_password.py
1.03 kB
| #!/usr/bin/env python3 | |
| """ | |
| Secure password URL encoder for MongoDB connection strings. | |
| Uses getpass to prevent password from appearing in terminal history. | |
| """ | |
| import getpass | |
| import urllib.parse | |
| import sys | |
| def main(): | |
| print("MongoDB Password URL Encoder", file=sys.stderr) | |
| print("=" * 40, file=sys.stderr) | |
| print("Enter your MongoDB password (input will be hidden):", file=sys.stderr) | |
| password = getpass.getpass("Password: ") | |
| if not password: | |
| print("ERROR: Empty password provided", file=sys.stderr) | |
| sys.exit(1) | |
| encoded = urllib.parse.quote_plus(password) | |
| # Only print the encoded password (no echo of original) | |
| print(encoded) | |
| # Show confirmation (without revealing password) | |
| print(f"\n✓ Password encoded successfully (length: {len(encoded)} chars)", file=sys.stderr) | |
| print("Copy the encoded password above and use it in your connection string.", file=sys.stderr) | |
| if __name__ == "__main__": | |
| main() | |