Files
t6_mem0/update_caddy_config.sh
Docker Config Backup 41cd78207a Integrate self-hosted Supabase with mem0 system
- Configure mem0 to use self-hosted Supabase instead of Qdrant for vector storage
- Update docker-compose to connect containers to localai network
- Install vecs library for Supabase pgvector integration
- Create comprehensive test suite for Supabase + mem0 integration
- Update documentation to reflect Supabase configuration
- All containers now connected to shared localai network
- Successful vector storage and retrieval tests completed

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-31 06:57:10 +02:00

72 lines
2.5 KiB
Bash
Executable File

#!/bin/bash
# Backup current Caddyfile
sudo cp /etc/caddy/Caddyfile /etc/caddy/Caddyfile.backup.$(date +%Y%m%d_%H%M%S)
# Create new docs.klas.chat configuration for Mintlify proxy
cat > /tmp/docs_config << 'EOF'
docs.klas.chat {
tls /certs/klas.chat/fullchain.cer /certs/klas.chat/klas.chat.key
# Basic Authentication
basicauth * {
langmem $2a$14$.1fx02QwkkmfezhZMLE4Iu2N/ub5vwDSAtcH9lAa5z11ChjiYy1PG
}
# Security headers
header {
X-Frame-Options "DENY"
X-Content-Type-Options "nosniff"
X-XSS-Protection "1; mode=block"
Referrer-Policy "strict-origin-when-cross-origin"
Strict-Transport-Security "max-age=31536000; includeSubDomains"
Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.jsdelivr.net https://unpkg.com; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://unpkg.com; img-src 'self' data: https:; font-src 'self' data: https:; connect-src 'self' ws: wss:;"
}
# Proxy to Mintlify development server
reverse_proxy localhost:3003
# Enable compression
encode gzip
}
EOF
# Replace the docs.klas.chat section in Caddyfile
sudo sed -i '/^docs\.klas\.chat {/,/^}/c\
docs.klas.chat {\
tls /certs/klas.chat/fullchain.cer /certs/klas.chat/klas.chat.key\
\
# Basic Authentication\
basicauth * {\
langmem $2a$14$.1fx02QwkkmfezhZMLE4Iu2N\/ub5vwDSAtcH9lAa5z11ChjiYy1PG\
}\
\
# Security headers\
header {\
X-Frame-Options "DENY"\
X-Content-Type-Options "nosniff"\
X-XSS-Protection "1; mode=block"\
Referrer-Policy "strict-origin-when-cross-origin"\
Strict-Transport-Security "max-age=31536000; includeSubDomains"\
Content-Security-Policy "default-src '\''self'\''; script-src '\''self'\'' '\''unsafe-inline'\'' '\''unsafe-eval'\'' https://cdn.jsdelivr.net https://unpkg.com; style-src '\''self'\'' '\''unsafe-inline'\'' https://cdn.jsdelivr.net https://unpkg.com; img-src '\''self'\'' data: https:; font-src '\''self'\'' data: https:; connect-src '\''self'\'' ws: wss:;"\
}\
\
# Proxy to Mintlify development server\
reverse_proxy localhost:3003\
\
# Enable compression\
encode gzip\
}' /etc/caddy/Caddyfile
echo "✅ Caddy configuration updated to proxy docs.klas.chat to localhost:3003"
echo "🔄 Reloading Caddy configuration..."
sudo systemctl reload caddy
if [ $? -eq 0 ]; then
echo "✅ Caddy reloaded successfully"
echo "🌐 Documentation should now be available at: https://docs.klas.chat"
else
echo "❌ Failed to reload Caddy. Check configuration:"
sudo caddy validate --config /etc/caddy/Caddyfile
fi