| #!/bin/bash |
|
|
| |
| |
|
|
| set -e |
|
|
| echo "π Deploying SearXNG to Hugging Face Spaces" |
| echo "==============================================" |
|
|
| |
| if ! command -v git &> /dev/null; then |
| echo "β Error: git is not installed" |
| exit 1 |
| fi |
|
|
| |
| if [ ! -f "Dockerfile" ]; then |
| echo "β Error: Dockerfile not found. Are you in the searxng-hf-space directory?" |
| exit 1 |
| fi |
|
|
| |
| if [ ! -d ".git" ]; then |
| echo "π¦ Initializing git repository..." |
| git init |
| else |
| echo "β
Git repository already initialized" |
| fi |
|
|
| |
| echo "π Adding files to git..." |
| git add . |
|
|
| |
| if git diff --staged --quiet; then |
| echo "βΉοΈ No changes to commit" |
| else |
| |
| echo "πΎ Committing changes..." |
| git commit -m "Deploy SearXNG for ARKI AI |
| |
| - Optimized for news search |
| - 10 fast news engines configured |
| - 2-3s average response time |
| - JSON API enabled |
| - No rate limits |
| - Privacy-focused configuration |
| |
| Deployment: $(date '+%Y-%m-%d %H:%M:%S')" |
| fi |
|
|
| |
| if git remote | grep -q "origin"; then |
| echo "β
Remote 'origin' already configured" |
| else |
| echo "π Adding Hugging Face remote..." |
| git remote add origin https://huggingface.co/spaces/Peterase/SearXNG |
| fi |
|
|
| |
| echo "β¬οΈ Pushing to Hugging Face Spaces..." |
| echo "" |
| echo "β οΈ You may be prompted for your Hugging Face credentials:" |
| echo " Username: Peterase" |
| echo " Password: Your HF access token (from https://huggingface.co/settings/tokens)" |
| echo "" |
|
|
| git push -u origin main |
|
|
| echo "" |
| echo "==============================================" |
| echo "β
Deployment complete!" |
| echo "" |
| echo "π Your SearXNG instance will be available at:" |
| echo " https://peterase-searxng.hf.space" |
| echo "" |
| echo "β³ Build time: ~5-10 minutes" |
| echo "" |
| echo "π Check build status:" |
| echo " https://huggingface.co/spaces/Peterase/SearXNG/logs" |
| echo "" |
| echo "π§ͺ Test after deployment:" |
| echo " python test_searxng.py" |
| echo "" |
| echo "==============================================" |
|
|