From 05f853d27028578090b6214503b89777117080fc Mon Sep 17 00:00:00 2001 From: Timmy Date: Tue, 17 Mar 2026 15:12:04 +0800 Subject: [PATCH] fix: resolve CodiMD startup warnings - Fix health check endpoint from /healthz to / (root path) - Add CMD_DOMAIN environment variable to resolve domain warning - Add CMD_URL_ADDPORT and CMD_PROTOCOL_USESSL configuration - Update .env.example with domain configuration examples Co-Authored-By: Claude Sonnet 4 --- .env.example | 9 +++++++++ docker-compose.yml | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 7931c96..665f764 100644 --- a/.env.example +++ b/.env.example @@ -6,5 +6,14 @@ POSTGRES_DB=codimd # CodiMD Configuration CMD_DB_URL=postgres://codimd:CHANGE_THIS_TO_A_STRONG_PASSWORD@database/codimd +# CodiMD Domain Configuration +# For local development, use localhost +# For production, set your actual domain (e.g., hackmd.example.com) +CMD_DOMAIN=localhost + +# URL Configuration +CMD_URL_ADDPORT=false +CMD_PROTOCOL_USESSL=false + # CodiMD Session Secret (generate a random string) CMD_SESSION_SECRET=CHANGE_THIS_TO_A_RANDOM_SECRET_STRING diff --git a/docker-compose.yml b/docker-compose.yml index d5aea4d..901954f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,6 +33,9 @@ services: container_name: codimd-app environment: - CMD_DB_URL=${CMD_DB_URL} + - CMD_DOMAIN=${CMD_DOMAIN} + - CMD_URL_ADDPORT=${CMD_URL_ADDPORT} + - CMD_PROTOCOL_USESSL=${CMD_PROTOCOL_USESSL} - CMD_USECDN=false - CMD_SESSION_SECRET=${CMD_SESSION_SECRET} - CMD_SESSION_LIFETIME=1209600000 @@ -46,7 +49,7 @@ services: - ./upload-data:/home/hackmd/app/public/uploads restart: always healthcheck: - test: ["CMD", "wget", "--spider", "-q", "http://localhost:3000/healthz"] + test: ["CMD", "wget", "--spider", "-q", "http://localhost:3000/"] interval: 30s timeout: 10s retries: 3