Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keyc
## Configuration

Environment variables (set in `.env`):

- `DOMAIN` - Domain name for SSL cert (default: `localhost`)
- `UPSTREAM_URL` - URL for your local app (default: `http://host.docker.internal:3000`)

Expand Down
45 changes: 41 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,47 @@ A Dockerized Caddy reverse proxy with automatic SSL certificate generation for l

4. Install the CA certificate (one-time):

Replace `local.example.com` with your configured domain.

**macOS:**

```bash
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ./certs/local.example.com.rootCA.pem
```

**Linux (Debian/Ubuntu):**

```bash
sudo cp ./certs/local.example.com.rootCA.pem /usr/local/share/ca-certificates/local.example.com.crt
sudo update-ca-certificates
```

**Linux (Fedora/RHEL):**

```bash
sudo cp ./certs/local.example.com.rootCA.pem /etc/pki/ca-trust/source/anchors/local.example.com.pem
sudo update-ca-trust
```

**Linux (Arch):**

```bash
sudo trust anchor ./certs/local.example.com.rootCA.pem
```

**Windows (PowerShell as Administrator):**

```powershell
Import-Certificate -FilePath .\certs\local.example.com.rootCA.pem -CertStoreLocation Cert:\LocalMachine\Root
```

If `.pem` import fails, convert to `.cer` first:

```powershell
openssl x509 -in .\certs\local.example.com.rootCA.pem -out .\certs\local.example.com.rootCA.cer
Import-Certificate -FilePath .\certs\local.example.com.rootCA.cer -CertStoreLocation Cert:\LocalMachine\Root
```

5. Start the proxy:

```bash
Expand All @@ -50,10 +87,10 @@ Note (Linux): Requires Docker Engine 20.10+ for `host-gateway` support.

## Configuration

| Variable | Default | Description |
| --------------- | ----------- | ---------------------- |
| `DOMAIN` | `localhost` | Domain for SSL cert |
| `UPSTREAM_URL` | `http://host.docker.internal:3000` | URL for your local app |
| Variable | Default | Description |
| -------------- | ---------------------------------- | ---------------------- |
| `DOMAIN` | `localhost` | Domain for SSL cert |
| `UPSTREAM_URL` | `http://host.docker.internal:3000` | URL for your local app |

## Ports

Expand Down
20 changes: 19 additions & 1 deletion scripts/mkcert/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,23 @@ else
echo "Certificate already exists for ${DOMAIN}, skipping generation."
fi

echo "Install CA on macOS:"
echo ""
echo "=== Install CA certificate ==="
echo ""
echo "macOS:"
echo " sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ./certs/${DOMAIN}.rootCA.pem"
echo ""
echo "Linux (Debian/Ubuntu):"
echo " sudo cp ./certs/${DOMAIN}.rootCA.pem /usr/local/share/ca-certificates/${DOMAIN}.crt && sudo update-ca-certificates"
echo ""
echo "Linux (Fedora/RHEL):"
echo " sudo cp ./certs/${DOMAIN}.rootCA.pem /etc/pki/ca-trust/source/anchors/${DOMAIN}.pem && sudo update-ca-trust"
echo ""
echo "Linux (Arch):"
echo " sudo trust anchor ./certs/${DOMAIN}.rootCA.pem"
echo ""
echo "Windows (PowerShell as Admin):"
echo " Import-Certificate -FilePath .\\certs\\${DOMAIN}.rootCA.pem -CertStoreLocation Cert:\\LocalMachine\\Root"
echo " If .pem import fails, convert to .cer first:"
echo " openssl x509 -in .\\certs\\${DOMAIN}.rootCA.pem -out .\\certs\\${DOMAIN}.rootCA.cer"
echo " Import-Certificate -FilePath .\\certs\\${DOMAIN}.rootCA.cer -CertStoreLocation Cert:\\LocalMachine\\Root"