Healthchek failing if 'domain' is set in config.json #656

Closed
opened 2026-02-04 22:05:14 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @andpp on GitHub (Mar 24, 2020).

Subject of the issue

healthcheck.sh script does not aware of 'domain' setting and HEALTHCHECK will fail if subfolder is used.

Your environment

  • Bitwarden_rs version: 1.14.1
  • Install method: Docker

Proposed Fix

Temporary I use this healthcheck.sh. It works for my setting but I as I am not familiar with the server internals, am not sure it will work for all possible variants for defining domain.

My domain definition from config.json. I do not use DOMAIN variable

"domain" : "https://my.server/bw_subfolder/",

#!/usr/bin/env sh

DM="$(cat /data/config.json | grep domain | sed -n 's|.*http.*/\(.*\)/.*|\1|p')"
if [ ! -z "$DM" ]
then
   DM="/$DM"
fi

if [ -z "$ROCKET_TLS"]
then
  curl --fail http://localhost:${ROCKET_PORT:-"80"}$DM/alive || exit 1
else
  curl --insecure --fail https://localhost:${ROCKET_PORT:-"80"}$DM/alive || exit 1
fi
Originally created by @andpp on GitHub (Mar 24, 2020). ### Subject of the issue healthcheck.sh script does not aware of 'domain' setting and HEALTHCHECK will fail if subfolder is used. ### Your environment <!-- The version number, obtained from the logs or the admin page --> * Bitwarden_rs version: 1.14.1 <!-- How the server was installed: Docker image / package / built from source --> * Install method: Docker ### Proposed Fix Temporary I use this healthcheck.sh. It works for my setting but I as I am not familiar with the server internals, am not sure it will work for all possible variants for defining domain. My domain definition from config.json. I do not use DOMAIN variable "domain" : "https://my.server/bw_subfolder/", ``` #!/usr/bin/env sh DM="$(cat /data/config.json | grep domain | sed -n 's|.*http.*/\(.*\)/.*|\1|p')" if [ ! -z "$DM" ] then DM="/$DM" fi if [ -z "$ROCKET_TLS"] then curl --fail http://localhost:${ROCKET_PORT:-"80"}$DM/alive || exit 1 else curl --insecure --fail https://localhost:${ROCKET_PORT:-"80"}$DM/alive || exit 1 fi ```
Author
Owner

@jjlin commented on GitHub (Mar 24, 2020):

Sorry, overlooked this aspect when implementing the subpath stuff. I'll work on a fix later today.

@jjlin commented on GitHub (Mar 24, 2020): Sorry, overlooked this aspect when implementing the subpath stuff. I'll work on a fix later today.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#656