Skip to content

Commit 77340ab

Browse files
authored
fix(self-host): check installer health locally (#1757)
1 parent 4f1a8df commit 77340ab

3 files changed

Lines changed: 6 additions & 25 deletions

File tree

docs/self-hosting/server-guide.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,9 @@ sudo systemctl restart caddy
217217

218218
## 5. Switch Compass to your public URLs
219219

220-
> **Warning.** Don't change `BASEURL` until step 4 succeeds. Compass uses
221-
> `BASEURL` for health checks. If `BASEURL` points at an HTTPS URL Caddy can't
222-
> serve yet, the health check fails even if the containers are running.
220+
> **Warning.** Don't change `BASEURL` until step 4 succeeds. The browser uses
221+
> `BASEURL` for API requests. If `BASEURL` points at an HTTPS URL Caddy can't
222+
> serve yet, the app can load but cannot reach the backend.
223223
224224
Edit the env file:
225225

@@ -268,7 +268,7 @@ cd ~/compass
268268
./compass logs backend
269269
```
270270

271-
> **Tip.** If you ever need the helper to check the local backend directly while `BASEURL` stays public, add `COMPASS_HEALTH_URL=http://127.0.0.1:3000/api/health` to `~/compass/.env`. Most one-domain installs don't need this once Caddy is working.
271+
> **Tip.** The `./compass` helper checks backend health through localhost using `PORT`. Set `COMPASS_HEALTH_URL` only if you move the backend health endpoint to a different local address.
272272
273273
## 6. Sign in and test the basics
274274

packages/web/src/common/constants/more.cmd.constants.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ export const moreCommandPaletteItems: Array<{
2828
children: `Version: ${typeof BUILD_VERSION === "string" ? BUILD_VERSION : "dev"}`,
2929
icon: "InformationCircleIcon",
3030
onClick: () => {
31-
const v =
32-
typeof BUILD_VERSION === "string" ? BUILD_VERSION : "dev";
31+
const v = typeof BUILD_VERSION === "string" ? BUILD_VERSION : "dev";
3332
void navigator.clipboard.writeText(v);
3433
},
3534
},

self-host/install.sh

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -253,23 +253,6 @@ read_env_value() {
253253
fi
254254
}
255255

256-
append_health_path() {
257-
base_url=$1
258-
259-
while :; do
260-
case $base_url in
261-
*/)
262-
base_url=${base_url%/}
263-
;;
264-
*)
265-
break
266-
;;
267-
esac
268-
done
269-
270-
printf '%s/health\n' "$base_url"
271-
}
272-
273256
load_runtime_config() {
274257
web_port=$(strip_quotes "$(read_env_value WEB_PORT)")
275258
backend_port=$(strip_quotes "$(read_env_value PORT)")
@@ -280,11 +263,10 @@ load_runtime_config() {
280263
validate_port_value PORT "$PORT_VALUE"
281264

282265
frontend_url=$(strip_quotes "$(read_env_value FRONTEND_URL)")
283-
baseurl=$(strip_quotes "$(read_env_value BASEURL)")
284266
health_url=$(strip_quotes "$(read_env_value COMPASS_HEALTH_URL)")
285267

286268
APP_URL=${frontend_url:-http://localhost:$WEB_PORT_VALUE}
287-
HEALTH_URL=${COMPASS_HEALTH_URL:-${health_url:-$(append_health_path "${baseurl:-http://localhost:$PORT_VALUE/api}")}}
269+
HEALTH_URL=${COMPASS_HEALTH_URL:-${health_url:-http://localhost:$PORT_VALUE/api/health}}
288270
}
289271

290272
random_hex() {

0 commit comments

Comments
 (0)