# Blockscout Explorer - Cloudflare Configuration Guide

**Date**: $(date)  
**Status**: ⚠️ **MANUAL CONFIGURATION REQUIRED**

---

## Configuration Required

Since Cloudflare API token is not available, manual configuration is required through the Cloudflare dashboard.

---

## Step 1: Configure DNS Record

### In Cloudflare DNS Dashboard

1. **Go to**: https://dash.cloudflare.com/
2. **Select domain**: `d-bis.org`
3. **Navigate to**: **DNS** → **Records**
4. **Click**: **Add record**

5. **Configure**:
   ```
   Type: CNAME
   Name: explorer
   Target: 10ab22da-8ea3-4e2e-a896-27ece2211a05.cfargotunnel.com
   Proxy status: 🟠 Proxied (orange cloud) - REQUIRED
   TTL: Auto
   ```

6. **Click**: **Save**

**⚠️ IMPORTANT**: Proxy status must be **🟠 Proxied** (orange cloud) for the tunnel to work!

---

## Step 2: Configure Tunnel Route

### In Cloudflare Zero Trust Dashboard

1. **Go to**: https://one.dash.cloudflare.com/
2. **Navigate to**: **Zero Trust** → **Networks** → **Tunnels**
3. **Select your tunnel**: Find tunnel ID `10ab22da-8ea3-4e2e-a896-27ece2211a05`
4. **Click**: **Configure** button
5. **Click**: **Public Hostnames** tab
6. **Click**: **Add a public hostname**

7. **Configure**:
   ```
   Subdomain: explorer
   Domain: d-bis.org
   Service: http://192.168.11.140:80
   Type: HTTP
   ```

8. **Click**: **Save hostname**

---

## Step 3: Verify Configuration

### Wait for DNS Propagation (1-5 minutes)

Then test:

```bash
# Test DNS resolution
dig explorer.d-bis.org
nslookup explorer.d-bis.org

# Should resolve to Cloudflare IPs (if proxied)

# Test HTTPS endpoint
curl -I https://explorer.d-bis.org
curl https://explorer.d-bis.org/health

# Should return Blockscout API response
```

---

## Configuration Summary

| Setting | Value |
|---------|-------|
| **Domain** | explorer.d-bis.org |
| **DNS Type** | CNAME |
| **DNS Target** | 10ab22da-8ea3-4e2e-a896-27ece2211a05.cfargotunnel.com |
| **Proxy Status** | 🟠 Proxied (required) |
| **Tunnel ID** | 10ab22da-8ea3-4e2e-a896-27ece2211a05 |
| **Tunnel Service** | http://192.168.11.140:80 |
| **Tunnel Type** | HTTP |

---

## Automated Configuration (Optional)

If you want to configure DNS automatically via API in the future:

1. **Create Cloudflare API Token**:
   - Go to: https://dash.cloudflare.com/profile/api-tokens
   - Create token with permissions:
     - Zone → DNS → Edit
     - Account → Cloudflare Tunnel → Edit

2. **Add to .env file**:
   ```bash
   CLOUDFLARE_API_TOKEN="your-api-token-here"
   ```

3. **Run configuration script**:
   ```bash
   cd /home/intlc/projects/proxmox
   bash scripts/configure-cloudflare-explorer-complete.sh
   ```

**Note**: Tunnel route configuration still requires manual setup even with API token (complex API endpoint).

---

## Current Status

- ✅ Infrastructure: Complete
- ✅ Nginx: Configured and running
- ✅ Blockscout: Container running
- ❌ DNS Record: Pending manual configuration
- ❌ Tunnel Route: Pending manual configuration

---

**Last Updated**: $(date)  
**Next Step**: Complete DNS and tunnel route configuration in Cloudflare dashboards

