dataquest-dev / dspace-angular

DSpace 7.x (and above) User Interface built on Angular.io
https://wiki.lyrasis.org/display/DSDOC7x/
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Check diff #410

Open vidiecan opened 10 months ago

vidiecan commented 10 months ago
diff --git a/Dockerfile b/Dockerfile
index 75c7f2483..c76c5cf1e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,17 +2,18 @@
 # See https://github.com/DSpace/dspace-angular/tree/main/docker for usage details

 FROM node:18-alpine
-WORKDIR /app
-ADD . /app/
-EXPOSE 4000

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

+WORKDIR /app
+ADD . /app/
+EXPOSE 4000
+
 # We run yarn install with an increased network timeout (5min) to avoid "ESOCKETTIMEDOUT" errors from hub.docker.com
 # See, for example https://github.com/yarnpkg/yarn/issues/5540
-RUN yarn install --network-timeout 300000
+RUN yarn install --network-timeout 2000000

 # On startup, run in DEVELOPMENT mode (this defaults to live reloading enabled, etc).
 # Listen / accept connections from all IP addresses.
diff --git a/build-scripts/run/start.sh b/build-scripts/run/start.sh
index 3bdfe5fb9..b548c6df1 100755
--- a/build-scripts/run/start.sh
+++ b/build-scripts/run/start.sh
@@ -1,25 +1,43 @@
 #!/bin/bash
-
 if [[ "x$ENVFILE" == "x" ]]; then
     export ENVFILE=$(pwd)/envs/.default
+    echo "Using default envfile"
 fi

+PROJECT=${1:-unnamed_dspace}
+
+echo "Using envfile: [$ENVFILE] for project: [$PROJECT]"
+
 source $ENVFILE

 # docker-compose does not pull those that have `build` section?!
+echo "====="
 docker pull $DSPACE_UI_IMAGE

 pushd ../..
+echo "====="
 docker compose --env-file $ENVFILE -f docker/docker-compose.yml -f docker/docker-compose-rest.yml pull
-docker compose --env-file $ENVFILE -p ${1:-unnamed_dspace} -f docker/docker-compose.yml -f docker/docker-compose-rest.yml up -d --no-build
+docker compose --env-file $ENVFILE -p $PROJECT -f docker/docker-compose.yml -f docker/docker-compose-rest.yml up -d --no-build --remove-orphans
 popd

 # Create admin user
 # set DOCKER_OWNER to match our image (see cli.yml)
 pushd ../..
-docker compose --env-file $ENVFILE -p ${1:-unnamed_dspace} -f docker/matomo-w-db.yml pull
-docker compose --env-file $ENVFILE -p ${1:-unnamed_dspace} -f docker/matomo-w-db.yml up -d --no-build
-docker compose --env-file $ENVFILE -p ${1:-unnamed_dspace} -f docker/cli.yml run --rm dspace-cli create-administrator -e test@test.edu -f admin -l user -p admin -c en -o dataquest
-docker compose --env-file $ENVFILE -p ${1:-unnamed_dspace} -f docker/cli.yml run --rm dspace-cli user --add -m user@test.edu -g meno -s priezvisko -l en -p user -o dataquest
-docker compose --env-file $ENVFILE -p ${1:-unnamed_dspace} -f docker/cli.yml run --rm dspace-cli version
+echo "====="
+#docker compose --env-file $ENVFILE -p $PROJECT -f docker/matomo-w-db.yml pull
+#docker compose --env-file $ENVFILE -p $PROJECT -f docker/matomo-w-db.yml up -d --no-build
+docker compose --env-file $ENVFILE -p $PROJECT -f docker/cli.yml run --rm dspace-cli create-administrator -e test@test.edu -f admin -l user -p admin -c en -o dataquest
+docker compose --env-file $ENVFILE -p $PROJECT -f docker/cli.yml run --rm dspace-cli user --add -m user@test.edu -g meno -s priezvisko -l en -p user -o dataquest
+docker compose --env-file $ENVFILE -p $PROJECT -f docker/cli.yml run --rm dspace-cli version
+
+echo "====="
+echo "Logs"
+docker compose --env-file $ENVFILE -p $PROJECT -f docker/docker-compose.yml -f docker/docker-compose-rest.yml logs -n 50 || true
 popd
+
+echo "====="
+echo "Copy assetstore"
+docker cp assetstore dspace${INSTANCE}:/dspace/
+
+echo "====="
+echo "Finished start.sh"
\ No newline at end of file
diff --git a/config/config.yml b/config/config.yml
index e98920fda..649e498d7 100644
--- a/config/config.yml
+++ b/config/config.yml
@@ -1,81 +1,67 @@
+debug: false
+
 rest:
   ssl: false
   host: localhost
   port: 8080
   nameSpace: /server

-
-info:
-  # Whether the end user agreement is required before users may use the repository.
-  # If enabled, the user will be required to accept the agreement before they can use the repository.
-  # If disabled, the page will not exist and no agreement is required to use the repository
-  enableEndUserAgreement: false
-  # Whether the privacy statement should exist or not.
-  enablePrivacyStatement: false
-
-# Keep only English language
-languages:
-  - code: en
-    label: English
-    active: true
-  - code: ca
-    label: Català
-    active: false
-  - code: cs
-    label: Čeština
-    active: true
-  - code: de
-    label: Deutsch
-    active: false
-  - code: es
-    label: Español
-    active: false
-  - code: fr
-    label: Français
-    active: false
-  - code: gd
-    label: Gàidhlig
-    active: false
-  - code: lv
-    label: Latviešu
-    active: false
-  - code: hu
-    label: Magyar
-    active: false
-  - code: nl
-    label: Nederlands
-    active: false
-  - code: pl
-    label: Polski
-    active: false
-  - code: pt-PT
-    label: Português
-    active: false
-  - code: pt-BR
-    label: Português do Brasil
-    active: false
-  - code: fi
-    label: Suomi
-    active: false
-  - code: sv
-    label: Svenska
-    active: false
-  - code: tr
-    label: Türkçe
-    active: false
-  - code: kk
-    label: Қазақ
-    active: false
-  - code: bn
-    label: বাংলা
-    active: false
-  - code: hi
-    label: हिंदी
-    active: false
-  - code: el
-    label: Ελληνικά
-    active: false
-  - code: uk
-    label: Yкраї́нська
-    active: false
-
+# Caching settings
+cache:
+  # NOTE: how long should objects be cached for by default
+  msToLive:
+    default: 900000 # 15 minutes
+  # Default 'Cache-Control' HTTP Header to set for all static content (including compiled *.js files)
+  # Defaults to max-age=604,800 seconds (one week). This lets a user's browser know that it can cache these
+  # files for one week, after which they will be "stale" and need to be redownloaded.
+  # NOTE: When updates are made to compiled *.js files, it will automatically bypass this browser cache, because
+  # all compiled *.js files include a unique hash in their name which updates when content is modified.
+  control: max-age=604800 # revalidate browser
+  autoSync:
+    defaultTime: 0
+    maxBufferSize: 100
+    timePerMethod:
+      PATCH: 3 # time in seconds
+  # In-memory cache(s) of server-side rendered pages. These caches will store the most recently accessed public pages.
+  # Pages are automatically added/dropped from these caches based on how recently they have been used.
+  # Restarting the app clears all page caches.
+  # NOTE: To control the cache size, use the "max" setting. Keep in mind, individual cached pages are usually small (<100KB).
+  # Enabling *both* caches will mean that a page may be cached twice, once in each cache (but may expire at different times via timeToLive).
+  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 bots.
+      # 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 needs.
+      # Individual cached pages are usually small (<100KB), so max=1000 should only require ~100MB of memory.
+      max: 2000
+      # 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.
+      # NOTE: For the bot cache, this setting may impact how quickly search 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).
+      # 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:
+      # 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.
+      max: 200
+      # 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.
+      # 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
diff --git a/docker/docker-compose-rest.yml b/docker/docker-compose-rest.yml
index d0b429336..e76fef152 100644
--- a/docker/docker-compose-rest.yml
+++ b/docker/docker-compose-rest.yml
@@ -6,6 +6,10 @@
 # http://www.dspace.org/license/
 #

+# Docker Compose for running the DSpace backend for testing/development
+# This is based heavily on the docker-compose.yml that is available in the DSpace/DSpace
+# (Backend) at:
+# https://github.com/DSpace/DSpace/blob/main/docker-compose.yml
 version: '3.7'
 networks:
   dspacenet:
@@ -15,7 +19,6 @@ services:
     restart: unless-stopped
     container_name: dspace${INSTANCE}
     environment:
-      JAVA_OPTS: -Xmx4g
       TZ: ${TIMEZONE:-Europe/Bratislava}
       # Below syntax may look odd, but it is how to override dspace.cfg settings via env variables.
       # See https://github.com/DSpace/DSpace/blob/main/dspace/config/config-definition.xml
@@ -39,6 +42,8 @@ services:
       assetstore__P__s3__P__awsAccessKey: ${S3_ACCESS:-}
       assetstore__P__s3__P__awsSecretKey: ${S3_SECRET:-}
       assetstore__P__s3__P__awsRegionName: ${S3_REGION_NAME:-}
+      assetstore__P__s3__P__pathStyleAccessEnabled: ${S3_PATH_STYLE_ACCESS:-false}
+      assetstore__P__s3__P__endpoint: ${S3_ENDPOINT:-}
     image: ${DSPACE_REST_IMAGE:-dataquest/dspace:dtq-dev-7.5}
     depends_on:
     - dspacedb
diff --git a/package.json b/package.json
index 5e636b77d..7abfb20d4 100644
--- a/package.json
+++ b/package.json
@@ -185,7 +185,7 @@
     "karma-jasmine": "~4.0.0",
     "karma-jasmine-html-reporter": "^1.5.0",
     "karma-mocha-reporter": "2.2.5",
-    "ngx-mask": "^13.1.7",
+    "ngx-mask": "~13.1.7",
     "nodemon": "^2.0.20",
     "postcss": "^8.1",
     "postcss-apply": "0.12.0",
diff --git a/scripts/language-translation-helper.py b/scripts/language-translation-helper.py
index b728090f4..f06854187 100644
--- a/scripts/language-translation-helper.py
+++ b/scripts/language-translation-helper.py
@@ -1,5 +1,4 @@
-## This script helps me to find out which messages should be translated. `en.json5` to `cs.json5`
-## I know this script is really ugly - it's only for internal purposes, but it could help you.
+## This script could help to find out which messages should be translated. `en.json5` to `cs.json5`.
 import csv
 import json5
MajoBerger commented 10 months ago

My remarks, @vidiecan

There are also plenty differences in actions, but that might not be relevant.