You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Restore vanilla's locale service (D7) and default the UI base URL to UI_URL
Two problems an independent review found in the previous two commits.
**D7 was not implemented as decided.** The instruction was to prefer vanilla unless
it breaks CLARIN functionality. `locale.service.ts` on the base branch is byte-identical
to `dspace-7.6.5`, i.e. the fork never customised it and a 3-way merge could not have
conflicted - yet the head carried a third blob with 7.6.5's logic. That silently dropped
vanilla's language-detection fix: the full Accept-Language q-list scan, case-insensitive
matching (`DE` and `en-GB` fell through to defaultLanguage), and "don't write an
auto-detected language to the cookie". Worse, the specs had been rewritten to assert the
old behaviour and vanilla's case-insensitivity test deleted, so green CI proved nothing.
`locale.service.ts`, `locale.service.spec.ts` and `locale.interceptor.spec.ts` are now
byte-identical to `dspace-7.6.7` again (verified with `git diff --numstat`).
The reason for the original revert was real: five CLARIN call sites are synchronous
template getters, and vanilla's `getCurrentLanguageCode()` has to be an Observable because
`getLanguageCodeList()` depends on the auth state. But those call sites do not want language
*negotiation* - they want the language the UI is currently rendering in. So they now use a
new, additive `getCurrentLanguageCodeSync()`, and vanilla's method is untouched. The CLARIN
test lives in a separate `locale.service.clarin.spec.ts` so the upstream spec stays
byte-identical and does not re-conflict on the next merge.
**`DSPACE_UI_BASEURL` ignored an existing convention and would have bricked every deploy.**
`UI_URL` is already defined in `build-scripts/run/envs/*` and already feeds the backend's
`dspace.ui.url` via `docker-compose-rest.yml` and `cli.yml` - the same value `ui.baseUrl` is
documented to hold. Requiring a brand-new variable with no default meant `start.sh`,
`deploy.yml` and every documented `docker/README.md` recipe would abort, and an override
compose file cannot rescue it because compose interpolates per file before merging.
`DSPACE_UI_BASEURL` now defaults to `UI_URL` and only fails when neither is set. Verified:
envs/.default (UI_URL only) -> DSPACE_UI_BASEURL: http://dev-5.pc
neither set -> error: required variable UI_URL is missing a value
DSPACE_UI_BASEURL explicit -> wins over UI_URL
`envs/.local` gained `UI_URL`; `docker/README.md` now carries the requirement next to the
recipes that need it. Two corrections to the earlier rationale: the blast radius also
includes the Google Scholar `citation_pdf_url` / `citation_abstract_html_url` meta tags, and
the pre-upgrade derived value was `http://dspace-angular:4000/`, not a working public URL -
so this fixes a long-standing wrong value rather than a regression the upgrade introduced.
The namespace caveat is now documented: `DSPACE_UI_NAMESPACE` must match the path in the URL
or the legacy-bitstream redirect drops the prefix.
Tests: locale specs 21 SUCCESS (16 upstream incl. the restored case-insensitivity test, plus
5 new), header/clarin-license-info/html-content specs 9 SUCCESS, lint clean on all changed
files.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docker/README.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,12 @@ A default/demo version of this image is built *automatically*.
58
58
- Docker compose file that will download and install data into a DSpace REST assetstore. This script points to a default dataset that will be utilized for CI testing.
59
59
60
60
61
+
> **Required since 7.6.7:** every recipe below that uses `docker/docker-compose.yml` needs the public UI URL.
62
+
> Set `UI_URL` (or `DSPACE_UI_BASEURL`) in your env file - `build-scripts/run/envs/.default` and `.local`
63
+
> already do. Without it compose refuses to start, because 7.6.7 no longer derives `ui.baseUrl` from
64
+
> `DSPACE_UI_HOST`/`PORT`/`SSL` and would otherwise serve `http://localhost:4000` in redirects, `robots.txt`
65
+
> and the Google Scholar citation meta tags. See `README-dtq.md` for the namespace caveat.
Copy file name to clipboardExpand all lines: docker/docker-compose.yml
+9-4Lines changed: 9 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -23,10 +23,15 @@ services:
23
23
DSPACE_UI_PORT: 4000
24
24
DSPACE_UI_NAMESPACE: ${DSPACE_UI_NAMESPACE:-/}
25
25
# Public URL this UI answers on. Since 7.6.7 `ui.baseUrl` is no longer derived from
26
-
# DSPACE_UI_HOST/PORT/SSL, so it MUST be set explicitly in `.env` - otherwise legacy
27
-
# /bitstream/handle/... redirects and robots.txt Sitemap point at localhost.
28
-
# Intentionally has no default: a missing value fails the stack instead of failing silently.
29
-
DSPACE_UI_BASEURL: ${DSPACE_UI_BASEURL:?set it in .env to the public UI URL, e.g. https://lindat.example.org/repository}
26
+
# DSPACE_UI_HOST/PORT/SSL, so it has to be set explicitly - otherwise legacy
27
+
# /bitstream/handle/... redirects, the robots.txt Sitemap and the Google Scholar
28
+
# citation_* meta tags all point at localhost, silently.
29
+
# Defaults to UI_URL, which the env files already define and which also feeds the backend's
30
+
# `dspace.ui.url` (see docker-compose-rest.yml) - the two are meant to be the same value.
31
+
# If neither is set the stack refuses to start rather than serving wrong URLs.
32
+
# NOTE: if the UI is served under a namespace, DSPACE_UI_NAMESPACE must match the path in
33
+
# this URL, otherwise the legacy-bitstream redirect drops the prefix and 404s.
34
+
DSPACE_UI_BASEURL: ${DSPACE_UI_BASEURL:-${UI_URL:?set UI_URL (or DSPACE_UI_BASEURL) in the env file to the public UI URL, e.g. https://lindat.example.org/repository}}
0 commit comments