Spaces:
Sleeping
Sleeping
Download scripts/setup_validation.py from virustechhacks/Duo-Guardian: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/spaces/virustechhacks/Duo-Guardian/resolve/main/scripts/setup_validation.py
- Command line
-
hf download hf://spaces/virustechhacks/Duo-Guardian/scripts/setup_validation.py
-
curl -L -o setup_validation.py https://huggingface.co/spaces/virustechhacks/Duo-Guardian/resolve/main/scripts/setup_validation.py
1.1 kB
| import os | |
| import sys | |
| from dotenv import load_dotenv | |
| def check_env(): | |
| load_dotenv() | |
| print("--- 🔍 GitLab Context Brain: Setup Validation ---\n") | |
| checks = { | |
| "GITLAB_TOKEN": os.getenv("GITLAB_TOKEN"), | |
| "GOOGLE_API_KEY": os.getenv("GOOGLE_API_KEY"), | |
| "GCP_PROJECT_ID": os.getenv("GCP_PROJECT_ID"), | |
| "GOOGLE_APPLICATION_CREDENTIALS": os.getenv("GOOGLE_APPLICATION_CREDENTIALS") | |
| } | |
| all_passed = True | |
| for var, val in checks.items(): | |
| status = "✅ Found" if val else "❌ Missing" | |
| if not val and var in ["GITLAB_TOKEN", "GOOGLE_API_KEY"]: | |
| status += " (REQUIRED)" | |
| all_passed = False | |
| elif not val: | |
| status += " (OPTIONAL - GCP features disabled)" | |
| print(f"{var:30} : {status}") | |
| if all_passed: | |
| print("\n🎉 Basic environment is ready! You can now run the Context Brain.") | |
| else: | |
| print("\n⚠️ Some required variables are missing. Please check your (.env) or GitLab CI/CD settings.") | |
| sys.exit(1) | |
| if __name__ == "__main__": | |
| check_env() | |