#!/bin/bash # SearXNG Deployment Script for Hugging Face Spaces # Usage: ./deploy.sh set -e echo "๐Ÿš€ Deploying SearXNG to Hugging Face Spaces" echo "==============================================" # Check if git is installed if ! command -v git &> /dev/null; then echo "โŒ Error: git is not installed" exit 1 fi # Check if we're in the right directory if [ ! -f "Dockerfile" ]; then echo "โŒ Error: Dockerfile not found. Are you in the searxng-hf-space directory?" exit 1 fi # Initialize git if not already initialized if [ ! -d ".git" ]; then echo "๐Ÿ“ฆ Initializing git repository..." git init else echo "โœ… Git repository already initialized" fi # Add all files echo "๐Ÿ“ Adding files to git..." git add . # Check if there are changes to commit if git diff --staged --quiet; then echo "โ„น๏ธ No changes to commit" else # Commit changes 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 # Check if remote exists 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 # Push to Hugging Face 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 "=============================================="