diff --git a/.github/actions/import-db/action.yml b/.github/actions/import-db/action.yml index ead62157438..9120d1b1e30 100644 --- a/.github/actions/import-db/action.yml +++ b/.github/actions/import-db/action.yml @@ -10,6 +10,10 @@ inputs: description: 'port suffix' required: true type: string + ASSETSTORE: + description: 'location of assetstore folder' + required: false + type: string runs: using: "composite" @@ -49,17 +53,39 @@ runs: echo "=====" docker logs $DB5NAME || true echo "=====" + # copy assetstore + echo Preparing assetstore + if [[ -z ${{ inputs.ASSETSTORE }} ]]; then + echo Location of assetstore folder is empty. Not copping assetstore + else + docker cp ${{ inputs.ASSETSTORE }} dspace${{ inputs.INSTANCE }}:/dspace/ + fi + echo "=====" cd ../ pip install -r requirements.txt || true echo "=====" cd ./src # cleanup resume rm __temp/resume/*.json || true - python3 repo_import.py --resume=false --config=backend.endpoint=$BEURL --config=db_dspace_7.port=$DB7PORT --config=db_dspace_5.port=$DB5PORT --config=db_utilities_5.port=$DB5PORT --config=input.datadir=$DATADIR/data/ --config=input.icondir=$DATADIR/icon/ - + # arguments of the script + # required + args=( + --resume=false + --config=backend.endpoint=$BEURL + --config=db_dspace_7.port=$DB7PORT + --config=db_dspace_5.port=$DB5PORT + --config=db_utilities_5.port=$DB5PORT + --config=input.datadir=$DATADIR/data/ + --config=input.icondir=$DATADIR/icon/ + ) + # Add --resume argument if inputs.ASSETSTORE is defined + if [ -n "${{ inputs.ASSETSTORE }}" ]; then + args+=(--assetstore=${{ inputs.ASSETSTORE }}) + fi + python3 repo_import.py "${args[@]}" - name: cleanup shell: bash run: | docker stop ${{ steps.import.outputs.cid }} || true if: ${{ always() }} - + diff --git a/.github/actions/project-management-action/Dockerfile b/.github/actions/project-management-action/Dockerfile deleted file mode 100644 index 1d3301259e4..00000000000 --- a/.github/actions/project-management-action/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -# Container image that runs your code -FROM alpine:3.10 - -RUN apk add --no-cache --no-progress curl jq - -# Copies your code file from your action repository to the filesystem path `/` of the container -COPY entrypoint.sh /entrypoint.sh -RUN chmod 777 /entrypoint.sh -# Code file to execute when the docker container starts up (`entrypoint.sh`) -ENTRYPOINT ["/entrypoint.sh"] diff --git a/.github/actions/project-management-action/LICENSE b/.github/actions/project-management-action/LICENSE deleted file mode 100644 index c4f50f8a29e..00000000000 --- a/.github/actions/project-management-action/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 Sergio Pintaldi - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/.github/actions/project-management-action/README.md b/.github/actions/project-management-action/README.md deleted file mode 100644 index 1b2fa18c17e..00000000000 --- a/.github/actions/project-management-action/README.md +++ /dev/null @@ -1,132 +0,0 @@ -# GitHub Action for Assign to One Project - -[![Docker Cloud Automated build](https://img.shields.io/docker/cloud/automated/srggrs/assign-one-project-github-action)][docker] -[![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/srggrs/assign-one-project-github-action)][docker] -[![Docker Pulls](https://img.shields.io/docker/pulls/srggrs/assign-one-project-github-action)][docker] -[![GitHub license](https://img.shields.io/github/license/srggrs/assign-one-project-github-action.svg)][license] -![Latest Version](https://img.shields.io/github/v/release/srggrs/assign-one-project-github-action?color=orange&label=latest%20release) - -[docker]: https://hub.docker.com/r/srggrs/assign-one-project-github-action -[license]: https://github.com/srggrs/assign-one-project-github-action/blob/master/LICENSE - -Automatically add an issue or pull request to specific [GitHub Project](https://help.github.com/articles/about-project-boards/) when you __create__ and/or __label__ them. By default, the issues are assigned to the __`To do`__ column and the pull requests to the __`In progress`__ one, so make sure you have those columns in your project dashboard. But the workflow __allowed you to specify the column name as input__, so you can assign the issues/PRs based on a set of conditions to a specific column of a specific project. - -## Latest features: - -* included `issue_comment` as trigger for this action. -* added project pagination for searching 100+ GitHub projects. - -## Acknowledgment & Motivations - -This action has been modified from the original action from [masutaka](https://github.com/masutaka/github-actions-all-in-one-project). I needed to fix it as the original docker container would not build. Also I think the GitHub Action syntax changed a bit. - -I would like to thank @SunRunAway for adding the labelling functionality and custom column input. - -## Inputs - -### `project` - -**Required** The url of the project to be assigned to. - -### `column_name` - -The column name of the project, defaults to `'To do'` for issues and `'In progress'` for pull requests. - -## Example usage - -Examples of action: - -### Repository project - -```yaml -name: Auto Assign to Project(s) - -on: - issues: - types: [opened, labeled] - pull_request: - types: [opened, labeled] - issue_comment: - types: [created] -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - -jobs: - assign_one_project: - runs-on: ubuntu-latest - name: Assign to One Project - steps: - - name: Assign NEW issues and NEW pull requests to project 2 - uses: srggrs/assign-one-project-github-action@1.2.1 - if: github.event.action == 'opened' - with: - project: 'https://github.com/srggrs/assign-one-project-github-action/projects/2' - - - name: Assign issues and pull requests with `bug` label to project 3 - uses: srggrs/assign-one-project-github-action@1.2.1 - if: | - contains(github.event.issue.labels.*.name, 'bug') || - contains(github.event.pull_request.labels.*.name, 'bug') - with: - project: 'https://github.com/srggrs/assign-one-project-github-action/projects/3' - column_name: 'Labeled' -``` - -#### __Notes__ -Be careful of using the conditions above (opened and labeled issues/PRs) because in such workflow, if the issue/PR is opened and labeled at the same time, it will be assigned to __both__ projects! - - -You can use any combination of conditions. For example, to assign new issues or issues labeled with 'mylabel' to a project column, use: -```yaml -... - -if: | - github.event_name == 'issues' && - ( - github.event.action == 'opened' || - contains(github.event.issue.labels.*.name, 'mylabel') - ) -... -``` - -### Organisation or User project - -Generate a token from the Organisation settings or User Settings and add it as a secret in the repository secrets as `MY_GITHUB_TOKEN` - -```yaml -name: Auto Assign to Project(s) - -on: - issues: - types: [opened, labeled] - pull_request_target: - types: [opened, labeled] - issue_comment: - types: [created] -env: - MY_GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }} - -jobs: - assign_one_project: - runs-on: ubuntu-latest - name: Assign to One Project - steps: - - name: Assign NEW issues and NEW pull requests to project 2 - uses: srggrs/assign-one-project-github-action@1.2.1 - if: github.event.action == 'opened' - with: - project: 'https://github.com/srggrs/assign-one-project-github-action/projects/2' - - - name: Assign issues and pull requests with `bug` label to project 3 - uses: srggrs/assign-one-project-github-action@1.2.1 - if: | - contains(github.event.issue.labels.*.name, 'bug') || - contains(github.event.pull_request.labels.*.name, 'bug') - with: - project: 'https://github.com/srggrs/assign-one-project-github-action/projects/3' - column_name: 'Labeled' -``` - -## [Change Log](./CHANGELOG.md) - -Please refer to the list of changes [here](./CHANGELOG.md) diff --git a/.github/actions/project-management-action/action.yml b/.github/actions/project-management-action/action.yml deleted file mode 100644 index 40f7a120883..00000000000 --- a/.github/actions/project-management-action/action.yml +++ /dev/null @@ -1,22 +0,0 @@ -# action.yml -name: 'Assign to One Project' -description: 'Assign new/labeled Issue or Pull Request to a specific project dashboard column' -author: srggrs -inputs: - project: - description: 'The url of the project to be assigned to.' - required: true - column_name: - description: 'The column name of the project, defaults to "To do" for issues and "In progress" for pull requests.' - required: false - -runs: - using: 'docker' - image: 'Dockerfile' - args: - - ${{ inputs.project }} - - ${{ inputs.column_name }} - -branding: - icon: 'box' - color: 'red' diff --git a/.github/actions/project-management-action/entrypoint.sh b/.github/actions/project-management-action/entrypoint.sh deleted file mode 100644 index 05b81c7d2d0..00000000000 --- a/.github/actions/project-management-action/entrypoint.sh +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/sh -l - -PROJECT_URL="$INPUT_PROJECT" -if [ -z "$PROJECT_URL" ]; then - echo "Project input variable is not defined." >&2 - exit 1 -fi - -get_project_type() { - _PROJECT_URL="$1" - - case "$_PROJECT_URL" in - https://github.com/orgs/*) - echo "org" - ;; - https://github.com/users/*) - echo "user" - ;; - https://github.com/*/projects/*) - echo "repo" - ;; - *) - echo "Invalid Project URL: '$_PROJECT_URL' . Please pass a valid Project URL in the project input variable" >&2 - exit 1 - ;; - esac - - unset _PROJECT_URL -} - -get_next_url_from_headers() { - _HEADERS_FILE=$1 - grep -i '^link' "$_HEADERS_FILE" | tr ',' '\n'| grep \"next\" | sed 's/.*<\(.*\)>.*/\1/' -} - -find_project_id() { - _PROJECT_TYPE="$1" - _PROJECT_URL="$2" - - case "$_PROJECT_TYPE" in - org) - _ORG_NAME=$(echo "$_PROJECT_URL" | sed -e 's@https://github.com/orgs/\([^/]\+\)/projects/[0-9]\+@\1@') - _ENDPOINT="https://api.github.com/orgs/$_ORG_NAME/projects?per_page=100" - ;; - user) - _USER_NAME=$(echo "$_PROJECT_URL" | sed -e 's@https://github.com/users/\([^/]\+\)/projects/[0-9]\+@\1@') - _ENDPOINT="https://api.github.com/users/$_USER_NAME/projects?per_page=100" - ;; - repo) - _ENDPOINT="https://api.github.com/repos/$GITHUB_REPOSITORY/projects?per_page=100" - ;; - esac - - _NEXT_URL="$_ENDPOINT" - - while : ; do - - _PROJECTS=$(curl -s -X GET -u "$GITHUB_ACTOR:$TOKEN" --retry 3 \ - -H 'Accept: application/vnd.github.inertia-preview+json' \ - -D /tmp/headers \ - "$_NEXT_URL") - - _PROJECTID=$(echo "$_PROJECTS" | jq -r ".[] | select(.html_url == \"$_PROJECT_URL\").id") - _NEXT_URL=$(get_next_url_from_headers '/tmp/headers') - - if [ "$_PROJECTID" != "" ]; then - echo "$_PROJECTID" - elif [ "$_NEXT_URL" == "" ]; then - echo "No project was found." >&2 - exit 1 - fi - done - - unset _PROJECT_TYPE _PROJECT_URL _ORG_NAME _USER_NAME _ENDPOINT _PROJECTS _PROJECTID _NEXT_URL -} - -find_column_id() { - _PROJECT_ID="$1" - _INITIAL_COLUMN_NAME="$2" - - _COLUMNS=$(curl -s -X GET -u "$GITHUB_ACTOR:$TOKEN" --retry 3 \ - -H 'Accept: application/vnd.github.inertia-preview+json' \ - "https://api.github.com/projects/$_PROJECT_ID/columns") - - - echo "$_COLUMNS" | jq -r ".[] | select(.name == \"$_INITIAL_COLUMN_NAME\").id" - unset _PROJECT_ID _INITIAL_COLUMN_NAME _COLUMNS -} - -PROJECT_TYPE=$(get_project_type "${PROJECT_URL:? required this environment variable}") - -if [ "$PROJECT_TYPE" = org ] || [ "$PROJECT_TYPE" = user ]; then - if [ -z "$MY_GITHUB_TOKEN" ]; then - echo "MY_GITHUB_TOKEN not defined" >&2 - exit 1 - fi - - TOKEN="$MY_GITHUB_TOKEN" # It's User's personal access token. It should be secret. -else - if [ -z "$GITHUB_TOKEN" ]; then - echo "GITHUB_TOKEN not defined" >&2 - exit 1 - fi - - TOKEN="$GITHUB_TOKEN" # GitHub sets. The scope in only the repository containing the workflow file. -fi - -INITIAL_COLUMN_NAME="$INPUT_COLUMN_NAME" -if [ -z "$INITIAL_COLUMN_NAME" ]; then - # assing the column name by default - INITIAL_COLUMN_NAME='To do' - if [ "$GITHUB_EVENT_NAME" == "pull_request" ] || [ "$GITHUB_EVENT_NAME" == "pull_request_target" ]; then - echo "changing column name for PR event" - INITIAL_COLUMN_NAME='In progress' - fi -fi - - -PROJECT_ID=$(find_project_id "$PROJECT_TYPE" "$PROJECT_URL") -INITIAL_COLUMN_ID=$(find_column_id "$PROJECT_ID" "${INITIAL_COLUMN_NAME:? required this environment variable}") - -if [ -z "$INITIAL_COLUMN_ID" ]; then - echo "Column name '$INITIAL_COLUMN_ID' is not found." >&2 - exit 1 -fi - -case "$GITHUB_EVENT_NAME" in - issues|issue_comment) - ISSUE_ID=$(jq -r '.issue.id' < "$GITHUB_EVENT_PATH") - - # Add this issue to the project column - curl -s -X POST -u "$GITHUB_ACTOR:$TOKEN" --retry 3 \ - -H 'Accept: application/vnd.github.inertia-preview+json' \ - -d "{\"content_type\": \"Issue\", \"content_id\": $ISSUE_ID}" \ - "https://api.github.com/projects/columns/$INITIAL_COLUMN_ID/cards" - ;; - pull_request|pull_request_target) - PULL_REQUEST_ID=$(jq -r '.pull_request.id' < "$GITHUB_EVENT_PATH") - - # Add this pull_request to the project column - curl -s -X POST -u "$GITHUB_ACTOR:$TOKEN" --retry 3 \ - -H 'Accept: application/vnd.github.inertia-preview+json' \ - -d "{\"content_type\": \"PullRequest\", \"content_id\": $PULL_REQUEST_ID}" \ - "https://api.github.com/projects/columns/$INITIAL_COLUMN_ID/cards" - ;; - *) - echo "Nothing to be done on this action: '$GITHUB_EVENT_NAME'" >&2 - exit 1 - ;; -esac diff --git a/.github/disabled-workflows/deploy.yml b/.github/disabled-workflows/deploy.yml index 4da6d06a5bc..b1018b4ed6e 100644 --- a/.github/disabled-workflows/deploy.yml +++ b/.github/disabled-workflows/deploy.yml @@ -86,6 +86,19 @@ jobs: # this is not necessary, since extra.yml doesn't contain any new images that weren't pulled within script above # docker compose --env-file $ENVFILE -p dspace-$INSTANCE -f docker/docker-compose.yml -f docker/docker-compose-rest.yml -f /opt/dspace-envs/8/extra.yml pull docker compose --env-file $ENVFILE -p dspace-$INSTANCE -f docker/docker-compose.yml -f docker/docker-compose-rest.yml -f /opt/dspace-envs/8/extra.yml up -d --no-build + + # this must be here and not in the start.sh, because extra.yml replaces dspace container + ## !!!!! please remove this section if you do not want handle server !!!!!!! + echo "=====" + echo "installing handle server" + docker exec dspace${INSTANCE} apt update + docker exec dspace${INSTANCE} apt install host -y + echo "installed host from apt" + docker exec dspace${INSTANCE} /dspace/bin/make-handle-config + echo "made handle config:" + docker exec dspace${INSTANCE} cat /dspace/handle-server/config.dct + docker exec dspace${INSTANCE} /dspace/bin/start-handle-server + echo "started handle server" # this seems to be the easiest solution for now docker restart dockerized-nginx-with-shibboleth-nginx-1 /bin/bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://dev-5.pc:8$INSTANCE/server/api)" != "200" ]]; do sleep 5; done' @@ -103,6 +116,7 @@ jobs: with: INSTANCE: ${{ env.INSTANCE }} DATADIR: /opt/dspace-data/clarin-dspace/ + ASSETSTORE: /opt/dspace-data/clarin-dspace/assetstore/ - name: dspace basic command run: | @@ -140,7 +154,7 @@ jobs: run: | # wait until FE stabilizes a bit sleep 3m - + curl -H "Accept: application/vnd.github.everest-preview+json" \ -H "Authorization: token ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }}" \ --request POST \ @@ -163,7 +177,7 @@ jobs: echo $RES # if last result is not success, return -1 and fail if [[ $RES != \"success\" ]]; then - echo "playwright tests have failed! check appropriate action run" + echo "playwright tests have failed! check appropriate action run in the dspace-ui-tests repository" exit 1 fi; @@ -196,7 +210,7 @@ jobs: echo $RES # if last result is not success, return -1 and fail if [[ $RES != \"success\" ]]; then - echo "rest-tests have failed! check appropriate action run" + echo "rest-tests have failed! check appropriate action run in the dspace-rest-test repository" exit 1 fi; @@ -211,7 +225,7 @@ jobs: run: | # wait until FE stabilizes a bit sleep 3m - + curl -H "Accept: application/vnd.github.everest-preview+json" \ -H "Authorization: token ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }}" \ --request POST \ @@ -235,7 +249,7 @@ jobs: # if last result is not success, return -1 and fail if [[ $RES != \"success\" ]]; then - echo "playwright tests have failed! check appropriate action run" + echo "playwright tests have failed! check appropriate action run in the dspace-ui-tests repository" exit 1 fi; @@ -268,6 +282,6 @@ jobs: echo $RES # if last result is not success, return -1 and fail if [[ $RES != \"success\" ]]; then - echo "rest-tests have failed! check appropriate action run" + echo "rest-tests have failed! check appropriate action run in the dspace-rest-test repository" exit 1 fi; diff --git a/.github/disabled-workflows/erase_db.yml b/.github/disabled-workflows/erase_db.yml index 6aa4f348f5e..f3526c680dd 100644 --- a/.github/disabled-workflows/erase_db.yml +++ b/.github/disabled-workflows/erase_db.yml @@ -10,6 +10,7 @@ on: options: - '5' - '8' + - '4' jobs: @@ -25,4 +26,4 @@ jobs: - uses: ./.github/actions/erase-db with: INSTANCE: ${{ env.INSTANCE }} - NAME: dspace-${{ env.INSTANCE }} \ No newline at end of file + NAME: dspace-${{ env.INSTANCE }} diff --git a/.github/disabled-workflows/issue_opened.yml b/.github/disabled-workflows/issue_opened.yml deleted file mode 100644 index b971ff95125..00000000000 --- a/.github/disabled-workflows/issue_opened.yml +++ /dev/null @@ -1,26 +0,0 @@ -# This workflow runs whenever a new issue is created -name: Issue opened - -on: - issues: - types: [opened] - -permissions: {} -jobs: - automation: - runs-on: ubuntu-latest - steps: - # Add the new issue to a project board, if it needs triage - # See https://github.com/actions/add-to-project - - name: Add issue to triage board - # Only add to project board if issue is flagged as "needs triage" or has no labels - # NOTE: By default we flag new issues as "needs triage" in our issue template - if: (contains(github.event.issue.labels.*.name, 'needs triage') || join(github.event.issue.labels.*.name) == '') - uses: actions/add-to-project@v0.5.0 - # Note, the authentication token below is an ORG level Secret. - # It must be created/recreated manually via a personal access token with admin:org, project, public_repo permissions - # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token - # This is necessary because the "DSpace Backlog" project is an org level project (i.e. not repo specific) - with: - github-token: ${{ secrets.TRIAGE_PROJECT_TOKEN }} - project-url: https://github.com/orgs/DSpace/projects/24 diff --git a/.github/disabled-workflows/label_merge_conflicts.yml b/.github/disabled-workflows/label_merge_conflicts.yml deleted file mode 100644 index a840a4fd171..00000000000 --- a/.github/disabled-workflows/label_merge_conflicts.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This workflow checks open PRs for merge conflicts and labels them when conflicts are found -name: Check for merge conflicts - -# Run whenever the "main" branch is updated -# NOTE: This means merge conflicts are only checked for when a PR is merged to main. -on: - push: - branches: [ main ] - # So that the `conflict_label_name` is removed if conflicts are resolved, - # we allow this to run for `pull_request_target` so that github secrets are available. - pull_request_target: - types: [ synchronize ] - -permissions: {} - -jobs: - triage: - # Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace-angular' - if: github.repository == 'dspace/dspace-angular' - runs-on: ubuntu-latest - permissions: - pull-requests: write - steps: - # See: https://github.com/prince-chrismc/label-merge-conflicts-action - - name: Auto-label PRs with merge conflicts - uses: prince-chrismc/label-merge-conflicts-action@v2 - # Add "merge conflict" label if a merge conflict is detected. Remove it when resolved. - # Note, the authentication token is created automatically - # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token - with: - conflict_label_name: 'merge conflict' - github_token: ${{ secrets.GITHUB_TOKEN }} - conflict_comment: | - Hi @${author}, - Conflicts have been detected against the base branch. - 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! \ No newline at end of file diff --git a/config/config.example.yml b/config/config.example.yml index 840757b8b40..9aae1fc79b4 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -17,6 +17,13 @@ ui: # Trust X-FORWARDED-* headers from proxies (default = true) useProxies: true +universal: + # Whether to inline "critical" styles into the server-side rendered HTML. + # Determining which styles are critical is a relatively expensive operation; + # this option can be disabled to boost server performance at the expense of + # loading smoothness. + inlineCriticalCss: false + # The REST API server settings # NOTE: these settings define which (publicly available) REST API to use. They are usually # 'synced' with the 'dspace.server.url' setting in your backend's local.cfg. diff --git a/docker/docker-compose-rest.yml b/docker/docker-compose-rest.yml index f2abaa9dd46..dd9bed6ced1 100644 --- a/docker/docker-compose-rest.yml +++ b/docker/docker-compose-rest.yml @@ -36,7 +36,6 @@ services: dspace__P__dir: /dspace dspace__P__server__P__url: ${REST_URL:-http://127.0.0.1:8080/server} dspace__P__ui__P__url: ${UI_URL:-http://127.0.0.1:4000} - dspace__P__name: 'DSpace Started with Docker Compose' # db.url: Ensure we are using the 'dspacedb' image for our database db__P__url: 'jdbc:postgresql://dspacedb:543${INSTANCE}/dspace' # solr.server: Ensure we are using the 'dspacesolr' image for Solr @@ -61,12 +60,22 @@ services: networks: dspacenet: ports: + # BE server port - published: 808${INSTANCE} target: 8080 host_ip: 127.0.0.1 + # original debug port - published: 800${INSTANCE} target: 8000 host_ip: 127.0.0.1 + # handle binary port as per https://www.handle.net/hnr_support.html (5th paragraph) + - published: 264${INSTANCE} + target: 2641 + host_ip: 127.0.0.1 + # handle http port as per https://www.handle.net/hnr_support.html (5th paragraph) + - published: 801${INSTANCE} + target: 8010 + host_ip: 127.0.0.1 stdin_open: true tty: true volumes: @@ -74,11 +83,13 @@ services: - assetstore:/dspace/assetstore # Mount DSpace's solr configs to a volume, so that we can share to 'dspacesolr' container (see below) - solr_configs:/dspace/solr + - handle_server:/dspace/handle-server - ./local.cfg:/dspace/config/local.cfg # Ensure that the database is ready BEFORE starting tomcat # 1. While a TCP connection to dspacedb port 5432 is not available, continue to sleep # 2. Then, run database migration to init database tables - # 3. Finally, start Tomcat + # 3. Use custom_run script, to enable debugging under certain conditions + # 4. Start the Handle server!!!! (please make sure you DO actually want it, otherwise remove last line) entrypoint: - /bin/bash - '-c' @@ -86,6 +97,7 @@ services: while (! /dev/null 2>&1; do sleep 1; done; /dspace/bin/dspace database migrate force custom_run.sh + /dspace/bin/start-handle-server # DSpace database container dspacedb: restart: unless-stopped @@ -159,3 +171,4 @@ volumes: solr_configs: dspace_logs: solr_logs: + handle_server: diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 6293da2c4b8..60fa4aa2f62 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -26,6 +26,7 @@ services: image: ${DSPACE_UI_IMAGE:-ufal/dspace-angular:dspace-7_x} volumes: - ./config.prod.yml:/app/config/config.prod.yml +# - ./dspace-ui.json:/app/docker/dspace-ui.json:rw build: context: .. dockerfile: Dockerfile diff --git a/docker/dspace-ui.json b/docker/dspace-ui.json index 7e190ab4d51..fdd93daf66e 100644 --- a/docker/dspace-ui.json +++ b/docker/dspace-ui.json @@ -4,9 +4,11 @@ "name": "dspace-ui", "cwd": "/app", "script": "dist/server/main.js", + "time": true, "instances": "7", "exec_mode": "cluster", - "node_args": "--max_old_space_size=4096", + "node_args": "--max_old_space_size=1344", + "max_memory_restart": "2G", "env": {"NODE_ENV": "production"} } ] diff --git a/scripts/sourceversion.py b/scripts/sourceversion.py index 73b8abf36f3..c6d50504613 100644 --- a/scripts/sourceversion.py +++ b/scripts/sourceversion.py @@ -1,20 +1,29 @@ import subprocess import sys -from datetime import datetime +from datetime import datetime, timezone # when next editing this script, please introduce argparse. -# do not forget, it is called in BE by .github\workflows\reusable-docker-build.yml -# argparse must be introduced there. +# do not forget, it is called in BE by .github\workflows\reusable-docker-build.yml +# argparse must be introduced there. # that action also calls BE version of this script, which is different (BE: scripts/sourceversion.py). # It must also cooperate with argparse # the idea is, that this will be different on each branch, but could be possibly passed by argv/argparse RELEASE_TAG_BASE='none' +def get_time_in_timezone(zone: str = "Europe/Bratislava"): + try: + from zoneinfo import ZoneInfo + my_tz = ZoneInfo(zone) + except Exception as e: + my_tz = timezone.utc + return datetime.now(my_tz) + + if __name__ == '__main__': - ts = datetime.now() + ts = get_time_in_timezone() # we have html tags, since this script ends up creating VERSION_D.html - print(f"

This info was generated on:
{ts}

") + print(f"

This info was generated on:
{ts.strftime('%Y-%m-%d %H:%M:%S %Z%z')}

") cmd = 'git log -1 --pretty=format:"

Git hash:
%H
Date of commit:
%ai

"' subprocess.check_call(cmd, shell=True) diff --git a/server.ts b/server.ts index da085f372fd..93f3e868763 100644 --- a/server.ts +++ b/server.ts @@ -131,6 +131,7 @@ export function app() { server.engine('html', (_, options, callback) => ngExpressEngine({ bootstrap: ServerAppModule, + inlineCriticalCss: environment.universal.inlineCriticalCss, providers: [ { provide: REQUEST, diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 967cc55d9bc..0c02926c3f7 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -265,6 +265,11 @@ import { STATIC_PAGE_PATH } from './static-page/static-page-routing-paths'; path: STATIC_PAGE_PATH, loadChildren: () => import('./static-page/static-page.module').then((m) => m.StaticPageModule), }, + { + path: 'share-submission', + loadChildren: () => import('./share-submission/share-submission.module').then((m) => m.ShareSubmissionModule), + canActivate: [AuthenticatedGuard, EndUserAgreementCurrentUserGuard] + }, { path: '**', pathMatch: 'full', component: ThemedPageNotFoundComponent } ] } diff --git a/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.ts b/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.ts index 0b8e6a66e5b..700c6f162c2 100644 --- a/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.ts +++ b/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.ts @@ -18,6 +18,7 @@ import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { SignpostingDataService } from '../../core/data/signposting-data.service'; import { ServerResponseService } from '../../core/services/server-response.service'; import { SignpostingLink } from '../../core/data/signposting-links.model'; +import { environment } from '../../../environments/environment'; @Component({ selector: 'ds-bitstream-download-page', @@ -101,6 +102,9 @@ export class BitstreamDownloadPageComponent implements OnInit { * @private */ private initPageLinks(): void { + if (!environment.signpostingEnabled) { + return; + } if (isPlatformServer(this.platformId)) { this.route.params.subscribe(params => { this.signpostingDataService.getLinks(params.id).pipe(take(1)).subscribe((signpostingLinks: SignpostingLink[]) => { diff --git a/src/app/bitstream-page/clarin-license-agreement-page/clarin-license-agreement-page.component.html b/src/app/bitstream-page/clarin-license-agreement-page/clarin-license-agreement-page.component.html index b73952718d5..99d77f87780 100644 --- a/src/app/bitstream-page/clarin-license-agreement-page/clarin-license-agreement-page.component.html +++ b/src/app/bitstream-page/clarin-license-agreement-page/clarin-license-agreement-page.component.html @@ -14,6 +14,10 @@