Derive API path from frontend config URL
This commit is contained in:
@@ -17,6 +17,7 @@ COPY upstream/HubFrontend/ ./
|
||||
COPY docker/hcaptcha-sitekey.patch /tmp/hcaptcha-sitekey.patch
|
||||
COPY docker/remove-analytics.mjs /tmp/remove-analytics.mjs
|
||||
COPY docker/replace-fallback-avatar.mjs /tmp/replace-fallback-avatar.mjs
|
||||
COPY docker/use-config-url-api-path.mjs /tmp/use-config-url-api-path.mjs
|
||||
|
||||
RUN if grep -q 'sitekey="1788882d-3695-4807-abac-7d7166ec6325"' src/routes/auth/login.js; then \
|
||||
patch -p1 < /tmp/hcaptcha-sitekey.patch; \
|
||||
@@ -29,6 +30,7 @@ RUN if grep -q 'sitekey="1788882d-3695-4807-abac-7d7166ec6325"' src/routes/auth/
|
||||
|
||||
RUN node /tmp/remove-analytics.mjs
|
||||
RUN node /tmp/replace-fallback-avatar.mjs
|
||||
RUN node /tmp/use-config-url-api-path.mjs
|
||||
|
||||
ARG ASSETS_BASE=""
|
||||
ARG VITE_USE_MULTIHUB=false
|
||||
@@ -45,6 +47,13 @@ ENV ASSETS_BASE=${ASSETS_BASE} \
|
||||
RUN test -n "$VITE_HCAPTCHA_SITEKEY" \
|
||||
|| (echo "VITE_HCAPTCHA_SITEKEY must be set." >&2; exit 1)
|
||||
|
||||
RUN if [ "$VITE_USE_MULTIHUB" != "true" ]; then \
|
||||
case "$VITE_CONFIG_URL" in \
|
||||
*/client/config/global|*/client/config/global/) ;; \
|
||||
*) echo "VITE_CONFIG_URL must end with /client/config/global." >&2; exit 1 ;; \
|
||||
esac; \
|
||||
fi
|
||||
|
||||
RUN npm run build
|
||||
|
||||
# Electron entry points are not part of the web deployment.
|
||||
|
||||
Reference in New Issue
Block a user