Repository: TryGhost/Ghost
Pull request #23453: Added caddy to docker compose `split` profile
Author: login: cmraible
Created: 2025-05-21T02:18:12Z | Merged: 2025-05-27T04:14:56Z

no refs

In production, events sent to Tinybird are sent via the site's own domain at the `/.ghost/analytics` path. This commit adds Caddy to the `compose.yml` file, which will allow us to mimic this setup locally, by forwarding requests to `/.ghost/analytics` to the analytics service, rather than to Ghost itself. 

This commit doesn't add this functionality straight away, but simply adds a basic Caddy configuration that we can build on. When using the `split` profile (which will become the default soon), running `docker compose up` will include this Caddy service, which does a few things:
- Serves Ghost locally at `http://localhost:80`
- Serves Ghost locally using TLS at `https://localhost:443`
     - Your browser will throw a warning the first time you access it because Caddy's CA isn't trusted. While the server is running, you can run `sudo ./.docker/caddy/trust_caddy_ca.sh` to trust Caddy's CA on your host machine, which will remove these warnings
- Additionally serves Ghost at `https://site.ghost` and admin at `https://admin.ghost`
     - You'll need to add these to your `/etc/hosts`, and update your `config.local.json` in Ghost for this to work fully


Diff:
diff --git a/.docker/caddy/Caddyfile b/.docker/caddy/Caddyfile
new file mode 100644
index 00000000000..6ae36fdc9c9
--- /dev/null
+++ b/.docker/caddy/Caddyfile
@@ -0,0 +1,45 @@
+{
+	local_certs
+}
+
+# Run `sudo ./.docker/caddy/trust_caddy_ca.sh` while the caddy container is running to trust the Caddy CA
+(common_ghost_config) {
+    handle /ember-cli-live-reload.js {
+        reverse_proxy admin:4200
+    }
+
+    reverse_proxy server:2368
+}
+
+# Allow http to be used
+## Disables automatic redirect to https in development
+http://localhost {
+    import common_ghost_config
+}
+
+# Allow https to be used by explicitly requesting https://localhost
+## Note: Caddy uses self-signed certificates. Your browser will warn you about this.
+## Run `sudo ./.docker/caddy/trust_caddy_ca.sh` while the caddy container is running to trust the Caddy CA
+https://localhost {
+    import common_ghost_config
+}
+
+# Access Ghost at https://site.ghost
+## Add the following to your /etc/hosts file:
+## 127.0.0.1 site.ghost
+site.ghost {
+    reverse_proxy server:2368
+}
+
+# Access Ghost Admin at https://admin.ghost/ghost
+## Add the following to your /etc/hosts file:
+## 127.0.0.1 admin.ghost
+admin.ghost {
+    handle /ember-cli-live-reload.js {
+        reverse_proxy admin:4200
+    }
+
+    handle {
+        reverse_proxy server:2368
+    }
+}
diff --git a/.docker/caddy/trust_caddy_ca.sh b/.docker/caddy/trust_caddy_ca.sh
new file mode 100755
index 00000000000..7de677f00ea
--- /dev/null
+++ b/.docker/caddy/trust_caddy_ca.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+# --- Configuration ---
+# !! IMPORTANT: Set this to your Caddy Docker container name or ID !!
+CADDY_CONTAINER_NAME="ghost-caddy" # PLEASE UPDATE IF YOUR CONTAINER NAME IS DIFFERENT
+
+# Path where Caddy stores its local root CA inside the container
+CADDY_INTERNAL_CERT_PATH="/data/caddy/pki/authorities/local/root.crt"
+
+# Temporary path on your host to save the certificate
+HOST_TEMP_CERT_PATH="./caddy_local_root_for_keychain.crt"
+# --- End Configuration ---
+
+# Check if running as root (needed for 'security add-trusted-cert' and /etc/hosts modification)
+if [ "$(id -u)" -ne 0 ]; then
+  echo "This script must be run as root (e.g., using sudo) to modify the System Keychain."
+  exit 1
+fi
+
+echo "--- Managing Caddy Local CA Trust ---"
+echo "Attempting to copy Caddy's local root CA certificate from container '$CADDY_CONTAINER_NAME'..."
+
+# Step 1: Copy the certificate from the Docker container
+docker cp "${CADDY_CONTAINER_NAME}:${CADDY_INTERNAL_CERT_PATH}" "${HOST_TEMP_CERT_PATH}"
+if [ $? -ne 0 ]; then
+  echo "Error: Failed to copy certificate from Docker container."
+  echo "Please ensure the container name '$CADDY_CONTAINER_NAME' is correct and the container is running."
+  echo "Also, Caddy needs to have served an HTTPS site at least once to generate its local CA."
+  exit 1
+fi
+echo "Certificate copied successfully to ${HOST_TEMP_CERT_PATH}"
+
+echo "Adding certificate to System Keychain and trusting it..."
+
+# Step 2: Add the certificate to the System Keychain and set trust settings
+security add-trusted-cert -d -r trustRoot -k "/Library/Keychains/System.keychain" "${HOST_TEMP_CERT_PATH}"
+
+if [ $? -ne 0 ]; then
+  echo "Error: Failed to add or trust the certificate in Keychain."
+  echo "You might see a duplicate if a previous version of this CA with the same name was already added but not fully trusted."
+  # Clean up the temp cert
+  rm -f "${HOST_TEMP_CERT_PATH}"
+  exit 1
+fi
+
+echo "Certificate successfully added to System Keychain and trusted."
+
+# Step 3: Clean up the temporary certificate file
+rm -f "${HOST_TEMP_CERT_PATH}"
+echo "Temporary certificate file cleaned up."
+echo "--- Caddy Local CA Trust complete ---"
+
+echo ""
+echo "Script finished."
+echo "IMPORTANT: You may need to restart your web browser(s) and/or clear your browser cache for the changes to take full effect."
+
+exit 0
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 251d273e3e9..6668f3ca23f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -125,6 +125,7 @@ test/functional/*.png
 /ghost/core/core/frontend/public/ghost-stats.min.js
 # Caddyfile - for local development with ssl + caddy
 Caddyfile
+!.docker/caddy/Caddyfile
 
 # Playwright state with cookies it keeps across tests
 /ghost/core/playwright-state.json
diff --git a/compose.yml b/compose.yml
index 00413b4ae00..9ca5fc9357f 100644
--- a/compose.yml
+++ b/compose.yml
@@ -78,6 +78,18 @@ services:
     profiles: [ split ]
     tty: true
 
+  caddy:
+    image: caddy:latest
+    container_name: ghost-caddy
+    profiles: [ split ]
+    ports:
+      - "80:80"
+      - "443:443"
+    volumes:
+      - ./.docker/caddy/Caddyfile:/etc/caddy/Caddyfile:ro
+      - caddy_data:/data
+    restart: always
+
   ghost:
     <<: *service-template
     image: ghost-monorepo:latest
@@ -172,7 +184,7 @@ services:
   mailhog:
     image: mailhog/mailhog:latest
     container_name: ghost-mailhog
-    profiles: [ ghost ]
+    profiles: [ ghost, split ]
     ports:
       - "1025:1025" # SMTP server
       - "8025:8025" # Web interface
@@ -180,6 +192,7 @@ services:
 volumes:
   mysql-data: {}
   redis-data: {}
+  caddy_data: {}
   node_modules_yarn_lock_hash: {}
   node_modules_ghost_root: {}
   node_modules_ghost_admin: {}


Reviews:
user: login: coderabbitai[bot]
body: **Actionable comments posted: 2**

<details>
<summary>🧹 Nitpick comments (6)</summary><blockquote>

<details>
<summary>.docker/caddy/Caddyfile (1)</summary><blockquote>

`9-11`: **Indentation consistency in `site.ghost` block**  
The block uses a tab before `reverse_proxy`, whereas other blocks use spaces. For readability and maintainability, convert tabs to spaces to match the rest of the file.  

+diff
 site.ghost {
-	 reverse_proxy server:2368
+    reverse_proxy server:2368
 }

</blockquote></details>
<details>
<summary>compose.yml (1)</summary><blockquote>

`1-210`: **Add newline at end of file**  
YAMLLint flagged a missing newline at EOF. Adding a trailing newline improves POSIX compliance and silences the linter error.  

+diff
  ... (end of file)
+\n

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 YAMLlint (1.37.1)</summary>

[error] 210-210: no new line character at the end of file

(new-line-at-end-of-file)

</details>

</details>

</blockquote></details>
<details>
<summary>.docker/caddy/trust_caddy_ca.sh (4)</summary><blockquote>

`25-46`: **Modify `/etc/hosts` safely and add backup**  
Directly appending to `/etc/hosts` is fine, but consider creating a backup before changes to allow easy rollback. For example:  
```bash
cp "${HOSTS_FILE}" "${HOSTS_FILE}.bak"
```  
before entering the loop.

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 Shellcheck (0.10.0)</summary>

[warning] 38-38: This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten.

(SC2320)

</details>

</details>

---

`57-67`: **Verify the container is running before copying CA**  
If the container isn’t running or Caddy hasn’t generated the certificate yet, `docker cp` will fail. You could add a check like:  
```bash
docker inspect --format '{{.State.Running}}' "${CADDY_CONTAINER_NAME}" \
  | grep true >/dev/null || { echo "Caddy container not running"; exit 1; }
```  
before invoking `docker cp`.

---

`72-81`: **Ensure idempotent CA trust addition**  
`security add-trusted-cert` may error if the cert is already trusted. You can detect existing trust and skip or re-add silently:  
```bash
security find-certificate -c "Caddy Local CA" /Library/Keychains/System.keychain \
  >/dev/null || security add-trusted-cert -d -r trustRoot \
  -k /Library/Keychains/System.keychain "${HOST_TEMP_CERT_PATH}"
```

---

`85-93`: **Document script compatibility and cleanup location**  
Note in the README or script header that this only runs on macOS (uses `security add-trusted-cert`) and consider using a system temp directory (e.g., `mktemp`) for the downloaded certificate rather than writing to the project root.

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between e54a04beeb6fb7a496a847785cc592e7a6a0e0fc and 27b7bbfbaa7ac819bae4eb30a30f1093c58fb75c.

</details>

<details>
<summary>📒 Files selected for processing (4)</summary>

* `.docker/caddy/Caddyfile` (1 hunks)
* `.docker/caddy/trust_caddy_ca.sh` (1 hunks)
* `.gitignore` (1 hunks)
* `compose.yml` (3 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🪛 YAMLlint (1.37.1)</summary>

<details>
<summary>compose.yml</summary>

[error] 210-210: no new line character at the end of file

(new-line-at-end-of-file)

</details>

</details>
<details>
<summary>🪛 Shellcheck (0.10.0)</summary>

<details>
<summary>.docker/caddy/trust_caddy_ca.sh</summary>

[warning] 38-38: This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten.

(SC2320)

</details>

</details>

</details>

<details>
<summary>🔇 Additional comments (6)</summary><blockquote>

<details>
<summary>.gitignore (1)</summary>

`128-128`: **Inclusion of Caddyfile for version control is correct**  
Adding `!.docker/caddy/Caddyfile` explicitly tracks the new Caddy configuration while still ignoring root-level `Caddyfile`. This aligns with the Docker Compose setup and prevents accidental omission.

</details>
<details>
<summary>.docker/caddy/Caddyfile (3)</summary>

`1-3`: **Global TLS and local certificate configuration**  
Enabling `local_certs` is appropriate for development, as it automatically generates and trusts a local CA. Ensure this aligns with your workflow on non-macOS platforms.

---

`5-7`: **Proxy configuration for localhost**  
Routing `localhost` to `server:2368` is correct for the split profile. Consider if TLS is needed for plain `localhost` or if HTTP-only is sufficient.

---

`13-21`: **Route handling for admin.ghost**  
The two `handle` directives correctly split live-reload and main traffic between `admin:4200` and `server:2368`. Optionally, you could consolidate with a `route` directive for clarity, but the current approach is valid.

</details>
<details>
<summary>compose.yml (2)</summary>

`185-185`: **Extended profiles for Mailhog**  
Including Mailhog under both `ghost` and `split` profiles is logical for testing SMTP in both modes. No concerns here.

---

`193-193`: **Declare new Caddy data volume**  
Defining `caddy_data` ensures Caddy’s certificate storage is persisted across restarts. This aligns with the service configuration.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-21T02:27:59Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 0**

<details>
<summary>♻️ Duplicate comments (2)</summary><blockquote>

<details>
<summary>compose.yml (1)</summary><blockquote>

`80-89`: _🛠️ Refactor suggestion_

**Ensure Caddy container_name and health dependencies align with trust script**

The `.docker/caddy/trust_caddy_ca.sh` script defaults `CADDY_CONTAINER_NAME` to `ghost-caddy-1`, but Docker Compose names containers with underscores (e.g., `ghost_caddy_1`). Additionally, Caddy should wait for the backend services to be healthy before starting to avoid proxy resolution errors.  
Apply this diff:

```diff
  caddy:
    image: caddy:latest
+   container_name: ghost_caddy_1    # Matches Compose default and trust script expectations
+   depends_on:
+     server:
+       condition: service_healthy
+     admin:
+       condition: service_healthy
    profiles: [ split ]
    ports:
      - "80:80"
      - "443:443"
```

</blockquote></details>
<details>
<summary>.docker/caddy/trust_caddy_ca.sh (1)</summary><blockquote>

`5-5`: _⚠️ Potential issue_

**Align default CADDY_CONTAINER_NAME with Compose default**

The script’s default `CADDY_CONTAINER_NAME="ghost-caddy-1"` doesn’t match Docker Compose’s `ghost_caddy_1`. This mismatch will cause the `docker cp` step to fail unless users override the variable. Update to:

```diff
-CADDY_CONTAINER_NAME="ghost-caddy-1"
+CADDY_CONTAINER_NAME="ghost_caddy_1"
```

</blockquote></details>

</blockquote></details>

<details>
<summary>🧹 Nitpick comments (2)</summary><blockquote>

<details>
<summary>compose.yml (1)</summary><blockquote>

`210-210`: **Add newline at end of file**

YAML files should end with a trailing newline to satisfy linting (`new-line-at-end-of-file`).

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 YAMLlint (1.37.1)</summary>

[error] 210-210: no new line character at the end of file

(new-line-at-end-of-file)

</details>

</details>

</blockquote></details>
<details>
<summary>.docker/caddy/trust_caddy_ca.sh (1)</summary><blockquote>

`14-18`: **Remove outdated hosts file mention**

The root-check comment references `/etc/hosts` modification, but the script doesn’t modify the hosts file. Clarify the actual requirement:

```diff
-# Check if running as root (needed for 'security add-trusted-cert' and /etc/hosts modification)
+# Check if running as root (needed for 'security add-trusted-cert')
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 27b7bbfbaa7ac819bae4eb30a30f1093c58fb75c and da3fcf6bdc68f20a2e496f1cbd1f1f4fbf15e87d.

</details>

<details>
<summary>📒 Files selected for processing (4)</summary>

* `.docker/caddy/Caddyfile` (1 hunks)
* `.docker/caddy/trust_caddy_ca.sh` (1 hunks)
* `.gitignore` (1 hunks)
* `compose.yml` (3 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (2)</summary>

* .gitignore
* .docker/caddy/Caddyfile

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🪛 YAMLlint (1.37.1)</summary>

<details>
<summary>compose.yml</summary>

[error] 210-210: no new line character at the end of file

(new-line-at-end-of-file)

</details>

</details>

</details>

<details>
<summary>🔇 Additional comments (1)</summary><blockquote>

<details>
<summary>compose.yml (1)</summary>

`185-185`: **Mailhog profile extension is correct**

Adding `split` alongside `ghost` for the Mailhog service ensures it’s available in both development profiles as intended.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-23T00:28:51Z

Review comments:
diff_hunk: @@ -77,6 +77,17 @@ services:
     profiles: [ split ]
     tty: true
 
+  caddy:
+    image: caddy:latest
+    profiles: [ split ]
+    ports:
+      - "80:80"
+      - "443:443"
+    volumes:
+      - ./.docker/caddy/Caddyfile:/etc/caddy/Caddyfile:ro
+      - caddy_data:/data
+    restart: always
path: compose.yml
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Add `depends_on` and explicit container name for Caddy**  
To ensure Caddy can resolve and proxy to backend services reliably, add `depends_on` for `server` (and optionally `admin`), and set `container_name` to match the default expected by the trust script.  

+diff
  caddy:
-    image: caddy:latest
+    image: caddy:latest
+    container_name: ghost_caddy_1    # Matches CADDY_CONTAINER_NAME default in trust script
+    depends_on:
+      server:
+        condition: service_healthy
+      admin:
+        condition: service_healthy
     profiles: [ split ]
     ports:
       - "80:80"
       - "443:443"
     volumes:
       - ./.docker/caddy/Caddyfile:/etc/caddy/Caddyfile:ro
       - caddy_data:/data
     restart: always

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In compose.yml around lines 80 to 89, add a container_name field with the value
ghost_caddy_1 to the caddy service to match the expected default in the trust
script. Also, add a depends_on section specifying that caddy depends on the
server and admin services with the condition set to service_healthy for both.
This ensures caddy waits for these backend services to be healthy before
starting, improving reliable proxy resolution.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-21T02:27:59Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,94 @@
+#!/bin/bash
+
+# --- Configuration ---
+# !! IMPORTANT: Set this to your Caddy Docker container name or ID !!
+CADDY_CONTAINER_NAME="ghost-caddy-1" # PLEASE UPDATE IF YOUR CONTAINER NAME IS DIFFERENT
+
+# Path where Caddy stores its local root CA inside the container
+CADDY_INTERNAL_CERT_PATH="/data/caddy/pki/authorities/local/root.crt"
+
+# Temporary path on your host to save the certificate
+HOST_TEMP_CERT_PATH="./caddy_local_root_for_keychain.crt"
+
+# Hostnames to ensure are in /etc/hosts
+HOSTNAMES_TO_CHECK=("site.ghost" "admin.ghost")
+LOOPBACK_IP="127.0.0.1"
+HOSTS_FILE="/etc/hosts"
+# --- End Configuration ---
path: .docker/caddy/trust_caddy_ca.sh
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**Default container name may not match Compose default**  
`CADDY_CONTAINER_NAME` defaults to `"ghost-caddy-1"`, but Compose will name it `ghost_caddy_1` by default. Either update this variable or add `container_name: ghost-caddy-1` in `compose.yml` so the script works out-of-the-box.

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In .docker/caddy/trust_caddy_ca.sh around lines 3 to 17, the default value for
CADDY_CONTAINER_NAME is set to "ghost-caddy-1", but Docker Compose defaults to
naming containers with underscores like "ghost_caddy_1". To fix this, either
update the CADDY_CONTAINER_NAME variable to "ghost_caddy_1" to match the Compose
default or add a container_name: ghost-caddy-1 entry in the compose.yml file to
align with the script's current default.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-21T02:27:59Z
author_association: CONTRIBUTOR

PR comments:
user: login: coderabbitai[bot]
created_at: 2025-05-21T02:18:19Z
body: <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- walkthrough_start -->

"""
## Walkthrough

This change introduces a new Caddy reverse proxy service configured for local development within Docker Compose. It adds a Caddyfile that sets up reverse proxy rules for multiple hostnames and request paths, supporting both HTTP and HTTPS with local TLS certificates. A new Bash script automates trusting Caddy's local root CA certificate on macOS hosts by copying the certificate from the running container and adding it to the system keychain. The Docker Compose configuration is updated to include the Caddy service under the "split" profile, with port mappings, volume mounts for configuration and persistent data, and an updated profile for the mailhog service. The `.gitignore` is adjusted to track the new Caddyfile under `.docker/caddy/`.

## Possibly related PRs

- TryGhost/Ghost#23446: Adds split `server` and `admin` backend services, which are directly referenced in the new Caddy reverse proxy configuration and Docker Compose profile introduced in this PR.
"""

<!-- walkthrough_end -->


---

<details>
<summary>📜 Recent review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between da3fcf6bdc68f20a2e496f1cbd1f1f4fbf15e87d and 0ab27e36c4c0824477ac05e30efb91a8c1a2176b.

</details>

<details>
<summary>📒 Files selected for processing (4)</summary>

* `.docker/caddy/Caddyfile` (1 hunks)
* `.docker/caddy/trust_caddy_ca.sh` (1 hunks)
* `.gitignore` (1 hunks)
* `compose.yml` (2 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (4)</summary>

* .gitignore
* .docker/caddy/trust_caddy_ca.sh
* .docker/caddy/Caddyfile
* compose.yml

</details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNwSPbABsvkCiQBHbGlcSHFcLzpIACIAQVolegY0BPkCSFp8BgBrSgVmbnxEDwADRG4vdRKeCnwAM3hI6MgAdzRkBwFmdRp6OTDYD2xivgZmKngBSPRkW0gMRwE8gCYAZgAWAFZV/ixcQZgXAHFYItwAehOzvxJCxHV8Fw0YBFm7eAxcWtpsBml0SAAYRStHkIwk8D+YXwAw8ABEsrk+ICWHdSuVKrhqrx6o0SM93JAiPg0L5UOl6nU8ph0F4aBQMNRJB50vsPCQAB5IcQYIiQAByRA+HPsJFw2G4rXUCD2ByUUi8+G4bE+kDIENqGBVmheHmBqRQnxIRCo4nwWBxEKUyAAyjaADL2CWFCihaL4PD8OqwyACfAc5qYehoezwAqRUbmhpEbCm+Dm/LcZxRdKC4XPAAS+BaJCkFAANChQv4gvB/MhhpRkOluJQ6o9mOgEup44zfIrkr5iuLJYgaNxEIWHAxYDM/NgMBgPnyQ4gGBR4NxQqyKMNQvrQQByZCAyjiBrJGiQWJ4U4L3DyAAUgNiAEp0Bhg83eYw1yxIK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VMqUySvMquO2sNCzQyvxGeq2lB3B0MAMHxWUSBW9G/TBVRPlXyBhT8DQB7NbMZX6GZSoFZSxQ5VxXxv+QpvUH9WekQH9X8AhC1ToH9RiNdBxTxoJuWAAHYBApaBA6gw00AJaCJN0ABGAATjDRIHWBIAEFWDHTQF1rqGVrHVVtWAYE2E3Tlols2H/V+QJqwtWDqAYDqHXQEFoAYC3TqHHTQGWE1tVvXUNoYFduVsNrqHWDlsNs2BIE3QlvoFtvZr1oEElpIBkwYHWAYDHU3WWG/IlsVvTsjt1pIDltVuVrQE3QYBLuWGVolpdtFq5SgHOk5u5t5rFIFtoH9UBVFqAA== -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=TryGhost/Ghost&utm_content=23453):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai explain this code block.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and explain its main purpose.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->
author_association: CONTRIBUTOR
user: login: cmraible
created_at: 2025-05-21T02:20:55Z
body: Pros:
- SSL-ish out of the box
- Simpler configuration than [nginx](https://github.com/TryGhost/Ghost/pull/23449)

Cons:
- Requires you to run a script locally to trust Caddy's CA and add the custom hostnames to your hosts file. If you don't do this, your browser will balk at the untrusted certificate
- Offers less parity with production than nginx
author_association: COLLABORATOR