Skip to content

Commit 50e0935

Browse files
Merge branch 'DSpace:main' into i18n/pt-br-missing-keys
2 parents bed8bc4 + 18726ef commit 50e0935

File tree

206 files changed

+19802
-1035
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+19802
-1035
lines changed

.github/workflows/codescan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on:
2525
jobs:
2626
analyze:
2727
name: Analyze Code
28-
runs-on: ubuntu-latest
28+
runs-on: ubuntu-slim
2929
# Limit permissions of this GitHub action. Can only write to security-events
3030
permissions:
3131
actions: read

.github/workflows/docker.yml

Lines changed: 115 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,118 @@ jobs:
5757
# Enable redeploy of sandbox & demo if the branch for this image matches the deployment branch of
5858
# these sites as specified in reusable-docker-build.xml
5959
REDEPLOY_SANDBOX_URL: ${{ secrets.REDEPLOY_SANDBOX_URL }}
60-
REDEPLOY_DEMO_URL: ${{ secrets.REDEPLOY_DEMO_URL }}
60+
REDEPLOY_DEMO_URL: ${{ secrets.REDEPLOY_DEMO_URL }}
61+
62+
#################################################################################
63+
# Test Deployment via Docker to ensure newly built images are working properly
64+
#################################################################################
65+
docker-deploy:
66+
# Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace-angular'
67+
if: github.repository == 'dspace/dspace-angular'
68+
runs-on: ubuntu-latest
69+
# Must run after all major images are built
70+
needs: [dspace-angular, dspace-angular-dist]
71+
env:
72+
# Override default dspace.server.url & REST 'host' because backend starts at http://127.0.0.1:8080
73+
dspace__P__server__P__url: http://127.0.0.1:8080/server
74+
DSPACE_REST_HOST: 127.0.0.1
75+
# Override default dspace.ui.url to also use 127.0.0.1.
76+
dspace__P__ui__P__url: http://127.0.0.1:4000
77+
steps:
78+
# Checkout our codebase (to get access to Docker Compose scripts)
79+
- name: Checkout codebase
80+
uses: actions/checkout@v4
81+
# Download Docker image artifacts (which were just built by reusable-docker-build.yml)
82+
- name: Download Docker image artifacts
83+
uses: actions/download-artifact@v4
84+
with:
85+
# Download all amd64 Docker images (TAR files) into the /tmp/docker directory
86+
pattern: docker-image-*-linux-amd64
87+
path: /tmp/docker
88+
merge-multiple: true
89+
# Load each of the images into Docker by calling "docker image load" for each.
90+
# This ensures we are using the images just built & not any prior versions on DockerHub
91+
- name: Load all downloaded Docker images
92+
run: |
93+
find /tmp/docker -type f -name "*.tar" -exec docker image load --input "{}" \;
94+
docker image ls -a
95+
# Start backend using our compose script in the codebase.
96+
- name: Start backend in Docker
97+
# MUST use docker.io as we don't have a copy of this backend image in our GitHub Action,
98+
# and docker.io is the only public image. If we ever hit aggressive rate limits at DockerHub,
99+
# we may need to consider making the 'ghcr.io' images public & switch this to 'ghcr.io'
100+
env:
101+
DOCKER_REGISTRY: docker.io
102+
run: |
103+
docker compose -f docker/docker-compose-rest.yml up -d
104+
sleep 10
105+
docker container ls
106+
# Create a test admin account. Load test data from a simple set of AIPs as defined in cli.ingest.yml
107+
- name: Load test data into Backend
108+
run: |
109+
docker compose -f docker/cli.yml run --rm dspace-cli create-administrator -e test@test.edu -f admin -l user -p admin -c en
110+
docker compose -f docker/cli.yml -f docker/cli.ingest.yml run --rm dspace-cli
111+
# Verify backend started successfully.
112+
# 1. Make sure root endpoint is responding (check for dspace.name defined in docker-compose.yml)
113+
# 2. Also check /collections endpoint to ensure the test data loaded properly (check for a collection name in AIPs)
114+
- name: Verify backend is responding properly
115+
run: |
116+
result=$(wget -O- -q http://127.0.0.1:8080/server/api)
117+
echo "$result"
118+
echo "$result" | grep -oE "\"DSpace Started with Docker Compose\""
119+
result=$(wget -O- -q http://127.0.0.1:8080/server/api/core/collections)
120+
echo "$result"
121+
echo "$result" | grep -oE "\"Dog in Yard\""
122+
# Start production frontend using our compose script in the codebase.
123+
- name: Start production frontend in Docker
124+
# Specify the GHCR copy of the production frontend, so that we use the newly built image
125+
env:
126+
DOCKER_REGISTRY: ghcr.io
127+
run: |
128+
docker compose -f docker/docker-compose-dist.yml up -d
129+
sleep 10
130+
docker container ls
131+
# Verify production frontend started successfully.
132+
# 1. Make sure /home path has "DSpace software" (this is in the footer of the page)
133+
# 2. Also check /community-list page lists one of the test Communities in the loaded test data
134+
- name: Verify production frontend is responding properly
135+
run: |
136+
result=$(wget -O- -q http://127.0.0.1:4000/home)
137+
echo "$result"
138+
echo "$result" | grep -oE "\"DSpace software\""
139+
- name: Error logs of production frontend (if error in startup)
140+
if: ${{ failure() }}
141+
run: |
142+
docker compose -f docker/docker-compose-dist.yml logs
143+
# Now shutdown the production frontend image and startup the development frontend image
144+
- name: Shutdown production frontend
145+
run: |
146+
docker compose -f docker/docker-compose-dist.yml down
147+
sleep 10
148+
docker container ls
149+
- name: Startup development frontend
150+
# Specify the GHCR copy of the development frontend, so that we use the newly built image
151+
env:
152+
DOCKER_REGISTRY: ghcr.io
153+
run: |
154+
docker compose -f docker/docker-compose.yml up -d
155+
sleep 10
156+
docker container ls
157+
# Verify development frontend started successfully.
158+
# 1. First, keep requesting the frontend every 10 seconds to wait until its up. Timeout after 10 minutes.
159+
# 2. Once it's responding, check to see if the word "DSpace" appears.
160+
# We cannot check for anything more specific because development mode doesn't have SSR.
161+
- name: Verify development frontend is responding properly
162+
run: |
163+
timeout 10m wget --retry-connrefused -t 0 --waitretry=10 http://127.0.0.1:4000
164+
result=$(wget -O- -q http://127.0.0.1:4000)
165+
echo "$result"
166+
echo "$result" | grep -oE "DSpace"
167+
- name: Error logs of development frontend (if error in startup)
168+
if: ${{ failure() }}
169+
run: |
170+
docker compose -f docker/docker-compose.yml logs
171+
# Shutdown our containers
172+
- name: Shutdown running Docker containers
173+
run: |
174+
docker compose -f docker/docker-compose.yml -f docker/docker-compose-rest.yml down

.github/workflows/issue_opened.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
permissions: {}
99
jobs:
1010
automation:
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-slim
1212
steps:
1313
# Add the new issue to a project board, if it needs triage
1414
# See https://github.com/actions/add-to-project

.github/workflows/label_merge_conflicts.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
triage:
1919
# Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace-angular'
2020
if: github.repository == 'dspace/dspace-angular'
21-
runs-on: ubuntu-latest
21+
runs-on: ubuntu-slim
2222
permissions:
2323
pull-requests: write
2424
steps:
@@ -36,4 +36,4 @@ jobs:
3636
conflict_comment: |
3737
Hi @${author},
3838
Conflicts have been detected against the base branch.
39-
Please [resolve these conflicts](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/about-merge-conflicts) as soon as you can. Thanks!
39+
Please [resolve these conflicts](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/about-merge-conflicts) as soon as you can. Thanks!

.github/workflows/port_merged_pull_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ permissions:
1818

1919
jobs:
2020
port_pr:
21-
runs-on: ubuntu-latest
21+
runs-on: ubuntu-slim
2222
# Don't run on closed *unmerged* pull requests
2323
if: github.event.pull_request.merged
2424
steps:
@@ -43,4 +43,4 @@ jobs:
4343
merge_commits: 'skip'
4444
# Use a personal access token (PAT) to create PR as 'dspace-bot' user.
4545
# A PAT is required in order for the new PR to trigger its own actions (for CI checks)
46-
github_token: ${{ secrets.PR_PORT_TOKEN }}
46+
github_token: ${{ secrets.PR_PORT_TOKEN }}

.github/workflows/pull_request_opened.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ permissions:
1616

1717
jobs:
1818
automation:
19-
runs-on: ubuntu-latest
19+
runs-on: ubuntu-slim
2020
steps:
2121
# Assign the PR to whomever created it. This is useful for visualizing assignments on project boards
2222
# See https://github.com/toshimaru/auto-author-assign

.github/workflows/stale.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# DSpace rules for flagging untouched issues and PRs as stale using 'stale':
2+
# https://github.com/actions/stale
3+
name: 'Mark issues and PRs as stale'
4+
on:
5+
# Schedule to run weekly on Sunday at 3:03am UTC
6+
# NOTE: This time is purposefully different from the "stale" bot settings in "DSpace/DSpace" to help
7+
# ensure we don't hit GitHub's rate limits.
8+
schedule:
9+
- cron: '3 3 * * 0'
10+
11+
permissions:
12+
issues: write
13+
pull-requests: write
14+
15+
jobs:
16+
stale:
17+
runs-on: ubuntu-slim
18+
steps:
19+
- uses: actions/stale@v10
20+
with:
21+
# Number of GitHub API calls to allow in a single run (to avoid hitting GitHub's rate limit)
22+
# Default is 30. But, we've found that only results in processing ~7 issues or PRs. So, we've increased it.
23+
operations-per-run: 60
24+
# Issues will be marked stale after 3 years of no activity
25+
days-before-issue-stale: 1095
26+
# Issues marked stale will be closed after one additional week of no activity
27+
days-before-issue-close: 7
28+
# High priority issues are never marked stale
29+
exempt-issue-labels: 'high priority'
30+
# When an issue is marked stale, this label and comment will be added to the issue.
31+
stale-issue-label: stale
32+
stale-issue-message: |
33+
This issue has been automatically marked as stale because it has not had
34+
activity in 3 years. It will be closed in 7 days if no further activity occurs.
35+
36+
Allowing issues to close as stale helps us filter out issues which can wait
37+
for future development time. All issues closed by this bot will continue to act
38+
like normal issues; they can be searched for, commented on or reopened at any point.
39+
40+
To extend the lifetime of an issue please comment below. This will help us to see
41+
that this issue is still affecting you with current versions of DSpace, and encourage
42+
us to re-prioritize this issue.
43+
# When an issue is closed, this comment will be added to the issue.
44+
close-issue-message: |
45+
This issue has been closed automatically as "stale". If this still affects you please
46+
request to re-open this issue via a comment, providing us with details on how this still
47+
impacts your usage of DSpace.
48+
# PRs will be marked stale after 1 year of no activity
49+
days-before-pr-stale: 365
50+
# PRs marked stale will be closed after two additional weeks of no activity
51+
days-before-pr-close: 14
52+
# High priority PRs are never marked stale
53+
exempt-pr-labels: 'high priority'
54+
# When a PR is marked stale, this label and comment will be added to the issue.
55+
stale-pr-label: stale
56+
stale-pr-message: |
57+
This pull request has been automatically marked as stale because it has not had
58+
activity in one year. It will be closed in 14 days if no further activity occurs.
59+
60+
Allowing pull requests to close as stale helps us filter out old work that is no longer
61+
relevant and helps developers focus on reviewing current work.
62+
63+
All pull requests closed by this bot act like normal pull requests;
64+
they can be searched for, commented on or reopened at any point.
65+
66+
If these changes are still relevant then please comment and/or rebase your PR based on the
67+
latest DSpace code. This will remove the stale status and notify us to assign a reviewer
68+
for your PR.
69+
close-pr-message: |
70+
This pull request has been closed automatically. If these changes are still relevant
71+
then please re-open this pull request with a comment and rebase your PR based on the latest
72+
DSpace code. This will notify us to assign a reviewer to your PR.

Dockerfile

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,34 @@
11
# This image will be published as dspace/dspace-angular
22
# See https://github.com/DSpace/dspace-angular/tree/main/docker for usage details
33

4-
FROM docker.io/node:20-alpine
4+
FROM docker.io/node:22-alpine
55

66
# Ensure Python and other build tools are available
77
# These are needed to install some node modules, especially on linux/arm64
8-
RUN apk add --update python3 make g++ && rm -rf /var/cache/apk/*
8+
RUN apk --no-cache add python3 make g++
99

1010
WORKDIR /app
11-
ADD . /app/
12-
EXPOSE 4000
1311

14-
RUN npm install
12+
# Copy over package files first, so this layer will only be rebuilt if those files change.
13+
COPY package.json package-lock.json ./
14+
# NOTE: "ci" = clean install from package files
15+
RUN npm ci
16+
17+
# Add the rest of the source code
18+
COPY . /app/
1519

1620
# When running in dev mode, 4GB of memory is required to build & launch the app.
1721
# This default setting can be overridden as needed in your shell, via an env file or in docker-compose.
1822
# See Docker environment var precedence: https://docs.docker.com/compose/environment-variables/envvars-precedence/
1923
ENV NODE_OPTIONS="--max_old_space_size=4096"
2024

2125
# On startup, run in DEVELOPMENT mode (this defaults to live reloading enabled, etc).
22-
# Listen / accept connections from all IP addresses.
23-
# NOTE: At this time it is only possible to run Docker container in Production mode
24-
# if you have a public URL. See https://github.com/DSpace/dspace-angular/issues/1485
2526
ENV NODE_ENV=development
26-
CMD npm run serve -- --host 0.0.0.0
27+
28+
EXPOSE 4000
29+
30+
# On startup, run this command to start application in dev mode
31+
ENTRYPOINT [ "npm", "run", "serve" ]
32+
# By default set host to 0.0.0.0 to listen/accept connections from all IP addresses.
33+
# Poll for changes every 5 seconds (if any detected, app will rebuild/restart)
34+
CMD ["--", "--host 0.0.0.0", "--poll 5000"]

Dockerfile.dist

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,46 @@
44
# Test build:
55
# docker build -f Dockerfile.dist -t dspace/dspace-angular:latest-dist .
66

7-
FROM docker.io/node:20-alpine AS build
7+
# Step 1 - Build code for production
8+
FROM docker.io/node:22-alpine AS build
89

910
# Ensure Python and other build tools are available
1011
# These are needed to install some node modules, especially on linux/arm64
11-
RUN apk add --update python3 make g++ && rm -rf /var/cache/apk/*
12+
RUN apk --no-cache add python3 make g++
1213

1314
WORKDIR /app
15+
# Copy over package files first, so this layer will only be rebuilt if those files change.
1416
COPY package.json package-lock.json ./
15-
RUN npm install
17+
# NOTE: "ci" = clean install from package files
18+
RUN npm ci
1619

17-
ADD . /app/
20+
# Around 4GB of memory is required to build the app for production.
21+
# This default setting can be overridden as needed in your shell, via an env file or in docker-compose.
22+
# See Docker environment var precedence: https://docs.docker.com/compose/environment-variables/envvars-precedence/
23+
ENV NODE_OPTIONS="--max_old_space_size=4096"
24+
25+
COPY . /app/
1826
RUN npm run build:prod
1927

20-
FROM node:20-alpine
28+
# Step 2 - Start up UI via PM2
29+
FROM docker.io/node:22-alpine
30+
31+
# Install PM2
2132
RUN npm install --global pm2
2233

34+
# Copy pre-built code from build image
2335
COPY --chown=node:node --from=build /app/dist /app/dist
36+
# Copy configs and PM2 startup script from local machine
2437
COPY --chown=node:node config /app/config
2538
COPY --chown=node:node docker/dspace-ui.json /app/dspace-ui.json
2639

40+
# Start up UI in PM2 in production mode
2741
WORKDIR /app
2842
USER node
2943
ENV NODE_ENV=production
3044
EXPOSE 4000
31-
CMD pm2-runtime start dspace-ui.json --json
45+
46+
# On startup, run start the DSpace UI in PM2
47+
ENTRYPOINT [ "pm2-runtime", "start", "dspace-ui.json" ]
48+
# By default, pass param that specifies to use JSON format logs.
49+
CMD ["--json"]

config/config.example.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ ui:
1010
port: 4000
1111
# NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
1212
nameSpace: /
13-
# The rateLimiter settings limit each IP to a 'max' of 500 requests per 'windowMs' (1 minute).
13+
# The rateLimiter settings limit each IP to a 'limit' of 500 requests per 'windowMs' (1 minute).
1414
rateLimiter:
1515
windowMs: 60000 # 1 minute
16-
max: 500 # limit each IP to 500 requests per windowMs
16+
limit: 500 # limit each IP to 500 requests per windowMs
17+
# IPv6 subnet mask applied to IPv6 addresses.
18+
# See: https://express-rate-limit.mintlify.app/reference/configuration#ipv6subnet
19+
ipv6Subnet: 56
1720
# Trust X-FORWARDED-* headers from proxies (default = true)
1821
useProxies: true
1922

@@ -295,12 +298,18 @@ languages:
295298
- code: lv
296299
label: Latviešu
297300
active: true
301+
- code: ml
302+
label: മലയാളം
303+
active: true
298304
- code: mr
299305
label: मराठी
300306
active: true
301307
- code: nl
302308
label: Nederlands
303309
active: true
310+
- code: od
311+
label: ଓଡିଆ
312+
active: true
304313
- code: pl
305314
label: Polski
306315
active: true
@@ -322,6 +331,9 @@ languages:
322331
- code: sv
323332
label: Svenska
324333
active: true
334+
- code: te
335+
label: తెలుగు
336+
active: true
325337
- code: ta
326338
label: தமிழ்
327339
active: true

0 commit comments

Comments
 (0)