Skip to content

Commit 8884b9f

Browse files
milanmajchrakclaude
andcommitted
Require DSPACE_UI_BASEURL in the deploy compose
7.6.7 stopped deriving `ui.baseUrl` from DSPACE_UI_HOST/PORT/SSL and hardcoded `http://localhost:4000` instead, so those vars are now silently ignored for this purpose. Legacy `/bitstream/handle/...` redirects and the robots.txt Sitemap would point at localhost with no error in the log. `docker/docker-compose.yml` now requires DSPACE_UI_BASEURL with no default, so a deploy that forgets it fails loudly. It has to be added to each instance's env file (deploy.yml passes `--env-file /opt/dspace-envs/...`). CI is unaffected - docker-compose-ci.yml has no dspace-angular service. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent c1bc451 commit 8884b9f

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

README-dtq.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,17 @@ DSPACE_NAMESPACE # The namespace of the angular application
121121
DSPACE_SSL # Whether the angular application uses SSL [true/false]
122122
```
123123

124+
**Required since 7.6.7:**
125+
126+
```bash
127+
DSPACE_UI_BASEURL # Public URL this UI answers on, e.g. https://lindat.example.org/repository
128+
```
129+
130+
`ui.baseUrl` used to be derived from `DSPACE_HOST`/`DSPACE_PORT`/`DSPACE_SSL`; 7.6.7 replaced that with a
131+
hardcoded `http://localhost:4000` default. It is used for legacy `/bitstream/handle/...` redirects and for
132+
the `robots.txt` Sitemap, so leaving it at the default silently breaks historical citation URLs.
133+
`docker/docker-compose.yml` therefore requires it - the stack refuses to start if it is missing from `.env`.
134+
124135
All other settings can be set using the following convention for naming the environment variables:
125136

126137
1. replace all `.` with `_`

docker/docker-compose.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ services:
2222
# Use only `4000`, not the {UI_PORT} from the .env because in the container it is always `4000`
2323
DSPACE_UI_PORT: 4000
2424
DSPACE_UI_NAMESPACE: ${DSPACE_UI_NAMESPACE:-/}
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}
2530
DSPACE_REST_SSL: ${DSPACE_SSL:-false}
2631
DSPACE_REST_HOST: ${DSPACE_HOST:-localhost}
2732
DSPACE_REST_PORT: ${DSPACE_REST_PORT:-8080}

0 commit comments

Comments
 (0)