cloudflare-tunnel-setup
Sets up a new Cloudflare Tunnel from scratch for secure remote access to home network services. Use when creating a new tunnel, replacing an expired tunnel token, or setting up remote access for a fresh installation. Triggers on "setup cloudflare tunnel", "create tunnel", "new tunnel token", "configure remote access", "cloudflare tunnel from scratch", or "tunnel not configured". Works with .env, docker-compose.yml, and Cloudflare Zero Trust.
What this skill does
# Cloudflare Tunnel Setup Skill
Interactive guide for setting up a new Cloudflare Tunnel from scratch.
## Quick Start
Run this skill when you need to:
1. Create a new Cloudflare Tunnel
2. Replace an expired or invalid tunnel token
3. Set up remote access for a fresh installation
**Minimum requirements:** Cloudflare account, domain on Cloudflare, Docker installed.
## Table of Contents
1. [When to Use This Skill](#1-when-to-use-this-skill)
2. [What This Skill Does](#2-what-this-skill-does)
3. [Instructions](#3-instructions)
- 3.1 Check Prerequisites
- 3.2 Create Tunnel in Dashboard
- 3.3 Configure Token in .env
- 3.4 Restart Cloudflared Container
- 3.5 Configure Public Hostnames
- 3.6 Verify Connectivity
4. [Supporting Files](#4-supporting-files)
5. [Expected Outcomes](#5-expected-outcomes)
6. [Requirements](#6-requirements)
7. [Red Flags to Avoid](#7-red-flags-to-avoid)
## When to Use This Skill
**Explicit Triggers:**
- "Setup cloudflare tunnel"
- "Create a new tunnel"
- "Configure remote access"
- "Replace tunnel token"
- "Tunnel from scratch"
**Implicit Triggers:**
- Fresh installation of network infrastructure
- Tunnel token expired or invalid
- CLOUDFLARE_TUNNEL_TOKEN missing from .env
- Moving infrastructure to new hardware
**Debugging Triggers:**
- "Tunnel token not found"
- "cloudflared container won't start"
- "No CLOUDFLARE_TUNNEL_TOKEN in .env"
## What This Skill Does
1. **Checks Prerequisites** - Verifies .env exists and cloudflared is in docker-compose
2. **Guides Tunnel Creation** - Step-by-step instructions for Cloudflare dashboard
3. **Configures Token** - Adds tunnel token to .env file
4. **Restarts Container** - Restarts cloudflared to apply new token
5. **Guides Hostname Setup** - Instructions for configuring public hostnames
6. **Verifies Connectivity** - Confirms tunnel is connected and working
## Instructions
### 3.1 Check Prerequisites
**Step 1: Verify .env file exists**
```bash
ls -la /home/dawiddutoit/projects/network/.env
```
If missing, create from example:
```bash
cp /home/dawiddutoit/projects/network/.env.example /home/dawiddutoit/projects/network/.env
```
**Step 2: Check if CLOUDFLARE_TUNNEL_TOKEN exists**
```bash
grep -E "^CLOUDFLARE_TUNNEL_TOKEN" /home/dawiddutoit/projects/network/.env
```
**Possible outcomes:**
- Line exists with value: Token already configured (check if valid)
- Line exists but empty/placeholder: Needs real token
- Line not found: Token needs to be added
**Step 3: Verify docker-compose has cloudflared service**
```bash
grep -A 10 "cloudflared:" /home/dawiddutoit/projects/network/docker-compose.yml
```
If cloudflared service is missing, it needs to be added. See `references/reference.md` for service definition.
### 3.2 Create Tunnel in Dashboard
Provide these instructions to the user:
1. Go to: https://one.dash.cloudflare.com -> Access -> Tunnels
2. Click "Create a tunnel" -> Select "Cloudflared" connector
3. Name tunnel (e.g., "pi-home") -> Choose "Docker" as connector type
4. Copy the tunnel token (long base64 string after `--token`)
5. Save token securely
**Token format:** Base64-encoded JSON containing Account ID, Tunnel ID, and Secret.
### 3.3 Configure Token in .env
**Step 1: Check current token status**
```bash
grep "CLOUDFLARE_TUNNEL_TOKEN" /home/dawiddutoit/projects/network/.env
```
**Step 2: Add or update token**
If line exists, update it. If not, add it.
```bash
# If line exists, use sed to replace
# If not, append to file
# The token should look like:
# CLOUDFLARE_TUNNEL_TOKEN=eyJhIjoiYWJjZDEyMzQ...
```
Use the Edit tool to update `.env`:
- Look for existing `CLOUDFLARE_TUNNEL_TOKEN=` line
- Replace with new token value
- Or add new line if not present
**Validate token format:**
```bash
# Token should be base64 decodable
TUNNEL_TOKEN=$(grep "CLOUDFLARE_TUNNEL_TOKEN=" /home/dawiddutoit/projects/network/.env | cut -d'=' -f2)
echo "$TUNNEL_TOKEN" | base64 -d 2>/dev/null | python3 -c "import sys, json; d=json.load(sys.stdin); print('Valid token for account:', d.get('a', 'unknown'))"
```
### 3.4 Restart Cloudflared Container
**Step 1: Restart the container**
```bash
cd /home/dawiddutoit/projects/network && docker compose restart cloudflared
```
Or if container doesn't exist yet:
```bash
cd /home/dawiddutoit/projects/network && docker compose up -d cloudflared
```
**Step 2: Check container is running**
```bash
docker ps | grep cloudflared
```
**Expected output:**
```
CONTAINER ID IMAGE STATUS NAMES
abc123... cloudflare/cloudflared:latest Up X seconds cloudflared
```
**Step 3: Check logs for successful connection**
```bash
docker logs cloudflared --tail 30
```
**Look for these success indicators:**
```
INF Registered tunnel connection connIndex=0 location=...
INF Registered tunnel connection connIndex=1 location=...
INF Registered tunnel connection connIndex=2 location=...
INF Registered tunnel connection connIndex=3 location=...
```
4 registered connections = healthy tunnel (2 connections per Cloudflare edge location)
**If errors appear:**
- `token is invalid`: Token was copied incorrectly or expired
- `already registered`: Another instance using same token (stop other instances)
- `network error`: Check internet connectivity
### 3.5 Configure Public Hostnames
After tunnel is connected, configure services in Cloudflare dashboard:
1. Go to: https://one.dash.cloudflare.com -> Access -> Tunnels
2. Click tunnel name -> Configure -> Public Hostname -> Add
3. For each service, enter subdomain, domain (temet.ai), Type (HTTP), and URL
**Example hostnames:**
| Service | Subdomain | URL |
|---------|-----------|-----|
| Pi-hole | pihole | pihole:80 |
| Webhook | webhook | webhook:9000 |
| Jaeger | jaeger | 192.168.68.135:16686 |
**URL patterns:**
- Docker container: `container:port` (e.g., pihole:80)
- Host service: `host-ip:port` (e.g., 192.168.68.135:16686)
- LAN device: `device-ip:port` (e.g., 192.168.68.105:80)
**Important:** Use HTTP (not HTTPS) for backends. Do NOT use `host.docker.internal` on Linux.
### 3.6 Verify Connectivity
**Step 1: Verify tunnel is registered**
```bash
docker logs cloudflared 2>&1 | grep -E "Registered tunnel|connIndex"
```
**Expected:** 4 "Registered tunnel connection" messages
**Step 2: Check tunnel status in dashboard**
```
Go to: https://one.dash.cloudflare.com
Navigate to: Access -> Tunnels
Status should show: "HEALTHY" with green indicator
```
**Step 3: Test external access (from mobile data or external network)**
```bash
# From a device NOT on home network:
curl -I https://pihole.temet.ai
# Expected: HTTP 302 (redirect to Cloudflare Access) or HTTP 200 (if no auth)
```
**Step 4: Run diagnostic script (optional)**
```bash
./scripts/cf-tunnel-config.sh show
```
## Supporting Files
| File | Purpose |
|------|---------|
| `references/reference.md` | Docker-compose service definition, token format details |
| `examples/examples.md` | Example configurations for common setups |
## Expected Outcomes
**Success:**
- CLOUDFLARE_TUNNEL_TOKEN in .env
- cloudflared container running
- 4 tunnel connections registered in logs
- Tunnel shows "HEALTHY" in dashboard
- Services accessible via *.temet.ai from external network
**Partial Success:**
- Token configured but hostnames not set up (user reminder provided)
- Tunnel connected but services return 502 (backend configuration issue)
**Failure Indicators:**
- "token is invalid" in logs -> Re-copy token from dashboard
- Container restart loop -> Check token format
- 0 registered connections -> Network/firewall issue
## Requirements
**Environment:**
- Cloudflare account with domain
- Docker and Docker Compose installed
- Internet connectivity
- `.env` file in project root
**Accounts/Access:**
- Cloudflare dashboard access
- Zero Trust enabled (free tier works)
**Tools needed:**
- Read, Write, Edit (for .env configuration)
- Bash (for docker commands and verification)
- Grep (for checking existing configuraRelated in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.