Services
Configure external services that SPEAR relies on for email delivery, file storage, and other functionality.
Available Services
Section titled “Available Services”| Service | Purpose | Required |
|---|---|---|
| SMTP | Email delivery | Optional |
| S3 Storage | Backup storage | Optional |
| File Storage | Local file settings | Configured |
SMTP Configuration
Section titled “SMTP Configuration”SMTP enables email functionality for password resets, notifications, and report sharing.
Settings
Section titled “Settings”Navigate to Admin > Services > SMTP
| Setting | Description | Example |
|---|---|---|
| Host | SMTP server hostname | smtp.gmail.com |
| Port | SMTP port | 587 |
| Username | Authentication username | noreply@company.com |
| Password | Authentication password | app-password |
| Sender Name | Display name for emails | SPEAR Notifications |
| Sender Email | From address | noreply@company.com |
| Encryption | TLS/STARTTLS/None | STARTTLS |
Common Provider Settings
Section titled “Common Provider Settings”Gmail / Google Workspace:
Host: smtp.gmail.comPort: 587Encryption: STARTTLSUsername: your-email@gmail.comPassword: App Password (not regular password)Microsoft 365:
Host: smtp.office365.comPort: 587Encryption: STARTTLSUsername: your-email@company.comPassword: App Password or OAuth tokenAmazon SES:
Host: email-smtp.us-east-1.amazonaws.comPort: 587Encryption: STARTTLSUsername: SMTP credentials from SES consolePassword: SMTP credentials from SES consoleSendGrid:
Host: smtp.sendgrid.netPort: 587Encryption: STARTTLSUsername: apikeyPassword: Your SendGrid API keyTesting SMTP
Section titled “Testing SMTP”- Configure all settings
- Click Test Connection
- Enter a test email address
- Click Send Test
- Verify email received
Troubleshooting SMTP
Section titled “Troubleshooting SMTP”Connection timeout:
- Verify hostname and port
- Check firewall rules
- Try alternate ports (465, 25)
Authentication failed:
- Verify username and password
- For Gmail, use App Password
- Check if account allows SMTP access
SSL/TLS errors:
- Try different encryption options
- Verify certificate is valid
- Check for proxy interference
S3-Compatible Storage
Section titled “S3-Compatible Storage”Configure external storage for backups and large file storage.
Settings
Section titled “Settings”Navigate to Admin > Services > Storage
| Setting | Description |
|---|---|
| Provider | S3, MinIO, Backblaze B2, etc. |
| Endpoint | S3-compatible endpoint URL |
| Region | Storage region |
| Bucket | Bucket name |
| Access Key | Access key ID |
| Secret Key | Secret access key |
| Path Prefix | Optional folder prefix |
Provider Examples
Section titled “Provider Examples”AWS S3:
Endpoint: https://s3.amazonaws.comRegion: us-east-1Bucket: your-bucket-nameAccess Key: AKIAIOSFODNN7EXAMPLESecret Key: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEYMinIO (Self-hosted):
Endpoint: https://minio.yourserver.comRegion: us-east-1Bucket: spear-backupsAccess Key: minioadminSecret Key: minioadminBackblaze B2:
Endpoint: https://s3.us-west-002.backblazeb2.comRegion: us-west-002Bucket: your-bucket-nameAccess Key: keyID from B2Secret Key: applicationKey from B2DigitalOcean Spaces:
Endpoint: https://nyc3.digitaloceanspaces.comRegion: nyc3Bucket: your-space-nameAccess Key: Spaces access keySecret Key: Spaces secret keyCloudflare R2:
Endpoint: https://your-account-id.r2.cloudflarestorage.comRegion: autoBucket: your-bucket-nameAccess Key: R2 access keySecret Key: R2 secret keyTesting Storage Connection
Section titled “Testing Storage Connection”- Configure all settings
- Click Test Connection
- System uploads a small test file
- Verify test succeeds
- Save configuration
Storage Usage
Section titled “Storage Usage”S3 storage is used for:
- Automated backups (if configured)
- Large file offloading (optional)
- Backup export destination
File Storage Settings
Section titled “File Storage Settings”Configure local file storage behavior.
Settings
Section titled “Settings”Navigate to Admin > Services > Files
| Setting | Description | Default |
|---|---|---|
| Max Upload Size | Maximum file upload size | 50MB |
| Allowed Types | Permitted file extensions | images, documents |
| Storage Path | Local storage directory | ./pb_data/storage |
File Type Restrictions
Section titled “File Type Restrictions”Configure allowed file types by category:
| Category | Extensions |
|---|---|
| Images | .jpg, .jpeg, .png, .gif, .svg, .webp |
| Documents | .pdf, .doc, .docx, .xls, .xlsx |
| Archives | .zip, .tar, .gz |
| Data | .json, .xml, .csv |
Storage Cleanup
Section titled “Storage Cleanup”Configure automatic cleanup of temporary files:
| Setting | Description |
|---|---|
| PDF Export Retention | Days to keep exported PDFs |
| Upload Temp Retention | Days to keep temporary uploads |
| Orphaned File Cleanup | Remove unreferenced files |
Service Health Monitoring
Section titled “Service Health Monitoring”Status Dashboard
Section titled “Status Dashboard”View service health at Admin > Services > Status
| Service | Indicators |
|---|---|
| SMTP | Last successful send, error rate |
| S3 Storage | Connection status, last backup |
| Database | Size, connection count |
| Background Jobs | Queue length, processing rate |
Alerts
Section titled “Alerts”Configure alerts for service issues:
- Navigate to Admin > Services > Alerts
- Enable alerts for critical services
- Set notification threshold
- Configure notification method (email if SMTP configured)
Environment Variables
Section titled “Environment Variables”Services can also be configured via environment variables:
SMTP_HOST=smtp.example.comSMTP_PORT=587SMTP_USERNAME=user@example.comSMTP_PASSWORD=passwordSMTP_SENDER_NAME="SPEAR"SMTP_SENDER_EMAIL=noreply@example.comS3 Storage
Section titled “S3 Storage”S3_ENDPOINT=https://s3.amazonaws.comS3_REGION=us-east-1S3_BUCKET=your-bucketS3_ACCESS_KEY=your-access-keyS3_SECRET_KEY=your-secret-keyEnvironment variables override database configuration.
Best Practices
Section titled “Best Practices”- Use dedicated email service (SendGrid, SES) for production
- Create application-specific passwords
- Set up SPF/DKIM/DMARC for deliverability
- Monitor bounce and complaint rates
S3 Storage
Section titled “S3 Storage”- Use separate bucket for SPEAR
- Enable versioning for backup protection
- Set up lifecycle policies for cost management
- Use IAM with minimal required permissions
Security
Section titled “Security”- Never commit credentials to version control
- Use environment variables for sensitive settings
- Rotate access keys regularly
- Audit service access logs