Your Name commited on
Commit Β·
e4867ad
1
Parent(s): a79ea2b
clear
Browse files7 unmodified lines891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192117 unmodified linesapp_port: 7860---
# Open WebUI with Cloudflare Tunnel
This is a secure deployment of Open WebUI that uses Cloudflare Tunnel for enhanced privacy and security.
## Architecture
- **Frontend**: Simple HTML page displayed on Hugging Face Spaces (port 7860)- **Backend**: Open WebUI service running internally (port 8080)- **Tunnel**: Cloudflare Tunnel for secure external access- **Backup**: WebDAV synchronization for data persistence
## Environment Variables
### Required for Cloudflare Tunnel- `TUNNEL_TOKEN`: Your Cloudflare Tunnel token
### Optional for Data Backup- `WEBDAV_URL`: WebDAV server URL- `WEBDAV_USERNAME`: WebDAV username- `WEBDAV_PASSWORD`: WebDAV password- `WEBDAV_BACKUP_PATH`: Backup path (optional)- `SYNC_INTERVAL`: Sync interval in seconds (default: 600)
## Security Features
- β
End-to-end encrypted tunnel- β
Private backend deployment- β
Automatic data backup- β
No direct exposure of Open WebUI
## Setup Instructions
1. Create a Cloudflare Tunnel and get your token2. Set the `TUNNEL_TOKEN` environment variable3. Configure WebDAV settings for backup (optional)4. Deploy to Hugging Face Spaces
The frontend will show a status page while the actual Open WebUI runs securely through the tunnel.
## Troubleshooting
### Common Issues and Fixes
#### 1. Permission Denied Errors- **Problem**: `/var/www/html/index.html: Permission denied`- **Fix**: The script now automatically falls back to `/tmp/www/` if `/var/www/html/` is not writable
#### 2. Open WebUI Not Starting- **Problem**: `./start.sh: No such file or directory`- **Fix**: The script now checks multiple possible locations for the Open WebUI startup script: - `/app/backend/start.sh` - `/app/start.sh` - `open-webui` command - Direct Python execution
#### 3. Service Status MonitoringThe script provides detailed status monitoring:- β
Nginx (Frontend): Running- β Open WebUI: Stopped- β
Cloudflare Tunnel: Running
#### 4. Debug ToolsRun the test script to check your environment:```bash./runtime_test.sh```
### Logs Location- Nginx logs: `/tmp/nginx_error.log`, `/tmp/nginx_access.log`- Cloudflare Tunnel logs: `/tmp/cloudflared.log`
## Version History
### v2.1 (Current)- β
**FIXED**: Syntax error in start.sh (line 104)- β
**FIXED**: Permission issues with HTML file creation- β
**FIXED**: HERE document syntax in bash script- β
Improved Open WebUI startup detection with multiple fallback methods- β
Added automatic fallback from `/var/www/html` to `/tmp/www`- β
Enhanced error handling and logging- β
Added runtime environment testing tools- β
Improved HTML content with proper service informationclearREADME.md+1-82