Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New hdl api #1692

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open

New hdl api #1692

wants to merge 4 commits into from

Conversation

nicolasfranck
Copy link
Contributor

@nicolasfranck nicolasfranck commented Aug 19, 2024

TODO before using this:

  • Add an nginx server block with host name hdl.lib.ugent.be on persse with a location / proxying to https://127.0.0.1:8000, ignoring verification . The backend uses a self signed certificate, and cannot do otherwise: https is required for administrative requests, but having a real certificate would require the handle server to run on port 443

example:

upstream handles {
    server 127.0.0.1:8000;
    keepalive 2;
    keepalive_requests 50;
    keepalive_timeout 10s;
}
server {
    listen *:443 ssl http2;
    server_name handle.lib.ugent.be;
    location / {
      proxy_ssl_verify off;
      proxy_pass https://handles; #important: use https, or administrative tasks are denied
    }
}

-> THIS IS TAKEN CARE OF, but the domain names are handle.libtest.ugent.be and handle.lib.ugent.be

  • update the following environment variables in vault:
+BIBLIO_BACKOFFICE_HDL_SRV_ADM_ID="300:0.NA/1854"
+BIBLIO_BACKOFFICE_HDL_SRV_ADM_PRIVATE_KEY=<rsa private key>
-BIBLIO_BACKOFFICE_HDL_SRV_USERNAME
-BIBLIO_BACKOFFICE_HDL_SRV_URL=https://hdl.lib.ugent.be/handles
+BIBLIO_BACKOFFICE_HDL_SRV_URL=https://handle.lib.ugent.be

-> BIBLIO_BACKOFFICE_HDL_SRV_ADM_ID added to vault production
-> BIBLIO_BACKOFFICE_HDL_SRV_ADM_PRIVATE_KEY added to vault
-> BIBLIO_BACKOFFICE_HDL_SRV_URL can only be changed during migration
-> BIBLIO_BACKOFFICE_HDL_SRV_USERNAME should be removed after migration (does not apply anymore)

  • https://hdl.lib.ugent.be is now pointing at a nomad job serving the old handle-server-api. As the domain is different this can be switched off later.

  • handle api itself requires extra handle value records of type HS_ADMIN. Better to insert them at time of migration. In order to do, I would prefer to add an extra flag --force to the existing command create-handles to remake all handles. This would however not overwrite those legacy handle records that were created before biblio. And also an update to the biblio record would not be needed too, as there were no changes to the biblio record, but in only in the external handle record.

-> see latest commit fb80a92 that allows you to do:

go run main.go create-handles --force

the flag --force basically triggers the opposite action: create handles in the handle-server for those records that already have a handle url in their record. It does however not update the publication/dataset record itself (as no change is involved).

But a better naming could be in place (--force implies that there would be problems if you do not provide it)

@nicolasfranck nicolasfranck marked this pull request as ready for review October 1, 2024 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant