56 lines
2.1 KiB
Markdown
56 lines
2.1 KiB
Markdown
# Caddy Deployment for HTML Artifacts
|
|
|
|
When the user wants to *see* the built HTML in a browser (especially on their phone or from Telegram), deploy to the infrastructure's Caddy server for a real HTTPS URL.
|
|
|
|
## When to deploy
|
|
|
|
- User asks to "see" the mockup/page (not just hear about it)
|
|
- The artifact is a self-contained HTML file
|
|
- User is on a phone or messaging platform where `file://` paths don't work
|
|
- You want a clickable link, not instructions to open a local file
|
|
|
|
## Standard deployment
|
|
|
|
```bash
|
|
# 1. Copy to web root (filename = URL path)
|
|
cp /path/to/source.html /var/www/static/<short-name>
|
|
chmod 644 /var/www/static/<short-name>
|
|
|
|
# 2. Add Caddy route if needed (edit /etc/caddy/Caddyfile)
|
|
# Append a new @<name> handle block before the closing brace
|
|
# Pattern:
|
|
# @<name> path /<name>
|
|
# handle @<name> {
|
|
# root * /var/www/static
|
|
# file_server
|
|
# }
|
|
|
|
# 3. Reload Caddy
|
|
caddy reload --config /etc/caddy/Caddyfile
|
|
|
|
# 4. Verify
|
|
curl -sI https://core.itpropartner.com/<short-name>
|
|
# Expect 200
|
|
|
|
# 5. Send link
|
|
# https://core.itpropartner.com/<short-name>
|
|
```
|
|
|
|
## Pitfalls
|
|
|
|
- **File permissions matter.** A file with `600` returns 403 even with the correct root. Always `chmod 644`.
|
|
- **URL path = filename.** `/var/www/static/voip-demo` → `/voip-demo`. Drop the `.html` extension from the URL unless the filename has it.
|
|
- **404 after adding route?** Check file permissions first. If the file is `644`, check it actually exists at the exact path.
|
|
- **Don't add duplicate routes** — if a handler already covers that path prefix (e.g. `core.itpropartner.com { ... }` with `file_server`), just copy the file; no Caddyfile edit needed.
|
|
|
|
## Pages deployed to date (for reference)
|
|
|
|
| Path | What it serves | Description |
|
|
|---|---|---|
|
|
| `/vehicles.json` | JSON | Vehicle database for Apex |
|
|
| `/capabilities` | Directory | Portal mockup / capabilities page |
|
|
| `/ringlogix` | HTML | RingLogix API reference docs |
|
|
| `/voip-demo` | HTML | VoIPSimplicity auto-provisioning demo |
|
|
| `/call-flow` | HTML | Inbound call flow diagram |
|
|
| `/portal` | HTML | Customer portal dashboard |
|