...
The "rateLimiter" sub-section can be used to protect against a DOS (denial of service) attack when the UI is processed on the server side (i.e. server-side rendering). Default settings are usually OK. In Angular, server-side rendering occurs to support better Search Engine Optimization (SEO), as well as to support clients which cannot use Javascript. See also Angular's docs on Server-side rendering.
REST API Settings
The "rest" (REST API) section defines which REST API the UI will use. The REST settings MUST correspond to the primary URL of the backend. Usually, this means they must be kept in sync
with the value of dspace.server.url
in the backend's local.cfg
Sub-path in frontend URL: When using a subpath (nameSpace) in your UI server base URL (e.g. "http://localhost:4000/mysite/" instead of "http://localhost:4000/"), you must make sure that the URL without the subpath is added to the rest.cors.allowed-origins
list in [dspace]/config/modules/rest.cfg
or the local.cfg
override. The default value used for this configuration assumes that Origin and DSpace URL are identical, but CORS origins do not contain a subpath. Without this change you will see CORS policy errors preventing communication between the frontend and backend servers.
REST API Settings
The "rest" (REST API) section defines which REST API the UI will use. The REST settings MUST correspond to the primary URL of the backend. Usually, this means they must be kept in sync
with the value of dspace.server.url
in the backend's local.cfg
This example is valid if your Backend is publicly available at https://api.mydspace.edu/server/ . Keep in mind that the "port" must always This example is valid if your Backend is publicly available at https://api.mydspace.edu/server/ . Keep in mind that the "port" must always be specified even if it's a standard port (i.e. port 80 for HTTP and port 443 for HTTPS).
...
Code Block |
---|
language | yml |
---|
title | config.*.yml |
---|
|
cache:
...
serverSide:
# Set to true to see all cache hits/misses/refreshes in your console logs. Useful for debugging SSR caching issues.
debug: false
# When enabled (i.e. max > 0), known bots will be sent pages from a server side cache specific for bots.
# (Keep in mind, bot detection cannot be guarranteed. It is possible some bots will bypass this cache.)
botCache:
# Maximum number of pages to cache for known bots. Set to zero (0) to disable server side caching for botscache:
...
serverSide:
# Set to true to see all cache hits/misses/refreshes in your console logs. Useful for debugging SSR caching issues.
# Default is 1000, which means the 1000 most recently accessed public pages will be cached.
# As all pages are cached in server memory, increasing this value will increase memory needsdebug: false
# When enabled (i.e. max > 0), known bots will be sent pages from a server side cache specific for bots.
# (Keep #in Individualmind, cachedbot pagesdetection arecannot usuallybe small (<100KB), so max=1000 should only require ~100MB of memory.guarranteed. It is possible some bots will bypass this cache.)
maxbotCache: 1000
# Maximum Amountnumber of pages timeto aftercache whichfor cachedknown pagesbots. areSet consideredto stalezero (in ms). After becoming stale, the cached0) to disable server side caching for bots.
# copyDefault is automatically1000, refreshedwhich onmeans the next1000 request.
most recently accessed public pages will be #cached.
NOTE: For the bot cache, this# settingAs mayall impactpages howare quicklycached searchin engineserver botsmemory, willincreasing indexthis newvalue contentwill onincrease yourmemory siteneeds.
# ForIndividual example,cached settingpages thisare tousually one week may mean that search engine bots may not find all new content for one weeksmall (<100KB), so max=1000 should only require ~100MB of memory.
timeToLivemax: 86400000 # 1 day1000
# WhenAmount set to true,of time after timeToLivewhich expires,cached thepages nextare requestconsidered willstale receive the *cached* page & then re-render the page(in ms). After becoming stale, the cached
# behindcopy theis scenesautomatically torefreshed updateon the next cacherequest.
This ensures users primarily# interactNOTE: withFor the bot cache, this butsetting may receiveimpact stalehow pagesquickly (oldersearch than timeToLive).
# When set to false, after timeToLive expires, the next request will wait on SSR to complete & receive a fresh page (which is then saved to cache).
# This ensures stale pages (older than timeToLive) are never returned from the cache, but some users will wait on SSR.
allowStale: true
# When enabled (i.e. max > 0), all anonymous users will be sent pages from a server side cache.
# This allows anonymous users to interact more quickly with the site, but also means they may see slightly
# outdated content (based on timeToLive)
anonymousCache:engine bots will index new content on your site.
# For example, setting this to one week may mean that search engine bots may not find all new content for one week.
timeToLive: 86400000 # 1 day
# When set to true, after timeToLive expires, the next request will receive the *cached* page & then re-render the page
# behind the scenes to update the cache. This ensures users primarily interact with the cache, but may receive stale pages (older than timeToLive).
# Maximum number of pagesWhen set to cache.false, Defaultafter istimeToLive zero (0) which means anonymous user cache is disabled.
# As all pages are cached in server memory, increasing this value will increase memory needsexpires, the next request will wait on SSR to complete & receive a fresh page (which is then saved to cache).
# This Individualensures cachedstale pages (older arethan usuallytimeToLive) small (<100KB), so a value of max=1000 would only require ~100MB of memory. are never returned from the cache, but some users will wait on SSR.
maxallowStale: 0true
# AmountWhen of time after which cached pages are considered stale (in ms). After becoming stale, the cached
# copy is automatically refreshed on the next request.
# NOTE: For the anonymous cache, it is recommended to keep this value low to avoid anonymous users seeing outdated content.enabled (i.e. max > 0), all anonymous users will be sent pages from a server side cache.
# This allows anonymous users to interact more quickly with the site, but also means they may see slightly
# outdated content (based on timeToLive)
anonymousCache:
timeToLive:# 10000Maximum #number 10of seconds
pages to cache. Default is zero #(0) Whenwhich setmeans toanonymous true,user aftercache timeToLive expires, the next request will receive the *cached* page & then re-render the page
# behind the scenes to update the cache. This ensures users primarily interact with the cache, but may receive stale pages (older than timeToLive).
# When set to false, after timeToLive expires, the next request will wait on SSR to complete & receive a fresh page (which is then saved to 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.
max: 0
# Amount of time after which cached pages are considered stale (in ms). After becoming stale, the cached
# Thiscopy ensuresis staleautomatically pagesrefreshed (olderon thanthe timeToLive) are never returned from the cache, but some users will wait on SSR.
allowStale: true |
Authentication Settings
The "auth" section provides some basic authentication-related settings. Currently, it's primarily settings related to when a session timeout warning will be showed to your users, etc.
Code Block |
---|
language | yml |
---|
title | Format for 7.2 or later (config.*.yml) |
---|
|
auth:
# Authentication UI settings
ui:
# the amount of time before the idle warning is shown
timeUntilIdle: 900000 # 15 minutes
# the amount of time the user has to react after the idle warning is shown before they are logged out.
idleGracePeriod: 300000 # 5 minutes
# Authentication REST settings
rest:
# 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 |
next request.
# NOTE: For the anonymous cache, it is recommended to keep this value low to avoid anonymous users seeing outdated content.
timeToLive: 10000 # 10 seconds
# When set to true, after timeToLive expires, the next request will receive the *cached* page & then re-render the page
# behind the scenes to update the cache. This ensures users primarily interact with the cache, but may receive stale pages (older than timeToLive).
# When set to false, after timeToLive expires, the next request will wait on SSR to complete & receive a fresh page (which is then saved to cache).
# This ensures stale pages (older than timeToLive) are never returned from the cache, but some users will wait on SSR.
allowStale: true |
Authentication Settings
The "auth" section provides some basic authentication-related settings. Currently, it's primarily settings related to when a session timeout warning will be showed to your users, etc.
Code Block |
---|
language | yml |
---|
title | Format for 7.2 or later (config.*.yml) |
---|
|
auth:
# Authentication UI settings
ui:
# |
Code Block |
---|
title | Format for 7.1 or 7.0 (environment.*.ts) |
---|
|
auth: {
// Authentication UI settings
ui: {
// the amount of time before the idle warning is shown
timeUntilIdle: 15 * 60 * 1000, // 15 minutes
// the amount of time the user has to react afterbefore the idle warning is shown before they are logged out.
idleGracePeriodtimeUntilIdle: 5900000 *# 60 * 1000, // 5 15 minutes
},
// Authentication REST settings
rest: {
// If the rest token expires in less than this # the amount of time, itthe willuser behas refreshedto automatically.
react after the idle // Thiswarning is independent from the idle warning. shown before they are logged out.
timeLeftBeforeTokenRefreshidleGracePeriod: 300000 2# *5 60minutes
* 1000,# //Authentication 2REST minutessettings
},
}, |
Form Settings
The "form" section provides basic settings for any forms displayed in the UI. At this time, these settings only include a validatorMap, which is not necessary to modify for most sites
Code Block |
---|
language | yml |
---|
title | Format for 7.2 or later (config.*.yml) |
---|
|
form:
# (7.5 and above) Whether to enable "spellcheck" attribute of textareas in forms.
spellCheck: true
# NOTE: Map server-side validators to comparative Angular form validators
validatorMap:
required: required
regex: pattern |
Code Block |
---|
title | Format for 7.1 or 7.0 (environment.*.ts) |
---|
|
form: {
// NOTE: Map server-side validators to comparative Angular form validators
validatorMap: {
required: 'required',
regex: 'pattern'
}
}, |
Notification Settings
The "notifications" section provides options related to where user notifications will appear in your UI. By default, they appear in the top right corner, and timeout after 5 seconds.
rest:
# If the rest token expires in less than this amount of time, it will be refreshed automatically.
# This is independent from the idle warning. Defaults to automatic refresh when the token will
# expire within 2 minutes. Because token expires after 30 minutes by default, this means automatic
# refresh would occur every ~28 minutes.
timeLeftBeforeTokenRefresh: 120000 # 2 minutes |
Code Block |
---|
Code Block |
---|
language | yml |
---|
title | Format for 7.2 1 or later 7.0 (configenvironment.*.ymlts) |
---|
|
notificationsauth: {
rtl: false
position:// Authentication UI settings
- topui: {
-// right
the maxStack: 8
# NOTE: after how many seconds notification is closed automatically. If set to zero notifications are not closed automatically
timeOut: 5000 # 5 second
clickToClose: true
# NOTE: 'fade' | 'fromTop' | 'fromRight' | 'fromBottom' | 'fromLeft' | 'rotate' | 'scale'
animate: scale |
Code Block |
---|
title | Format for 7.1 or 7.0 (environment.*.ts) |
---|
|
notifications: {
rtl: false,
position: ['top', 'right'],
maxStack: 8,
// NOTE: after how many seconds notification is closed automatically. If set to zero notifications are not closed automatically
timeOut: 5000, // 5 second
clickToClose: true,
// NOTE: 'fade' | 'fromTop' | 'fromRight' | 'fromBottom' | 'fromLeft' | 'rotate' | 'scale'
animate: NotificationAnimationsType.Scale
}, |
The set of valid animations can be found in the NotificationAnimationsType, and are implemented in ./src/shared/animations/
Submission Settings
amount of time before the idle warning is shown
timeUntilIdle: 15 * 60 * 1000, // 15 minutes
// the amount of time the user has to react after the idle warning is shown before they are logged out.
idleGracePeriod: 5 * 60 * 1000, // 5 minutes
},
// Authentication REST settings
rest: {
// 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: 2 * 60 * 1000, // 2 minutes
},
}, |
Form Settings
The "form" section provides basic settings for any forms displayed in the UI. At this time, these settings only include a validatorMap, which is not necessary to modify for most sitesThe "submission" section provides some basic Submission/Deposit UI options. These allow you to optionally enable an autosave (disabled by default), and custom styles/icons for metadata fields or authority confidence values.
Code Block |
---|
language | yml |
---|
title | Format for 7.2 or later (config.*.yml) |
---|
|
submissionform:
autosave:
# NOTE: which metadata trigger an autosave
metadata: []
# (7.5 and above) Whether to enable "spellcheck" attribute of textareas in forms.
spellCheck: true
# NOTE: afterMap howserver-side manyvalidators timeto (milliseconds)comparative submissionAngular isform saved automaticallyvalidators
validatorMap:
# eg. timerrequired: 300000 # 5 minutesrequired
timerregex: pattern |
Code Block |
---|
title | Format for 7.1 or 7.0 (environment.*.ts) |
---|
|
form: {
// icons:
metadata:NOTE: Map server-side validators to comparative Angular form validators
validatorMap: {
# NOTErequired: example'required',
of configuration
regex: 'pattern'
}
}, |
Notification Settings
The "notifications" section provides options related to where user notifications will appear in your UI. By default, they appear in the top right corner, and timeout after 5 seconds.
Code Block |
---|
language | yml |
---|
title | Format for 7.2 or later (config.*.yml) |
---|
|
notifications:
rtl: false
position:
- top
- right
maxStack: 8
# # NOTE: metadata name
# - name: dc.author
# # NOTE: after how many seconds notification is closed automatically. If set to zero notifications are not closed automatically
timeOut: 5000 # 5 second
clickToClose: true
# NOTE: 'fade' | 'fromTop' | 'fromRight' | 'fromBottom' | 'fromLeft' | 'rotate' | 'scale'
animate: scale |
Code Block |
---|
title | Format for 7.1 or 7.0 (environment.*.ts) |
---|
|
notifications: {
rtl: false,
position: ['top', 'right'],
maxStack: 8,
// NOTE: after how many seconds notification is closed automatically. If set to zero notifications are not closed automatically
timeOut: 5000, // 5 second
clickToClose: true,
// NOTE: 'fade' | 'fromTop' | 'fromRight' | 'fromBottom' | 'fromLeft' | 'rotate' | 'scale'
animate: NotificationAnimationsType.Scale
}, |
The set of valid animations can be found in the NotificationAnimationsType, and are implemented in ./src/shared/animations/
Submission Settings
The "submission" section provides some basic Submission/Deposit UI options. These allow you to optionally enable an autosave (disabled by default), and custom styles/icons for metadata fields or authority confidence values.
Code Block |
---|
language | yml |
---|
title | Format for 7.2 or later (config.*.yml) |
---|
|
submission:
autosave:
# NOTE: which metadata trigger an autosave
metadata: []
fontawesome (v6.x) icon classes and bootstrap utility classes can be used
# style: fas fa-user
- name: dc.author
style: fas fa-user
# default configuration
- name: default
style: ''
authority:
confidence:
# NOTE: example of configuration
# # NOTE: confidence value
# - value: 600
# # NOTE: fontawesome (v6.x) icon classes and bootstrap utility classes can be used
# style: text-success
# icon: fa-circle-check
# # NOTE: theafter classhow configuredmany intime property(milliseconds) stylesubmission is used by default, the icon property could be used in componentsaved automatically
# eg. timer: 300000 # 5 minutes
timer: 0
icons:
configured to use a 'icon mode' display (mainly in edit-item page) metadata:
# NOTE: -example value:of 600configuration
# # styleNOTE: metadata text-successname
# - iconname: fa-circle-checkdc.author
# - # valueNOTE: 500
style: text-infofontawesome (v5.x) icon classes and bootstrap utility classes can be used
# style: icon:fas fa-gearuser
- valuename: 400dc.author
style: fas textfa-warninguser
# icon: fa-circle-question
default configuration
- valuename: 300default
style: text-muted''
authority:
iconconfidence: fa-thumbs-down
# NOTE: example of -configuration
value: 200
# # styleNOTE: confidence text-mutedvalue
# - iconname: fa-circle-exclamation
dc.author
# -# valueNOTE: 100
style: text-muted
fontawesome (v5.x) icon classes and bootstrap utility classes can be used
# iconstyle: fa-circle-stopuser
- value: 0600
style: text-mutedsuccess
- iconvalue: fa-ban500
- valuestyle: text-1info
- stylevalue: text-muted400
iconstyle: fatext-circle-xmarkwarning
# default configuration
- value: default
style: text-muted
icon: fa-circle-xmark |
Code Block |
---|
title | Format for 7.1 or 7.0 (environment.*.ts) |
---|
|
submission: {
autosave: {
// NOTE: which metadata trigger an autosave
metadata: [],
/**
* NOTE: after how many time (milliseconds) submission is saved automatically
* eg. timer: 5 * (1000 * 60); // 5 minutes
*/
timer: 0
},
icons: {
metadata: [
/**
* NOTE: example of configuration
* {
* // NOTE: metadata name
* name: 'dc.author',
* // NOTE: fontawesome (v5.x) icon classes and bootstrap utility classes can be used
* style: 'fa-user'
* }
*/
{
name: 'dc.author',
style: 'fas fa-user'
},
// default configuration
{
name: 'default',
style: ''
}
],
authority: {
confidence: [
/**
* NOTE: example of configuration
* {
* // NOTE: confidence value
* value: 'dc.author',
* // NOTE: fontawesome (v4.x) icon classes and bootstrap utility classes can be used
* style: 'fa-user'
* }
*/
{
value: 600,
style: 'text-success'
},
{
value: 500,
style: 'text-info'
},
{
value: 400,
style: 'text-warning'
},
// default configuration
{
value: 'default',
style: 'text-muted'
},
]
}
}
}, |
...