caddy-https-troubleshoot
Diagnoses and fixes HTTPS/SSL certificate issues in the network infrastructure by checking API tokens, validating Caddy configuration, and testing certificates. Use when certificates are not obtained, HTTPS is not working, seeing SSL errors, "Invalid Authorization header", or Caddy restart loops. Triggers on "HTTPS not working", "SSL certificate issue", "certificate error", "Caddy not starting", "fix HTTPS", "troubleshoot certificates", or "Invalid format for Authorization header". Works with Caddy, Cloudflare DNS-01 challenge, and Let's Encrypt.
What this skill does
# Troubleshoot HTTPS Skill
Systematic diagnosis and resolution of HTTPS/SSL certificate issues in the Caddy reverse proxy with Cloudflare DNS-01 challenge.
## Quick Start
Run the diagnostic script to identify issues:
```bash
/home/dawiddutoit/projects/network/.claude/skills/troubleshoot-https/scripts/diagnose-https.sh
```
Or follow the step-by-step diagnosis in [Instructions](#3-instructions).
## 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 API Key Configuration
- 3.2 Verify Cloudflare DNS Plugin
- 3.3 Analyze Caddy Logs
- 3.4 Validate Caddyfile Syntax
- 3.5 Test Certificate Validity
- 3.6 Diagnose Specific Error
- 3.7 Apply Fix
4. [Supporting Files](#4-supporting-files)
5. [Expected Outcomes](#5-expected-outcomes)
6. [Common Error Reference](#6-common-error-reference)
7. [Requirements](#7-requirements)
8. [Red Flags to Avoid](#8-red-flags-to-avoid)
## When to Use This Skill
**Explicit Triggers:**
- "HTTPS not working"
- "SSL certificate error"
- "Certificate not obtained"
- "Caddy keeps restarting"
- "Fix HTTPS certificates"
- "Invalid format for Authorization header"
**Implicit Triggers:**
- Browser shows "Your connection is not private"
- Services accessible via HTTP but not HTTPS
- Caddy container in restart loop
- New domain not getting certificate
**Debugging Triggers:**
- "Why is my certificate expired?"
- "Why can't Caddy get a certificate?"
- "Cloudflare DNS challenge failing"
## What This Skill Does
1. **Checks API Key** - Verifies CLOUDFLARE_API_KEY is set and passed to container
2. **Verifies Plugin** - Confirms Cloudflare DNS plugin is compiled into Caddy
3. **Analyzes Logs** - Searches for certificate errors in Caddy logs
4. **Validates Config** - Tests Caddyfile syntax
5. **Tests Certificates** - Checks certificate validity for each domain
6. **Identifies Error** - Matches symptoms to known issues
7. **Provides Fix** - Gives specific commands to resolve the issue
## Instructions
### 3.1 Check API Key Configuration
**Step 1: Verify API key is set in .env**
```bash
grep "CLOUDFLARE_API_KEY" /home/dawiddutoit/projects/network/.env | head -1
```
Expected: `CLOUDFLARE_API_KEY="Xv5MOdOT...` (starts with alphanumeric, not `v4:`)
**Step 2: Verify API key is passed to container**
```bash
docker exec caddy env | grep CLOUDFLARE_API_KEY
```
Expected: Shows the API key value (not empty)
**If empty or missing:**
```bash
# Recreate container to pick up .env changes
docker compose -f /home/dawiddutoit/projects/network/docker-compose.yml up -d --force-recreate caddy
```
**Key distinction:**
- API Token format: `Xv5MOdOT...` (alphanumeric string) - CORRECT
- Global API Key format: `v4:...` or long hex string - WRONG
### 3.2 Verify Cloudflare DNS Plugin
```bash
docker exec caddy caddy list-modules | grep cloudflare
```
Expected: `dns.providers.cloudflare`
**If not present:** Plugin not compiled into Caddy. Rebuild:
```bash
cd /home/dawiddutoit/projects/network && \
docker compose build --no-cache caddy && \
docker compose up -d --force-recreate caddy
```
### 3.3 Analyze Caddy Logs
**Check for certificate-related messages:**
```bash
docker logs caddy 2>&1 | grep -i -E "certificate|error|failed|invalid" | tail -30
```
**Look for success messages:**
```bash
docker logs caddy 2>&1 | grep "certificate obtained successfully"
```
Expected for each domain: `certificate obtained successfully {"identifier": "domain.temet.ai"}`
### 3.4 Validate Caddyfile Syntax
```bash
docker exec caddy caddy validate --config /etc/caddy/Caddyfile
```
Expected: `Valid configuration` (no errors)
**If syntax error:**
1. Read the Caddyfile to identify the error
2. Fix the syntax issue
3. Reload Caddy
### 3.5 Test Certificate Validity
**Test a single domain:**
```bash
echo | openssl s_client -servername pihole.temet.ai -connect pihole.temet.ai:443 2>/dev/null | openssl x509 -noout -dates -issuer
```
Expected output:
```
notBefore=<date>
notAfter=<date>
issuer=C = US, O = Let's Encrypt, CN = R3
```
**Test all domains:**
```bash
for domain in pihole jaeger langfuse sprinkler ha; do
echo "=== $domain.temet.ai ==="
echo | openssl s_client -servername $domain.temet.ai -connect $domain.temet.ai:443 2>/dev/null | \
openssl x509 -noout -dates 2>&1 || echo "FAILED to get certificate"
echo
done
```
### 3.6 Diagnose Specific Error
Match error message to diagnosis:
| Error Message | Diagnosis | Go to Fix |
|---------------|-----------|-----------|
| `Invalid format for Authorization header` | Using Global API Key instead of API Token | Fix A |
| `missing API token` | Environment variable not set | Fix B |
| `unknown directive 'dns'` | Cloudflare plugin not compiled | Fix C |
| `certificate obtain error` | Rate limit or DNS propagation | Fix D |
| `403 Forbidden` from Cloudflare | API token lacks permissions | Fix E |
| Container restart loop | Caddyfile syntax error | Fix F |
### 3.7 Apply Fix
**Fix A: Wrong API Key Type**
The error "Invalid format for Authorization header" means you're using the Global API Key instead of an API Token.
1. Create new API Token:
- Go to: https://dash.cloudflare.com/profile/api-tokens
- Click "Create Token"
- Select template: "Edit zone DNS"
- Zone Resources: Include -> Specific zone -> temet.ai
- Click "Continue to summary" -> "Create Token"
2. Update .env:
```bash
# Edit .env and replace CLOUDFLARE_API_KEY with the new token
nano /home/dawiddutoit/projects/network/.env
```
3. Recreate Caddy:
```bash
docker compose -f /home/dawiddutoit/projects/network/docker-compose.yml up -d --force-recreate caddy
```
4. Verify:
```bash
docker logs caddy 2>&1 | grep "certificate obtained successfully"
```
**Fix B: Environment Variable Not Set**
1. Verify .env has the key:
```bash
grep CLOUDFLARE_API_KEY /home/dawiddutoit/projects/network/.env
```
2. Verify docker-compose.yml passes it:
```bash
grep -A5 "caddy:" /home/dawiddutoit/projects/network/docker-compose.yml | grep CLOUDFLARE
```
3. Recreate container:
```bash
docker compose -f /home/dawiddutoit/projects/network/docker-compose.yml up -d --force-recreate caddy
```
**Fix C: Cloudflare Plugin Not Compiled**
```bash
cd /home/dawiddutoit/projects/network && \
docker compose build --no-cache caddy && \
docker compose up -d --force-recreate caddy
```
Build takes approximately 5 minutes on Raspberry Pi.
**Fix D: Rate Limit or DNS Propagation**
1. Wait 5 minutes for DNS propagation
2. Restart Caddy:
```bash
docker compose -f /home/dawiddutoit/projects/network/docker-compose.yml restart caddy
```
3. If still failing, check Let's Encrypt rate limits:
- Limit: 50 certificates per domain per week
- Check: https://crt.sh/?q=temet.ai
**Fix E: API Token Missing Permissions**
1. Go to: https://dash.cloudflare.com/profile/api-tokens
2. Find your token and click "Edit"
3. Verify permissions:
- Zone -> DNS -> Edit (required)
- Zone Resources -> Include -> Specific zone -> temet.ai
4. If missing, create new token with correct permissions
**Fix F: Caddyfile Syntax Error**
1. Check error in logs:
```bash
docker logs caddy 2>&1 | tail -50
```
2. Validate Caddyfile:
```bash
docker exec caddy caddy validate --config /etc/caddy/Caddyfile
```
3. Common syntax issues:
- Missing closing braces `}`
- Invalid directive names
- Wrong environment variable syntax
4. Fix the Caddyfile and reload:
```bash
docker exec caddy caddy reload --config /etc/caddy/Caddyfile
```
## Supporting Files
| File | Purpose |
|------|---------|
| `references/reference.md` | Complete error reference, API token creation guide, rate limit details |
| `scripts/diagnose-https.sh` | Automated diagnostic script |
## Expected Outcomes
**Success:**
- All diagnostic checks pass
- `certificate obtained successfully` for each domain
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.