Skip to content

Commit

Permalink
Read legacy register config. Fix Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed Feb 1, 2024
1 parent bba70a2 commit 983d866
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fi
REGISTER_URL="${REGISTER_URL}/${REGISTER_FILE}"

cat << EOF > /app/config.js
window.bblocksRegisters = ['${REGISTER_URL}'];
window.bblocksRegister = ['${REGISTER_URL}'];
window.bblocksViewer = {
title: $(jq '.name // "Building Blocks Register"' < "/register/$REGISTER_FILE"),
};
Expand All @@ -40,4 +40,4 @@ export VITE_DYNAMIC_BASE_URL=

echo "Building Blocks viewer running on http://localhost:9090 (remember to check your forwarded ports)"

exec nginx -g "daemon off;${NGINX_ACCESS_LOG}"
exec nginx -g "daemon off;${NGINX_ACCESS_LOG}"
5 changes: 4 additions & 1 deletion src/services/config.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ if (registerParam?.length) {
}

if (!register) {
register = window.bblocksRegister;
register = window.bblocksRegister || window.bblocksRegisters;
if (Array.isArray(register)) {
register = register[0];
}
}
if (!register && import.meta.env.VITE_BBLOCK_REGISTER) {
register = import.meta.env.VITE_BBLOCK_REGISTER;
Expand Down

0 comments on commit 983d866

Please sign in to comment.