Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
207 commits
Select commit Hold shift + click to select a range
5aa23fa
um modifications.
blancoj Aug 16, 2023
9ae08ff
many changes
blancoj Nov 17, 2023
810b86b
Merge pull request #2 from mlibrary/issue-working2
blancoj Nov 17, 2023
c1516db
change to short display, no thumbnail on sub form and discovery labels.
blancoj Jan 29, 2024
751c8d9
Merge pull request #4 from mlibrary/issue-working3
blancoj Jan 29, 2024
37454f5
some changes to improve the look of the UI
blancoj Mar 18, 2024
022304a
Merge pull request #5 from mlibrary/issue-working4
blancoj Mar 18, 2024
022a0ab
altmetric changes and videos
blancoj Apr 16, 2024
0e45780
Merge pull request #6 from mlibrary/issue-working5
blancoj Apr 16, 2024
2652b1c
config and request copy changes.
blancoj Apr 19, 2024
77a1d48
Merge pull request #7 from mlibrary/issue-working6
blancoj Apr 19, 2024
ca86b4d
add altmetrics and more.
blancoj May 6, 2024
c7af4f7
Merge pull request #8 from mlibrary/issue-working7
blancoj May 6, 2024
af88c88
UI changes.
blancoj May 28, 2024
e0ad6ae
Merge pull request #9 from mlibrary/issue-working8
blancoj May 28, 2024
3898afe
serverLocation for stats config change and Schema.org
blancoj Aug 22, 2024
f613a4a
Merge pull request #10 from mlibrary/issue-working9
blancoj Aug 22, 2024
15a4768
UI changes requested by D&D
blancoj Oct 30, 2024
73f7e00
Merge pull request #11 from mlibrary/issue-working10
blancoj Oct 30, 2024
cddcd83
improved file listing in search and other changes
blancoj Nov 2, 2024
87b6fdc
Merge pull request #12 from mlibrary/issue-working11
blancoj Nov 2, 2024
6be5825
altmetrics size, upload box moved, Privacy statement removed
blancoj Nov 6, 2024
7e26ec2
Merge pull request #13 from mlibrary/issue-working12
blancoj Nov 6, 2024
6c91b36
formatting and deposit page changes
blancoj Nov 8, 2024
8a2363a
Merge pull request #14 from mlibrary/issue-working13
blancoj Nov 8, 2024
3166de7
some label changes
blancoj Nov 14, 2024
e595df7
Merge pull request #15 from mlibrary/issue-working14
blancoj Nov 14, 2024
c5bc3fb
a few more UI changes.
blancoj Dec 9, 2024
9d0a3b2
Merge pull request #16 from mlibrary/issue-working15
blancoj Dec 9, 2024
bcfec7c
change labels
blancoj Dec 10, 2024
7944839
Merge pull request #17 from mlibrary/issue-working16
blancoj Dec 10, 2024
1a1b439
make stats subscription with checkbox
blancoj Dec 12, 2024
2dff157
Merge pull request #18 from mlibrary/issue-working17
blancoj Dec 12, 2024
bf58d72
ui changes
blancoj Dec 16, 2024
17fef75
Merge pull request #19 from mlibrary/issue-working18
blancoj Dec 16, 2024
704e0fb
having robots.txt and clocks.txt show up and redirect / to rep home
blancoj Jan 20, 2025
d98d6a3
Merge pull request #20 from mlibrary/issue-working19
blancoj Jan 20, 2025
24f4213
In Deposits page start deposit like in 6
blancoj Jan 22, 2025
373dd52
Merge pull request #21 from mlibrary/issue-working20
blancoj Jan 22, 2025
1a952d3
set localhost to 0.0.0.0 in ui
blancoj Jan 23, 2025
8b6f680
Merge pull request #22 from mlibrary/issue-working21
blancoj Jan 23, 2025
dbec47a
output config file when using serve:ssr
blancoj Jan 24, 2025
48d4f43
Merge pull request #23 from mlibrary/issue-working22
blancoj Jan 24, 2025
6f1d11a
change to get serve:ssr to work
blancoj Jan 27, 2025
724d766
Merge pull request #24 from mlibrary/issue-working23
blancoj Jan 27, 2025
afe3273
Ensure there are no overrides changing this
blancoj Jan 27, 2025
c165d4d
Merge pull request #25 from mlibrary/issue-working24
blancoj Jan 27, 2025
03c39da
fix typo
blancoj Jan 27, 2025
f8c9f29
Merge pull request #26 from mlibrary/issue-working25
blancoj Jan 27, 2025
44fa415
cleanup code
blancoj Jan 28, 2025
343e2ab
Merge pull request #27 from mlibrary/issue-working25
blancoj Jan 28, 2025
e37db45
Format registry change AND requestcopy back to /documents
blancoj Feb 14, 2025
eb16e3c
Merge pull request #28 from mlibrary/issue-working26
blancoj Feb 14, 2025
45aed96
don't allow user to def format types, and a debug statement
blancoj Feb 14, 2025
a00e26c
Merge pull request #29 from mlibrary/issue-working27
blancoj Feb 14, 2025
c1ea350
created different panels for nav bar and don't allow coll admin to ed…
blancoj Mar 7, 2025
90cc8db
Merge pull request #30 from mlibrary/issue-working28
blancoj Mar 7, 2025
823856c
better profile group description
blancoj Mar 10, 2025
901bd4e
Merge pull request #31 from mlibrary/issue-working29
blancoj Mar 10, 2025
08d4654
pageSize 500 and separation in Profile Page
blancoj Mar 10, 2025
dd9d1ac
Merge pull request #32 from mlibrary/issue-working30
blancoj Mar 10, 2025
e7be6de
simple config changes
blancoj Mar 12, 2025
617f608
Merge pull request #33 from mlibrary/issue-working31
blancoj Mar 12, 2025
f694b38
UI changes from D&D review
blancoj Mar 18, 2025
558519d
Merge pull request #34 from mlibrary/issue-working32
blancoj Mar 18, 2025
6042fe2
styling and metrics for Prometheus setup
blancoj Mar 26, 2025
be70442
Merge pull request #35 from mlibrary/issue-working33
blancoj Mar 26, 2025
a69d754
change for metrics
blancoj Mar 26, 2025
1e2cef7
Merge pull request #36 from mlibrary/issue-working34
blancoj Mar 26, 2025
a977947
Don't show Accessiblity text for Bentley.
blancoj Mar 27, 2025
3c33c6a
Merge pull request #37 from mlibrary/issue-working35
blancoj Mar 27, 2025
2198760
UI fixes and bug fix on show full item
blancoj Mar 28, 2025
c88af27
Merge pull request #38 from mlibrary/issue-working36
blancoj Mar 28, 2025
8bd9f65
Update to About and Help
blancoj Mar 31, 2025
50fb391
Merge pull request #39 from mlibrary/issue-working38
blancoj Mar 31, 2025
e6e6bf1
lots of label and text changes
blancoj Apr 8, 2025
3f46ea2
Merge pull request #40 from mlibrary/issue-working39
blancoj Apr 8, 2025
edb5c11
file section in short display.
blancoj Apr 9, 2025
219c0d2
Merge pull request #41 from mlibrary/issue-working40
blancoj Apr 9, 2025
0d76f1b
HT/Fulcrum and tombstone file display
blancoj Apr 14, 2025
a260fba
Merge pull request #42 from mlibrary/issue-working41
blancoj Apr 14, 2025
98e8cab
make the banner on home page smaller.
blancoj Apr 17, 2025
819d30c
Merge pull request #43 from mlibrary/issue-working42
blancoj Apr 17, 2025
7aad039
attempt to x-forward
blancoj May 7, 2025
2063d72
Merge pull request #44 from mlibrary/issue-working43
blancoj May 7, 2025
1b85d64
deposit form remove icon
blancoj May 16, 2025
51d39ef
Merge pull request #45 from mlibrary/issue-working44
blancoj May 16, 2025
ea7ddfa
banner and footer minor text changes
blancoj May 20, 2025
ab666fa
Merge pull request #46 from mlibrary/issue-working46
blancoj May 20, 2025
3eb0976
use env for stats
blancoj Jun 25, 2025
65c92df
Merge pull request #47 from mlibrary/issue-working47
blancoj Jun 25, 2025
3d17ec0
config change
blancoj Jun 25, 2025
8523744
Merge pull request #48 from mlibrary/issue-working48
blancoj Jun 25, 2025
fe9479d
change stats labels
blancoj Jun 27, 2025
9e4608d
Merge pull request #49 from mlibrary/issue-working49
blancoj Jun 27, 2025
9d8bff5
remove universal header
blancoj Jun 27, 2025
b186fb2
Merge pull request #50 from mlibrary/issue-working50
blancoj Jun 27, 2025
7ae24a1
put universal header back in
blancoj Jun 27, 2025
c646029
Merge pull request #51 from mlibrary/issue-working51
blancoj Jun 27, 2025
16a9cae
UI fixes from Aurelia
blancoj Jul 15, 2025
0b665ca
Merge pull request #52 from mlibrary/issue-working52
blancoj Jul 15, 2025
366ac56
better formatting for cc license
blancoj Aug 6, 2025
d260da2
Merge pull request #53 from mlibrary/issue-working53
blancoj Aug 6, 2025
fa7bd05
updated this file to 7.4 because of error editing description metadata
blancoj Aug 28, 2025
e15fe81
Merge pull request #54 from mlibrary/issue-working54
blancoj Aug 28, 2025
c31f1e8
change to help and file listing
blancoj Sep 19, 2025
fcfbd81
Merge pull request #55 from mlibrary/issue-working54
blancoj Sep 19, 2025
cb4a73c
Revert "change to help and file listing"
blancoj Sep 19, 2025
e1794c1
Merge pull request #56 from mlibrary/revert-55-issue-working54
blancoj Sep 19, 2025
7a6b7fb
change display of files on simple page, and some links
blancoj Sep 19, 2025
7f0426b
Merge pull request #57 from mlibrary/issue-working60
blancoj Sep 19, 2025
46adf95
add help/about new
blancoj Sep 22, 2025
a253b3e
Merge pull request #58 from mlibrary/issue-working61
blancoj Sep 22, 2025
30dcc74
change help url
blancoj Sep 22, 2025
ce35450
Merge pull request #59 from mlibrary/issue-working62
blancoj Sep 22, 2025
d1166ec
add terms-of-deposit file
blancoj Oct 6, 2025
485d3e4
Merge pull request #60 from mlibrary/issue-working63
blancoj Oct 6, 2025
b432d9a
accessiblity changes
blancoj Oct 6, 2025
66b79ac
Merge pull request #61 from mlibrary/issue-working64
blancoj Oct 6, 2025
74072cf
more accessibility changes
blancoj Oct 7, 2025
50d4099
Merge pull request #62 from mlibrary/issue-working65
blancoj Oct 7, 2025
a63a9e6
fixed H2 sapcing for Abstract
blancoj Oct 7, 2025
01bb4ee
Merge pull request #63 from mlibrary/issue-working66
blancoj Oct 7, 2025
fe37a5e
don't display out-of-box login
blancoj Oct 8, 2025
85f6f54
Merge pull request #64 from mlibrary/issue-working67
blancoj Oct 8, 2025
98e0898
remove logs and added hdl for coll and comm
blancoj Oct 13, 2025
c707b39
Merge pull request #65 from mlibrary/issue-working68
blancoj Oct 13, 2025
79c32c5
issue with handle on coll and coll and home
blancoj Oct 13, 2025
a770c55
Merge pull request #66 from mlibrary/issue-working69
blancoj Oct 13, 2025
4b9ff88
remidiation text for BL and button lable
blancoj Oct 14, 2025
64814de
Merge pull request #67 from mlibrary/issue-working70
blancoj Oct 14, 2025
8711017
remove debug statement
blancoj Oct 15, 2025
c4b7fc7
Merge pull request #68 from mlibrary/issue-working72
blancoj Oct 15, 2025
2d14d48
change to labels
blancoj Oct 21, 2025
90214d8
Merge pull request #69 from mlibrary/issue-working73
blancoj Oct 21, 2025
db7eb96
don't do ssr in some cases
blancoj Oct 29, 2025
4548add
Merge pull request #70 from mlibrary/issue-working74
blancoj Oct 29, 2025
2b7aded
check for bad url
blancoj Oct 29, 2025
b8666a0
Merge pull request #71 from mlibrary/issue-working75
blancoj Oct 29, 2025
e3b6c2e
Update to About and Help pages
Oct 31, 2025
3bf0277
Merge pull request #72 from mlibrary/issue-joannahelp
blancoj Nov 3, 2025
0fc22be
more ssr filtering and dspace changed to docs
blancoj Nov 3, 2025
c56e2b4
Merge pull request #73 from mlibrary/issue-working77
blancoj Nov 3, 2025
057631b
indexing message
blancoj Nov 5, 2025
07612bc
Merge pull request #74 from mlibrary/issue-working79
blancoj Nov 5, 2025
44c4c40
remove banner and add configs
blancoj Nov 6, 2025
70dce0c
Merge pull request #75 from mlibrary/issue-working80
blancoj Nov 6, 2025
4f47d7f
new redirect for bad URLS
blancoj Nov 7, 2025
1b9a07a
Merge pull request #76 from mlibrary/issue-working81
blancoj Nov 7, 2025
d256134
remove config that seems to be causing the error
blancoj Nov 10, 2025
7488ca3
Merge pull request #77 from mlibrary/issue-working82
blancoj Nov 10, 2025
35770a5
revert to old way of handling bad urls
blancoj Nov 11, 2025
b52ffd5
Merge pull request #78 from mlibrary/issue-working83
blancoj Nov 11, 2025
212ee95
go back to redirecting assets urls
blancoj Nov 11, 2025
df691b9
Merge pull request #79 from mlibrary/issue-working84
blancoj Nov 11, 2025
ccf3ab4
remove about/help from nav bar
blancoj Nov 11, 2025
876a2c4
Merge pull request #80 from mlibrary/issue-working85
blancoj Nov 11, 2025
1130596
remove handle form ssr
blancoj Nov 12, 2025
764b5fe
Merge pull request #81 from mlibrary/issue-working86
blancoj Nov 12, 2025
14b54c5
more ssr filtering
blancoj Nov 12, 2025
55f6386
Merge pull request #82 from mlibrary/issue-working87
blancoj Nov 12, 2025
d31c546
make cc optional and no ssr for handle prefix
blancoj Nov 13, 2025
ed5457a
Merge pull request #83 from mlibrary/issue-working88
blancoj Nov 13, 2025
b9dde6b
exclude inline css from SSR
blancoj Nov 14, 2025
17c49d9
Merge pull request #84 from mlibrary/issue-working89
blancoj Nov 14, 2025
5dc20d4
search result no contributor.*
blancoj Nov 21, 2025
62d227a
Merge pull request #85 from mlibrary/issue-working91
blancoj Nov 21, 2025
4a5e50b
remove identifier.other from item display
blancoj Nov 25, 2025
40bde79
Merge pull request #86 from mlibrary/issue-working92
blancoj Nov 25, 2025
34dfe44
show indentifier.other
blancoj Dec 1, 2025
c3e0d2e
Merge pull request #87 from mlibrary/issue-working93
blancoj Dec 1, 2025
7d0a43b
only allow monthly subscription
blancoj Dec 1, 2025
013e034
Merge pull request #88 from mlibrary/issue-working94
blancoj Dec 1, 2025
adc9d86
give users ability to subscribe my D,W or M
blancoj Dec 1, 2025
5794f71
Merge pull request #89 from mlibrary/issue-working95
blancoj Dec 1, 2025
7140a2c
remove contact us from nav bar
blancoj Dec 2, 2025
0c08a5d
Merge pull request #90 from mlibrary/issue-working96
blancoj Dec 2, 2025
6c33f31
remove components not being used
blancoj Dec 2, 2025
7cb2de2
Merge pull request #91 from mlibrary/issue-working97
blancoj Dec 2, 2025
a521d8d
return 404 instead of 302 in error cases
blancoj Dec 8, 2025
7df3eaf
Merge pull request #92 from mlibrary/issue-working98
blancoj Dec 8, 2025
db4585e
Add javascript for cookie management
fritzfreiheit Feb 6, 2026
5ac93bb
Update accessibility statement
fritzfreiheit Feb 16, 2026
25430b1
Remove DBDocs-VPAT.pdf
fritzfreiheit Feb 19, 2026
9e2fd57
DEEPSPACE-368 - Doc Presv info link in upload
fritzfreiheit Mar 4, 2026
6a79f3a
Update static About page
fritzfreiheit Mar 19, 2026
ac8c5fb
Update Nav page, add static Searching
fritzfreiheit Mar 30, 2026
c6ff63d
Update static Searching
fritzfreiheit Apr 15, 2026
4d3693f
Update static Searching
fritzfreiheit Apr 17, 2026
4d6bd46
feat: config-driven showPasswordLogin exclusive toggle (DEEPBLUE-466)
gkostin1966 Apr 29, 2026
96f302e
fix: correct pre-existing TypeScript errors blocking test suite compi…
gkostin1966 Apr 29, 2026
9a8b20e
Apply suggestions from code review
gkostin1966 Apr 29, 2026
477cf5c
fix: correct reviewing-agent suggestion errors in spec files
gkostin1966 Apr 29, 2026
2fcfcf3
Apply suggestions from code review
gkostin1966 Apr 29, 2026
8a7e0d8
test: tighten item-withdraw assertion to exact reason value and eleme…
gkostin1966 Apr 29, 2026
8382755
test: strengthen log-in spec — assert rendered authMethodType via inn…
gkostin1966 Apr 29, 2026
a131f7d
Apply suggestions from code review
gkostin1966 Apr 29, 2026
36a03ee
docs: add non-interactive CLI flag guideline to AGENTS.md
gkostin1966 Apr 29, 2026
d46949e
test: revert broken TestBed.overrideProvider approach — use direct pr…
gkostin1966 Apr 29, 2026
3c57ff7
test: rename it() description to reflect exclusive-toggle behavior (D…
gkostin1966 Apr 29, 2026
4f1b202
Merge pull request #94 from mlibrary/show-password-login
gkostin1966 Apr 29, 2026
2307918
changed Terms of Deposit to Terms of Use
pacerda Jun 29, 2026
163e09a
adds Harmful Descriptive Language section (AKA DB Docs' contextualiza…
pacerda Jun 29, 2026
2438397
this page was significantly revised to include terms of use for users…
pacerda Jun 29, 2026
f27b28d
corrected typo in date
pacerda Jun 29, 2026
6bb272b
Ignore Greg's Agent Framework local settings and agents.
gkostin1966 Jul 22, 2026
2a3fd7b
chore: migrate agent tracking files to .agents/ framework (out of pro…
gkostin1966 Jul 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Ignore Greg's Agent Framework local settings and agents.
# This is a symbolic link to the actual directory,
# which is located outside of the repository.
.agents

/.angular/cache
/__build__
/__server_build__
Expand All @@ -18,6 +23,7 @@ npm-debug.log
*.ngfactory.ts
*.css.shim.ts
*.scss.shim.ts
*.backup

.DS_Store

Expand All @@ -29,7 +35,7 @@ morgan.log

yarn-error.log

*.css
#*.css

package-lock.json

Expand All @@ -41,3 +47,6 @@ package-lock.json
junit.xml

/src/mirador-viewer/config.local.js

config/config.development.yaml

3 changes: 2 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"aot": true,
"assets": [
"src/assets",
"src/robots.txt"
"src/robots.txt",
"src/clockss.txt"
],
"styles": [
"src/styles/startup.scss",
Expand Down
16 changes: 12 additions & 4 deletions config/config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ cache:
anonymousCache:
# Maximum number of pages to cache. Default is zero (0) which means anonymous user cache is disabled.
# As all pages are cached in server memory, increasing this value will increase memory needs.
# Individual cached pages are usually small (<100KB), so a value of max=1000 would only require ~100MB of memory.
# Individual cached pages are usually small (<100KB), so a value of max=1000 would only require ~100MB of memory.
max: 0
# Amount of time after which cached pages are considered stale (in ms). After becoming stale, the cached
# copy is automatically refreshed on the next request.
Expand All @@ -100,6 +100,11 @@ auth:
# If the rest token expires in less than this amount of time, it will be refreshed automatically.
# This is independent from the idle warning.
timeLeftBeforeTokenRefresh: 120000 # 2 minutes
# When true, show only the username/password login form and hide all non-password authentication methods.
# Set to true only in environments where password login should be the only login option (e.g. demo).
# Default: false (non-password authentication methods such as OIDC/LDAP/X509 remain available, password form hidden).
# Can also be set via environment variable: DSPACE_AUTH_SHOWPASSWORDLOGIN=true
# showPasswordLogin: false

# Form settings
form:
Expand Down Expand Up @@ -246,12 +251,15 @@ browseBy:
# The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items)
defaultLowerLimit: 1900
# If true, thumbnail images for items will be added to BOTH search and browse result lists.
showThumbnails: true
showThumbnails: false
# The number of entries in a paginated browse results list.
# Rounded to the nearest size in the list of selectable sizes on the
# settings menu.
pageSize: 20

# Show the Altmetric badge in the simple item page.
showAltmetricBadge: true

communityList:
# No. of communities to list per expansion (show more)
pageSize: 20
Expand Down Expand Up @@ -376,7 +384,7 @@ vocabularies:
vocabulary: 'srsc'
enabled: true

# Default collection/community sorting order at Advanced search, Create/update community and collection when there are not a query.
# Default collection/community sorting order at Advanced search, Create/update community and collection when there are not a query.
comcolSelectionSort:
sortField: 'dc.title'
sortDirection: 'ASC'
sortDirection: 'ASC'
6 changes: 5 additions & 1 deletion config/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
ui:
host: 0.0.0.0
rest:
ssl: true
host: api7.dspace.org
host: backend.production.deepblue-documents.lib.umich.edu
port: 443
nameSpace: /server
item:
showAltmetricBadge: true
1 change: 1 addition & 0 deletions docker/docker-compose-rest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ services:
environment:
PGDATA: /pgdata
image: dspace/dspace-postgres-pgcrypto
platform: linux/amd64
networks:
dspacenet:
ports:
Expand Down
123 changes: 117 additions & 6 deletions server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ const cookieParser = require('cookie-parser');

const appConfig: AppConfig = buildAppConfig(join(DIST_FOLDER, 'assets/config.json'));

// List of paths for SSR; you can use regex for more flexibility if needed
const ssrPaths = [
'/documents',
'/items/',
'/collections/',
'/communities/',
'/bitstream/',
'/bitstreams/'
];

// cache of SSR pages for known bots, only enabled in production mode
let botCache: LRU<string, any>;

Expand All @@ -78,6 +88,15 @@ let anonymousCache: LRU<string, any>;
// extend environment with app config for server
extendEnvironmentWithAppConfig(environment, appConfig);


// Helper function to extract client IP
function getClientIp(req) {
// Extracting IP from X-Forwarded-For if available
const xForwardedFor = req.headers['x-forwarded-for'];
return xForwardedFor ? xForwardedFor.split(',')[0] : req.connection.remoteAddress;
}


// The Express app is exported so that it can be used by serverless Functions.
export function app() {

Expand All @@ -90,7 +109,9 @@ export function app() {

// Tell Express to trust X-FORWARDED-* headers from proxies
// See https://expressjs.com/en/guide/behind-proxies.html
server.set('trust proxy', environment.ui.useProxies);
// server.set('trust proxy', environment.ui.useProxies);
server.set('trust proxy', true);


/*
* If production mode is enabled in the environment file:
Expand Down Expand Up @@ -130,6 +151,7 @@ export function app() {
server.engine('html', (_, options, callback) =>
ngExpressEngine({
bootstrap: ServerAppModule,
inlineCriticalCss: false,
providers: [
{
provide: REQUEST,
Expand Down Expand Up @@ -159,12 +181,26 @@ export function app() {
* Serve the robots.txt ejs template, filling in the origin variable
*/
server.get('/robots.txt', (req, res) => {
const clientIp = getClientIp(req);
console.log(`Client IP: ${clientIp}`);

res.setHeader('content-type', 'text/plain');
res.render('assets/robots.txt.ejs', {
'origin': req.protocol + '://' + req.headers.host
});
});

server.get('/clockss.txt', (req, res) => {
const clientIp = getClientIp(req);
console.log(`Client IP: ${clientIp}`);

res.setHeader('content-type', 'text/plain');
res.render('assets/clockss.txt.ejs', {
'origin': req.protocol + '://' + req.headers.host
});
});


/*
* Set views folder path to directory where template files are stored
*/
Expand Down Expand Up @@ -227,25 +263,84 @@ export function app() {
*/
router.get('*', cacheCheck, ngApp);


server.use(environment.ui.nameSpace, router);

server.set('trust proxy', true);

return server;
}

// Check if the request URL starts with any of the SSR paths
function shouldUseSSR(url) {
// First, check for the browse exclusion patterns
const browseBlacklistRegexes = [
/^\/communities\/[a-f0-9-]{36}\/browse(\/.*)?$/i,
/^\/collections\/[a-f0-9-]{36}\/browse(\/.*)?$/i,
];

// If the URL contains 'handle' anywhere, return false
if (/\/handle(\/|$)/i.test(url)) {
return false;
}

// If the URL contains '/2027.42' anywhere, return false
if (/\/2027\.42(\/|$)/i.test(url)) {
return false;
}

// If the url matches any exclusion, do NOT use SSR
if (browseBlacklistRegexes.some(regex => regex.test(url))) {
return false;
}

// Otherwise
return ssrPaths.some(path => url.startsWith(path));
}


/*
* The callback function to serve server side angular
*/
function ngApp(req, res) {
if (environment.universal.preboot) {
// Render the page to user via SSR (server side rendering)

console.log('SSR: Original Request= ' + req.url);

// If URL contains '/assets/', redirect to Deep Blue Repositories
if (req.url.includes('/assets/')) {
res.writeHead(404, {
'Location': 'https://www.lib.umich.edu/collections/deep-blue-repositories'
});
res.end();
return; // Exit after redirecting

}

if (
req.url.includes('/discover') ||
req.url.includes('/Mirage2') ||
req.url.includes('/feed/') ||
req.url.includes('/search-filter')
) {
res.writeHead(404, {
'Location': 'https://www.lib.umich.edu/collections/deep-blue-repositories'
});
res.end();
return; // Exit after redirecting
}

if (environment.universal.preboot && req.method === 'GET' && shouldUseSSR(req.url)) {
// Only run SSR for matching paths
console.log('SSR: Using SSR= ' + req.url);
serverSideRender(req, res);
} else {
// If preboot is disabled, just serve the client
console.log('Universal off, serving for direct client-side rendering (CSR)');
// For all other paths, serve CSR
console.log('SSR:Universal off or path excluded. Serving direct client-side rendering (CSR)' + req.url);
clientSideRender(req, res);
}
}


/**
* Render page content on server side using Angular SSR. By default this page content is
* returned to the user.
Expand All @@ -255,6 +350,22 @@ function ngApp(req, res) {
* If false, then only save this rendered content to the in-memory cache (to refresh cache).
*/
function serverSideRender(req, res, sendToUser: boolean = true) {


// Check if 'X-Forwarded-For' is set; if not, set it to the request's IP address.
const xForwardedForHeader = req.headers['x-forwarded-for'];

console.log("xForwardedForHeader=" + xForwardedForHeader);

if (!xForwardedForHeader) {
// Consider appending instead if chaining proxies
console.log("req.ip=" + req.ip);

// Example of appending to support proxy chains:
req.headers['x-forwarded-for'] = req.ip;
}


// Render the page via SSR (server side rendering)
res.render(indexHtml, {
req,
Expand Down Expand Up @@ -535,7 +646,7 @@ function createHttpsServer(keys) {

function run() {
const port = environment.ui.port || 4000;
const host = environment.ui.host || '/';
const host = '0.0.0.0';

// Start up the Node server
const server = app();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<h2 id="header" class="pb-2">{{labelPrefix + 'head' | translate}}</h2>

<div *ngIf="!isEPersonFormShown">
<button class="mr-auto btn btn-success addEPerson-button"
<button class="mr-auto btn btn-info addEPerson-button"
(click)="isEPersonFormShown = true">
<i class="fas fa-plus"></i>
<span class="d-none d-sm-inline ml-1">{{labelPrefix + 'button.add' | translate}}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ <h4>{{messagePrefix + '.edit' | translate}}</h4>
</ds-form>

<ds-themed-loading [showMessage]="false" *ngIf="!formGroup"></ds-themed-loading>

<div *ngIf="epersonService.getActiveEPerson() | async">
<h5>{{messagePrefix + '.groupsEPersonIsMemberOf' | translate}}</h5>

Expand Down Expand Up @@ -71,7 +70,7 @@ <h5>{{messagePrefix + '.groupsEPersonIsMemberOf' | translate}}</h5>
{{ dsoNameService.getName(group) }}
</a>
</td>
<td class="align-middle">{{ dsoNameService.getName(undefined) }}</td>
<td class="align-middle">{{ dsoNameService.getName((group.object | async)?.payload) }}</td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="d-flex justify-content-between border-bottom mb-3">
<h2 id="header" class="pb-2">{{messagePrefix + 'head' | translate}}</h2>
<div>
<button class="mr-auto btn btn-success"
<button class="mr-auto btn btn-info"
[routerLink]="['newGroup']">
<i class="fas fa-plus"></i>
<span class="d-none d-sm-inline ml-1">{{messagePrefix + 'button.add' | translate}}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('AddBitstreamFormatComponent', () => {
bitstreamFormat.shortDescription = 'Unknown';
bitstreamFormat.description = 'Unknown data format';
bitstreamFormat.mimetype = 'application/octet-stream';
bitstreamFormat.supportLevel = BitstreamFormatSupportLevel.Unknown;
bitstreamFormat.supportLevel = BitstreamFormatSupportLevel.AS_IS_UNKNOWN;
bitstreamFormat.internal = false;
bitstreamFormat.extensions = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<h2 id="header" class="border-bottom pb-2 ">{{'admin.registries.bitstream-formats.head' | translate}}</h2>

<p id="description">{{'admin.registries.bitstream-formats.description' | translate}}</p>
<p id="create-new" class="mb-2"><a [routerLink]="'add'" class="btn btn-success">{{'admin.registries.bitstream-formats.create.new' | translate}}</a></p>
<p id="create-new" class="mb-2"><a [routerLink]="'add'" class="btn btn-info">{{'admin.registries.bitstream-formats.create.new' | translate}}</a></p>


<ds-pagination
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('BitstreamFormatsComponent', () => {
bitstreamFormat1.shortDescription = 'Unknown';
bitstreamFormat1.description = 'Unknown data format';
bitstreamFormat1.mimetype = 'application/octet-stream';
bitstreamFormat1.supportLevel = BitstreamFormatSupportLevel.Unknown;
bitstreamFormat1.supportLevel = BitstreamFormatSupportLevel.AS_IS_UNKNOWN;
bitstreamFormat1.internal = false;
bitstreamFormat1.extensions = null;

Expand All @@ -51,7 +51,7 @@ describe('BitstreamFormatsComponent', () => {
bitstreamFormat2.shortDescription = 'License';
bitstreamFormat2.description = 'Item-specific license agreed upon to submission';
bitstreamFormat2.mimetype = 'text/plain; charset=utf-8';
bitstreamFormat2.supportLevel = BitstreamFormatSupportLevel.Known;
bitstreamFormat2.supportLevel = BitstreamFormatSupportLevel.AS_IS_KNOWN;
bitstreamFormat2.internal = true;
bitstreamFormat2.extensions = null;

Expand All @@ -61,7 +61,7 @@ describe('BitstreamFormatsComponent', () => {
bitstreamFormat3.shortDescription = 'CC License';
bitstreamFormat3.description = 'Item-specific Creative Commons license agreed upon to submission';
bitstreamFormat3.mimetype = 'text/html; charset=utf-8';
bitstreamFormat3.supportLevel = BitstreamFormatSupportLevel.Supported;
bitstreamFormat3.supportLevel = BitstreamFormatSupportLevel.HIGHEST_LEVEL;
bitstreamFormat3.internal = true;
bitstreamFormat3.extensions = null;

Expand All @@ -71,7 +71,7 @@ describe('BitstreamFormatsComponent', () => {
bitstreamFormat4.shortDescription = 'Adobe PDF';
bitstreamFormat4.description = 'Adobe Portable Document Format';
bitstreamFormat4.mimetype = 'application/pdf';
bitstreamFormat4.supportLevel = BitstreamFormatSupportLevel.Unknown;
bitstreamFormat4.supportLevel = BitstreamFormatSupportLevel.AS_IS_UNKNOWN;
bitstreamFormat4.internal = false;
bitstreamFormat4.extensions = null;

Expand Down
Loading
Loading