Centralized Code Search: Deploying the Probe Web Interface
This guide explains how to set up and deploy Probe's web interface as a centralized code search and intelligence platform for your entire organization.
Overview
Probe's web interface provides a user-friendly chat experience that allows all team members to interact with your codebase using AI. By hosting this interface, you create a source of truth for how your product works that's accessible to both technical and non-technical team members. This enables quick issue resolution, documentation generation, architecture understanding, and helps product managers, QA teams, and other stakeholders make informed decisions without needing to understand implementation details.
Docker-Based Setup
The most reliable way to deploy Probe's web interface for a team is using Docker:
1. Create a Docker Deployment
# Clone the repository if you haven't already
git clone https://github.com/buger/probe.git
cd probe/examples/web
# Build the Docker image
docker build -t probe-web-interface .
2
3
4
5
6
2. Run the Container
# Run the container with appropriate configuration
docker run -p 8080:8080 \
-e ANTHROPIC_API_KEY=your_anthropic_api_key \
-e ALLOWED_FOLDERS=/app/code \
-e AUTH_ENABLED=true \
-e AUTH_USERNAME=team \
-e AUTH_PASSWORD=secure_password \
-v /path/to/your/repos:/app/code \
probe-web-interface
2
3
4
5
6
7
8
9
3. Access the Web Interface
Once the container is running, team members can access the web interface at:
http://your-server-ip:8080
Setting Allowed Folders (Security & Privacy)
Controlling which code repositories are accessible is crucial for security:
Configuring Allowed Folders
# Specify which folders can be searched
export ALLOWED_FOLDERS=/path/to/repo1,/path/to/repo2,/path/to/repo3
2
This environment variable:
- Restricts search to only the specified directories
- Prevents access to sensitive files outside these directories
- Can include multiple repositories separated by commas
Best Practices for Folder Access
- Use Absolute Paths: Always use full paths to avoid ambiguity
- Limit Scope: Only include repositories that should be accessible
- Exclude Sensitive Directories: Don't include directories with secrets or sensitive data
- Mount Read-Only: When using Docker, consider mounting volumes as read-only:
docker run -v /path/to/your/repos:/app/code:ro ...
Managing API Keys for the Chat
The web interface requires an API key for either Anthropic Claude or OpenAI:
API Key Management
# For Anthropic Claude (recommended)
export ANTHROPIC_API_KEY=your_anthropic_api_key
# OR for OpenAI
export OPENAI_API_KEY=your_openai_api_key
2
3
4
5
Best Practices for API Keys
- Use Environment Variables: Never hardcode API keys in files
- Rotate Keys Regularly: Change keys periodically for security
- Monitor Usage: Keep track of API usage to control costs
- Use a Secrets Manager: For production deployments, consider using a secrets manager
Model Selection
You can specify which AI model to use:
# For Anthropic Claude
export MODEL_NAME=claude-3-opus-20240229
# For OpenAI
export MODEL_NAME=gpt-4o
2
3
4
5
Authentication & Environment Variables
Secure your deployment with authentication:
Enabling Authentication
# Enable basic authentication
export AUTH_ENABLED=true
export AUTH_USERNAME=your_username
export AUTH_PASSWORD=your_secure_password
2
3
4
Complete Environment Variable Reference
Variable | Description | Default |
---|---|---|
ANTHROPIC_API_KEY | Your Anthropic API key | (Required if not using OpenAI) |
OPENAI_API_KEY | Your OpenAI API key | (Required if not using Anthropic) |
ALLOWED_FOLDERS | Comma-separated list of folders to search | (Required) |
PORT | The port to run the server on | 8080 |
MODEL_NAME | Override the default model | claude-3-7-sonnet-latest or gpt-4o |
AUTH_ENABLED | Enable basic authentication | false |
AUTH_USERNAME | Username for authentication | admin |
AUTH_PASSWORD | Password for authentication | password |
DEBUG | Enable debug mode | false |
Docker Compose Example
For more complex deployments, use Docker Compose:
# docker-compose.yml
version: '3'
services:
probe-web:
build: ./examples/web
ports:
- "8080:8080"
environment:
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- ALLOWED_FOLDERS=/app/code
- AUTH_ENABLED=true
- AUTH_USERNAME=${AUTH_USERNAME}
- AUTH_PASSWORD=${AUTH_PASSWORD}
- MODEL_NAME=claude-3-sonnet-20240229
volumes:
- /path/to/your/repos:/app/code:ro
restart: unless-stopped
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Best Practices for Organization-Wide Usage
Cross-Functional Team Onboarding
- Create Role-Specific Documentation: Tailor guides for different roles (developers, product managers, QA)
- Provide Example Queries: Share effective prompts and questions for common use cases
- Set Usage Guidelines: Establish best practices for different types of searches
- Training Sessions: Conduct role-specific training for technical and non-technical users
- Highlight Business Benefits: Demonstrate how code search improves collaboration and knowledge sharing
Performance Optimization
- Limit Repository Size: Include only necessary repositories
- Use a Powerful Server: Ensure adequate CPU and memory
- Consider SSD Storage: Faster disk access improves search performance
- Regular Maintenance: Update the Docker image and dependencies
Security Considerations
- Network Security: Use a reverse proxy with HTTPS
- IP Restrictions: Limit access to your company network
- Regular Updates: Keep the software updated
- Audit Logs: Monitor access and usage
Example Nginx Configuration
server {
listen 443 ssl;
server_name code-chat.yourcompany.com;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
# Rate limiting
limit_req zone=one burst=10 nodelay;
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Cloud Deployment Options
For teams working remotely:
Virtual Private Server (VPS)
- Provision a VPS with adequate resources
- Install Docker and Docker Compose
- Deploy using the Docker Compose configuration above
- Set up a domain name and SSL certificate
- Configure a reverse proxy for HTTPS
Kubernetes Deployment
For larger organizations:
# probe-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: probe-web
spec:
replicas: 1
selector:
matchLabels:
app: probe-web
template:
metadata:
labels:
app: probe-web
spec:
containers:
- name: probe-web
image: your-registry/probe-web-interface:latest
ports:
- containerPort: 8080
env:
- name: ANTHROPIC_API_KEY
valueFrom:
secretKeyRef:
name: probe-secrets
key: anthropic-api-key
- name: ALLOWED_FOLDERS
value: "/app/code"
- name: AUTH_ENABLED
value: "true"
- name: AUTH_USERNAME
valueFrom:
secretKeyRef:
name: probe-secrets
key: auth-username
- name: AUTH_PASSWORD
valueFrom:
secretKeyRef:
name: probe-secrets
key: auth-password
volumeMounts:
- name: code-volume
mountPath: /app/code
readOnly: true
volumes:
- name: code-volume
persistentVolumeClaim:
claimName: code-pvc
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Monitoring and Maintenance
Usage Monitoring
- API Usage: Monitor API costs and usage
- Server Resources: Track CPU, memory, and disk usage
- User Activity: Monitor access logs and usage patterns
Regular Updates
- Update Docker Image: Regularly rebuild with the latest code
- Update Dependencies: Keep Node.js and other dependencies updated
- Rotate Credentials: Change API keys and passwords periodically
Next Steps
- For individual developer workflows, see Integrating Probe into AI Code Editors
- For advanced CLI usage, check out CLI AI Workflows
- For programmatic access, explore Building AI Tools on Probe