Server Handbook live check: run log ------------------------------------------------------------------------------ Tool https://serverhandbook.com/tools/oai-pmh-viewer Check scripts/live/checks/tool-oai-pmh-viewer.mjs (sha256 f79f8ba10aa85d12c6d8827164c965a8a8f40ac6a60995f6488c1beaee7fb8e9) Ran at 2026-12-05T10:41:44Z (1366 s) Result PASS, all 43 claims held Tested on System Ubuntu 24.04.5 LTS Kernel 6.8.0-151-generic Package openjdk-21-jdk-headless 21.0.13.1+2-1~24.04.1 Package ant 1.10.14-1 Package postgresql-16 16.15-0ubuntu0.24.04.1 Package nginx 1.24.0-2ubuntu7.21 Package mariadb-server 1:10.11.14-0ubuntu0.24.04.1 Package php-fpm 2:8.3+93ubuntu2 Package dspace 10.1 Package solr 9.11.0 Package ojs 3.5.0.6 Setup A fresh Ubuntu 24.04 server (4 GB of memory) with BOTH repositories installed by the check before the first step shown, one after the other: DSpace 10.1 as lesson 1 of the DSpace course installs it (PostgreSQL, Solr, the backend as a service) with three archived items, its answers saved and then DSpace and Solr stopped; and OJS 3.5.0.6 as lesson 1 of the OJS course installs it, with one issue of three published articles (its site name journal.example.com points to the server through an /etc/hosts line). Reached over SSH as a sudo user. Every version above was read from the server at run time. Passwords used on the throwaway test server are shown as [password]. How we test: https://serverhandbook.com/how-we-test ------------------------------------------------------------------------------ What the steps changed on the server (recorded before the first step and after the last) Packages added (81) galera-4 26.4.16-2build4 libaom3 3.8.2-2ubuntu0.2 libcgi-fast-perl 1:2.17-1 libcgi-pm-perl 4.63-1 libclone-perl 0.46-1build3 libconfig-inifiles-perl 3.000003-2ubuntu0.1 libdbd-mysql-perl 4.052-1ubuntu3 libdbi-perl 1.643-4ubuntu0.5 libdeflate0 1.19-1build1.1 libencode-locale-perl 1.05-3 libfcgi-bin 2.4.2-2.1ubuntu0.24.04.1 libfcgi-perl 0.82+ds-3build2 libfcgi0t64 2.4.2-2.1ubuntu0.24.04.1 libgd3 2.3.3-9ubuntu5 libheif-plugin-aomdec 1.17.6-1ubuntu4.10 libheif-plugin-aomenc 1.17.6-1ubuntu4.10 libheif1 1.17.6-1ubuntu4.10 libhtml-parser-perl 3.81-1ubuntu0.1 libhtml-tagset-perl 3.20-6 libhtml-template-perl 2.97-2 libhttp-date-perl 6.06-1ubuntu0.24.04.1 libhttp-message-perl 6.45-1ubuntu1 libio-html-perl 1.004-3 libjbig0 2.1-6.1ubuntu2 liblerc4 4.0.0+ds-4ubuntu2 liblwp-mediatypes-perl 6.04-2 libmariadb3 1:10.11.14-0ubuntu0.24.04.1 libmysqlclient21 8.0.46-0ubuntu0.24.04.5 libonig5 6.9.9-1build1 libsharpyuv0 1.3.2-0.4build3 libsnappy1v5 1.1.10-1build1 libtiff6 4.5.1+git230720-4ubuntu2.7 libtimedate-perl 2.3300-2 liburi-perl 5.27-1 libwebp7 1.3.2-0.4build3 libx11-6 2:1.8.7-1ubuntu0.1 libx11-data 2:1.8.7-1ubuntu0.1 libxau6 1:1.0.9-1build6 libxcb1 1.15-1ubuntu2 libxdmcp6 1:1.1.3-0ubuntu6 libxpm4 1:3.5.17-1ubuntu0.24.04.2 libzip4t64 1.7.3-1.1ubuntu2 mariadb-client 1:10.11.14-0ubuntu0.24.04.1 mariadb-client-core 1:10.11.14-0ubuntu0.24.04.1 mariadb-common 1:10.11.14-0ubuntu0.24.04.1 mariadb-plugin-provider-bzip2 1:10.11.14-0ubuntu0.24.04.1 mariadb-plugin-provider-lz4 1:10.11.14-0ubuntu0.24.04.1 mariadb-plugin-provider-lzma 1:10.11.14-0ubuntu0.24.04.1 mariadb-plugin-provider-lzo 1:10.11.14-0ubuntu0.24.04.1 mariadb-plugin-provider-snappy 1:10.11.14-0ubuntu0.24.04.1 mariadb-server 1:10.11.14-0ubuntu0.24.04.1 mariadb-server-core 1:10.11.14-0ubuntu0.24.04.1 mysql-common 5.8+1.1.0build1 nginx 1.24.0-2ubuntu7.21 nginx-common 1.24.0-2ubuntu7.21 php-bcmath 2:8.3+93ubuntu2 php-cli 2:8.3+93ubuntu2 php-common 2:93ubuntu2 php-curl 2:8.3+93ubuntu2 php-fpm 2:8.3+93ubuntu2 php-gd 2:8.3+93ubuntu2 php-intl 2:8.3+93ubuntu2 php-mbstring 2:8.3+93ubuntu2 php-mysql 2:8.3+93ubuntu2 php-xml 2:8.3+93ubuntu2 php-zip 2:8.3+93ubuntu2 php8.3-bcmath 8.3.6-0ubuntu0.24.04.14 php8.3-cli 8.3.6-0ubuntu0.24.04.14 php8.3-common 8.3.6-0ubuntu0.24.04.14 php8.3-curl 8.3.6-0ubuntu0.24.04.14 php8.3-fpm 8.3.6-0ubuntu0.24.04.14 php8.3-gd 8.3.6-0ubuntu0.24.04.14 php8.3-intl 8.3.6-0ubuntu0.24.04.14 php8.3-mbstring 8.3.6-0ubuntu0.24.04.14 php8.3-mysql 8.3.6-0ubuntu0.24.04.14 php8.3-opcache 8.3.6-0ubuntu0.24.04.14 php8.3-readline 8.3.6-0ubuntu0.24.04.14 php8.3-xml 8.3.6-0ubuntu0.24.04.14 php8.3-zip 8.3.6-0ubuntu0.24.04.14 pv 1.8.5-2build1 socat 1.8.0.0-4ubuntu0.1 Packages upgraded (0) Packages removed (0) Services enabled at boot (3) mariadb.service nginx.service php8.3-fpm.service Services disabled (0) Listening sockets opened (2) tcp 0.0.0.0:80 nginx tcp 127.0.0.1:3306 mariadbd Listening sockets closed (3) tcp [::ffff:127.0.0.1]:7983 java tcp [::ffff:127.0.0.1]:8080 java tcp [::ffff:127.0.0.1]:8983 java Files added in /etc (186) /etc/alternatives/my.cnf /etc/alternatives/phar /etc/alternatives/phar.1.gz /etc/alternatives/phar.phar /etc/alternatives/phar.phar.1.gz /etc/alternatives/php /etc/alternatives/php-fpm.sock /etc/alternatives/php.1.gz /etc/apache2/conf-available/php8.3-fpm.conf /etc/apparmor.d/usr.sbin.mariadbd /etc/cron.d/php /etc/default/nginx /etc/init.d/mariadb /etc/init.d/nginx /etc/init.d/php8.3-fpm /etc/logcheck/ignore.d.paranoid/mariadb-server /etc/logcheck/ignore.d.server/mariadb-server /etc/logcheck/ignore.d.workstation/mariadb-server /etc/logrotate.d/mariadb /etc/logrotate.d/nginx /etc/logrotate.d/php8.3-fpm /etc/mysql/conf.d/mysql.cnf /etc/mysql/conf.d/mysqldump.cnf /etc/mysql/debian-start /etc/mysql/debian.cnf /etc/mysql/mariadb.cnf /etc/mysql/mariadb.conf.d/50-client.cnf /etc/mysql/mariadb.conf.d/50-mysql-clients.cnf /etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf /etc/mysql/mariadb.conf.d/50-server.cnf /etc/mysql/mariadb.conf.d/60-galera.cnf /etc/mysql/mariadb.conf.d/provider_bzip2.cnf /etc/mysql/mariadb.conf.d/provider_lz4.cnf /etc/mysql/mariadb.conf.d/provider_lzma.cnf /etc/mysql/mariadb.conf.d/provider_lzo.cnf /etc/mysql/mariadb.conf.d/provider_snappy.cnf /etc/mysql/my.cnf /etc/mysql/my.cnf.fallback /etc/nginx/fastcgi.conf /etc/nginx/fastcgi_params /etc/nginx/koi-utf /etc/nginx/koi-win /etc/nginx/mime.types /etc/nginx/nginx.conf /etc/nginx/proxy_params /etc/nginx/scgi_params /etc/nginx/sites-available/default /etc/nginx/sites-available/ojs /etc/nginx/sites-enabled/ojs /etc/nginx/snippets/fastcgi-php.conf /etc/nginx/snippets/snakeoil.conf /etc/nginx/uwsgi_params /etc/nginx/win-utf /etc/php/8.3/cli/conf.d/10-mysqlnd.ini /etc/php/8.3/cli/conf.d/10-opcache.ini /etc/php/8.3/cli/conf.d/10-pdo.ini /etc/php/8.3/cli/conf.d/15-xml.ini /etc/php/8.3/cli/conf.d/20-bcmath.ini /etc/php/8.3/cli/conf.d/20-calendar.ini /etc/php/8.3/cli/conf.d/20-ctype.ini /etc/php/8.3/cli/conf.d/20-curl.ini /etc/php/8.3/cli/conf.d/20-dom.ini /etc/php/8.3/cli/conf.d/20-exif.ini /etc/php/8.3/cli/conf.d/20-ffi.ini /etc/php/8.3/cli/conf.d/20-fileinfo.ini /etc/php/8.3/cli/conf.d/20-ftp.ini /etc/php/8.3/cli/conf.d/20-gd.ini /etc/php/8.3/cli/conf.d/20-gettext.ini /etc/php/8.3/cli/conf.d/20-iconv.ini /etc/php/8.3/cli/conf.d/20-intl.ini /etc/php/8.3/cli/conf.d/20-mbstring.ini /etc/php/8.3/cli/conf.d/20-mysqli.ini /etc/php/8.3/cli/conf.d/20-pdo_mysql.ini /etc/php/8.3/cli/conf.d/20-phar.ini /etc/php/8.3/cli/conf.d/20-posix.ini /etc/php/8.3/cli/conf.d/20-readline.ini /etc/php/8.3/cli/conf.d/20-shmop.ini /etc/php/8.3/cli/conf.d/20-simplexml.ini /etc/php/8.3/cli/conf.d/20-sockets.ini /etc/php/8.3/cli/conf.d/20-sysvmsg.ini /etc/php/8.3/cli/conf.d/20-sysvsem.ini /etc/php/8.3/cli/conf.d/20-sysvshm.ini /etc/php/8.3/cli/conf.d/20-tokenizer.ini /etc/php/8.3/cli/conf.d/20-xmlreader.ini /etc/php/8.3/cli/conf.d/20-xmlwriter.ini /etc/php/8.3/cli/conf.d/20-xsl.ini /etc/php/8.3/cli/conf.d/20-zip.ini /etc/php/8.3/cli/php.ini /etc/php/8.3/fpm/conf.d/10-mysqlnd.ini /etc/php/8.3/fpm/conf.d/10-opcache.ini /etc/php/8.3/fpm/conf.d/10-pdo.ini /etc/php/8.3/fpm/conf.d/15-xml.ini /etc/php/8.3/fpm/conf.d/20-bcmath.ini /etc/php/8.3/fpm/conf.d/20-calendar.ini /etc/php/8.3/fpm/conf.d/20-ctype.ini /etc/php/8.3/fpm/conf.d/20-curl.ini /etc/php/8.3/fpm/conf.d/20-dom.ini /etc/php/8.3/fpm/conf.d/20-exif.ini /etc/php/8.3/fpm/conf.d/20-ffi.ini /etc/php/8.3/fpm/conf.d/20-fileinfo.ini /etc/php/8.3/fpm/conf.d/20-ftp.ini /etc/php/8.3/fpm/conf.d/20-gd.ini /etc/php/8.3/fpm/conf.d/20-gettext.ini /etc/php/8.3/fpm/conf.d/20-iconv.ini /etc/php/8.3/fpm/conf.d/20-intl.ini /etc/php/8.3/fpm/conf.d/20-mbstring.ini /etc/php/8.3/fpm/conf.d/20-mysqli.ini /etc/php/8.3/fpm/conf.d/20-pdo_mysql.ini /etc/php/8.3/fpm/conf.d/20-phar.ini /etc/php/8.3/fpm/conf.d/20-posix.ini /etc/php/8.3/fpm/conf.d/20-readline.ini /etc/php/8.3/fpm/conf.d/20-shmop.ini /etc/php/8.3/fpm/conf.d/20-simplexml.ini /etc/php/8.3/fpm/conf.d/20-sockets.ini /etc/php/8.3/fpm/conf.d/20-sysvmsg.ini /etc/php/8.3/fpm/conf.d/20-sysvsem.ini /etc/php/8.3/fpm/conf.d/20-sysvshm.ini /etc/php/8.3/fpm/conf.d/20-tokenizer.ini /etc/php/8.3/fpm/conf.d/20-xmlreader.ini /etc/php/8.3/fpm/conf.d/20-xmlwriter.ini /etc/php/8.3/fpm/conf.d/20-xsl.ini /etc/php/8.3/fpm/conf.d/20-zip.ini /etc/php/8.3/fpm/php-fpm.conf /etc/php/8.3/fpm/php.ini /etc/php/8.3/fpm/pool.d/www.conf /etc/php/8.3/mods-available/bcmath.ini /etc/php/8.3/mods-available/calendar.ini /etc/php/8.3/mods-available/ctype.ini /etc/php/8.3/mods-available/curl.ini /etc/php/8.3/mods-available/dom.ini /etc/php/8.3/mods-available/exif.ini /etc/php/8.3/mods-available/ffi.ini /etc/php/8.3/mods-available/fileinfo.ini /etc/php/8.3/mods-available/ftp.ini /etc/php/8.3/mods-available/gd.ini /etc/php/8.3/mods-available/gettext.ini /etc/php/8.3/mods-available/iconv.ini /etc/php/8.3/mods-available/intl.ini /etc/php/8.3/mods-available/mbstring.ini /etc/php/8.3/mods-available/mysqli.ini /etc/php/8.3/mods-available/mysqlnd.ini /etc/php/8.3/mods-available/opcache.ini /etc/php/8.3/mods-available/pdo.ini /etc/php/8.3/mods-available/pdo_mysql.ini /etc/php/8.3/mods-available/phar.ini /etc/php/8.3/mods-available/posix.ini /etc/php/8.3/mods-available/readline.ini /etc/php/8.3/mods-available/shmop.ini /etc/php/8.3/mods-available/simplexml.ini /etc/php/8.3/mods-available/sockets.ini /etc/php/8.3/mods-available/sysvmsg.ini /etc/php/8.3/mods-available/sysvsem.ini /etc/php/8.3/mods-available/sysvshm.ini /etc/php/8.3/mods-available/tokenizer.ini /etc/php/8.3/mods-available/xml.ini /etc/php/8.3/mods-available/xmlreader.ini /etc/php/8.3/mods-available/xmlwriter.ini /etc/php/8.3/mods-available/xsl.ini /etc/php/8.3/mods-available/zip.ini /etc/rc0.d/K01mariadb /etc/rc0.d/K01nginx /etc/rc0.d/K01php8.3-fpm /etc/rc1.d/K01mariadb /etc/rc1.d/K01nginx /etc/rc1.d/K01php8.3-fpm /etc/rc2.d/S01mariadb /etc/rc2.d/S01nginx /etc/rc2.d/S01php8.3-fpm /etc/rc3.d/S01mariadb /etc/rc3.d/S01nginx /etc/rc3.d/S01php8.3-fpm /etc/rc4.d/S01mariadb /etc/rc4.d/S01nginx /etc/rc4.d/S01php8.3-fpm /etc/rc5.d/S01mariadb /etc/rc5.d/S01nginx /etc/rc5.d/S01php8.3-fpm /etc/rc6.d/K01mariadb /etc/rc6.d/K01nginx /etc/rc6.d/K01php8.3-fpm /etc/security/user_map.conf /etc/systemd/system/multi-user.target.wants/mariadb.service /etc/systemd/system/multi-user.target.wants/nginx.service /etc/systemd/system/multi-user.target.wants/php8.3-fpm.service /etc/systemd/system/timers.target.wants/phpsessionclean.timer /etc/ufw/applications.d/nginx Files changed in /etc (10) /etc/group /etc/group- /etc/gshadow /etc/gshadow- /etc/hosts /etc/ld.so.cache /etc/passwd /etc/passwd- /etc/shadow /etc/shadow- Files removed from /etc (0) Disk used on / (includes logs written during the run): +1377.6 MB ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Claims (43), each with what the run saw ------------------------------------------------------------------------------ 1. ok a bare Ubuntu 24.04 server box (web-server) starts 2. ok the tool reads every OAI answer our DSpace and OJS guides captured, and refuses HTML, broken XML and cut-off answers with the reason (local check: all pass) | ✓ oai-pmh-viewer: 58 passed, 0 failed (fixtures: our runs' captures, both releases) 3. ok (setup) the tools: Java 21, Ant, git 4. ok (setup) Maven 3.9.12 from Apache (24.04's is 3.8) 5. ok (setup) PostgreSQL 16 6. ok (setup) role and database dspace 7. ok (setup) the dspace user and /dspace 8. ok (setup) Solr 9.11.0 on 127.0.0.1:8983 9. ok (setup) Solr answers 10. ok (setup) the DSpace 10.1 source and local.cfg 11. ok (setup) mvn package 12. ok (setup) ant fresh_install 13. ok (setup) database migrate 14. ok (setup) the Solr cores 15. ok (setup) Solr is back with the cores 16. ok (setup) the backend service 17. ok (setup) the REST API answers: DSpace 10.1 18. ok (setup) the administrator 19. ok (setup) sample community, collection and SAF folder 20. ok (setup) three sample items imported 21. ok (setup) the sample items have handles | item_001 123456789/3 | item_002 123456789/4 | item_003 123456789/5 22. ok dspace oai import: "Total: 3 items" | Total: 3 items | Total: 0 items | Purging cached OAI responses. 23. ok seven DSpace answers saved with curl (one before the import, six after) | 1 | 7 24. ok (setup) the site name points to this server 25. ok (setup) Nginx, MariaDB, PHP-FPM and the PHP extensions 26. ok (setup) database and user ojs 27. ok (setup) OJS 3.5.0-6 from pkp.sfu.ca into /var/www/ojs 28. ok (setup) cache/, public/, config.inc.php for www-data 29. ok (setup) the Nginx server block 30. ok (setup) /var/www/files for www-data, mode 750 31. ok (setup) the web installer (posted with curl) 32. ok (setup) config.inc.php root:www-data 640 (the installer set allowed_hosts) 33. ok (setup) OJS is installed and its sign-in page answers | installed = On | 200 34. ok (setup) the journal "Example Journal" (/example) created through the API | {"_href":"http:\/\/journal.example.com\/index.php\/example\/api\/v1\/contexts\/1","abbreviation":{"en":""},"about":{"en":""},"acronym":{"en":"EJ"},"additionalHomeContent":{"en":""},"agencies":null,"announcementsIntroduction":{"en":""},"authorGuidelines":{"en":"

Authors are invited to make a submission to this journal. All submissions will be assessed by an editor to determine whether they meet the aims and scope of this journal. Those considered to be a good fit will be sent for peer review before determining whether they will be accepted or rejected.<\/p>

Before making a submission, autho 35. ok (setup) an issue with three published articles imported (Native XML) 36. ok six OJS answers saved with curl | 6 37. ok Python reads all thirteen answers | dspace-bad-prefix {"errors": ["cannotDisseminateFormat"], "repositoryName": null, "baseURL": null, "sets": [], "formats": [], "records": [], "resumption": null} | dspace-bad-verb {"errors": ["badVerb"], "repositoryName": null, "baseURL": null, "sets": [], "formats": [], "records": [], "resumption": null} | dspace-formats {"errors": [], "repositoryName": null, "baseURL": null, "sets": [], "formats": ["didl", "mods", "ore", "mets", "xoai", "datacite", "dim", "rioxx", "uketd_dc", "qdc", "oai_dc", "rdf", "marc", "etdms"], "records": [], "resumption": null} | dspace-identify {"errors": [], "repositoryName": "DSpace at My University", "baseURL": "http://localhost:8080/server/oai/request", "sets": [], "formats": [], "records": [], "resumption": null} | dspace-no-records {"errors": ["noRecordsMatch"], "repositoryName": null, "baseURL": null, "sets": [], "formats": [], "records": [], "resumption": null} | dspace-records {"errors": [], "repositoryName": null, "baseURL": null, "sets": [], "formats": [], "records": [{"id": "oai:localhost:123456789/3", "title": "Soil moisture in dry seasons"}, {"id": "oai:localhost:123456789/5", "title": "Rainfall records 1990 to 2020"}, {"id": "oai:localhost:123456789/4", "title": "Groundwater recharge on terraced farms"}], "resumption": null} | dspace-sets {"errors": [], "repositoryName": null, "baseURL": null, "sets": ["com_123456789_1", "col_123456789_2"], "formats": [], "records": [], "resumption": null} | ojs-bad-prefix {"errors": ["cannotDisseminateFormat"], "repositoryName": null, "baseURL": null, "sets": [], "formats": [], "records": [], "resumption": null} | ojs-bad-verb {"errors": ["badVerb"], "repositoryName": null, "baseURL": null, "sets": [], "formats": [], "records": [], "resumption": null} | ojs-formats {"errors": [], "repositoryName": null, "baseURL": null, "sets": [], "formats": ["oai_marc", "oai_dc", "marcxml", "rfc1807"], "records": [], "resumption": null} | ojs-identify {"errors": [], "repositoryName": "Example Journal", "baseURL": "http://journal.example.com/index.php/example/oai", "sets": [], "formats": [], "records": [], "resumption": null} | ojs-records {"errors": [], "repositoryName": null, "baseURL": null, "sets": [], "formats": [], "records": [{"id": "oai:ojs.journal.example.com:article/1", "title": "Soil moisture in dry seasons"}, {"id": "oai:ojs.journal.example.com:article/2", "title": "Groundwater recharge on terraced farms"}, {"id": "oai:ojs.journal.example.com:article/3", "title": "Rainfall records 1990 to 2020"}], "resumption": null} | ojs-sets {"errors": [], "repositoryName": null, "baseURL": null, "sets": ["example", "example:ART"], "formats": [], "records": [], "resumption": null} 38. ok the tool reads each of the thirteen exactly as Python does: name, base URL, sets, formats, records (identifier and title), errors | dspace-bad-prefix: dspace, ListRecords, errors ["cannotDisseminateFormat"], 0 sets, 0 formats, 0 records, findings ["error:oai:cannotDisseminateFormat"] | dspace-bad-verb: dspace, -, errors ["badVerb"], 0 sets, 0 formats, 0 records, findings ["error:oai:badVerb"] | dspace-formats: dspace, ListMetadataFormats, errors [], 0 sets, 14 formats, 0 records, findings [] | dspace-identify: dspace, Identify, errors [], 0 sets, 0 formats, 0 records, "DSpace at My University", findings ["warning:local-base-url","warning:dspace-defaults","warning:dspace-localhost-ids"] | dspace-no-records: dspace, ListRecords, errors ["noRecordsMatch"], 0 sets, 0 formats, 0 records, findings ["warning:oai:noRecordsMatch"] | dspace-records: dspace, ListRecords, errors [], 0 sets, 0 formats, 3 records, findings [] | dspace-sets: dspace, ListSets, errors [], 2 sets, 0 formats, 0 records, findings [] | ojs-bad-prefix: ojs, ListRecords, errors ["cannotDisseminateFormat"], 0 sets, 0 formats, 0 records, findings ["error:oai:cannotDisseminateFormat"] | ojs-bad-verb: ojs, -, errors ["badVerb"], 0 sets, 0 formats, 0 records, findings ["error:oai:badVerb"] | ojs-formats: ojs, ListMetadataFormats, errors [], 0 sets, 4 formats, 0 records, findings [] | ojs-identify: ojs, Identify, errors [], 0 sets, 0 formats, 0 records, "Example Journal", findings [] | ojs-records: ojs, ListRecords, errors [], 0 sets, 0 formats, 3 records, findings [] | ojs-sets: ojs, ListSets, errors [], 2 sets, 0 formats, 0 records, findings [] | python: | dspace-bad-prefix {"errors": ["cannotDisseminateFormat"], "repositoryName": null, "baseURL": null, "sets": [], "formats": [], "records": [], "resumption": null} | dspace-bad-verb {"errors": ["badVerb"], "repositoryName": null, "baseURL": null, "sets": [], "formats": [], "records": [], "resumption": null} | dspace-formats {"errors": [], "repositoryName": null, "baseURL": null, "sets": [], "formats": ["didl", "mods", "ore", "mets", "xoai", "datacite", "dim", "rioxx", "uketd_dc", "qdc", "oai_dc", "rdf", "marc", "etdms"], "records": [], "resumption": null} | dspace-identify {"errors": [], "repositoryName": "DSpace at My University", "baseURL": "http://localhost:8080/server/oai/request", "sets": [], "formats": [], "records": [], "resumption": null} | dspace-no-records {"errors": ["noRecordsMatch"], "repositoryName": null, "baseURL": null, "sets": [], "formats": [], "records": [], "resumption": null} | dspace-records {"errors": [], "repositoryName": null, "baseURL": null, "sets": [], "formats": [], "records": [{"id": "oai:localhost:123456789/3", "title": "Soil moisture in dry seasons"}, {"id": "oai:localhost:123456789/5", "title": "Rainfall records 1990 to 2020"}, {"id": "oai:localhost:123456789/4", "title": "Groundwater recharge on terraced farms"}], "resumption": null} | dspace-sets {"errors": [], "repositoryName": null, "baseURL": null, "sets": ["com_123456789_1", "col_123456789_2"], "formats": [], "records": [], "resumption": null} | ojs-bad-prefix {"errors": ["cannotDisseminateFormat"], "repositoryName": null, "baseURL": null, "sets": [], "formats": [], "records": [], "resumption": null} | ojs-bad-verb {"errors": ["badVerb"], "repositoryName": null, "baseURL": null, "sets": [], "formats": [], "records": [], "resumption": null} | ojs-formats {"errors": [], "repositoryName": null, "baseURL": null, "sets": [], "formats": ["oai_marc", "oai_dc", "marcxml", "rfc1807"], "records": [], "resumption": null} | ojs-identify {"errors": [], "repositoryName": "Example Journal", "baseURL": "http://journal.example.com/index.php/example/oai", "sets": [], "formats": [], "records": [], "resumption": null} | ojs-records {"errors": [], "repositoryName": null, "baseURL": null, "sets": [], "formats": [], "records": [{"id": "oai:ojs.journal.example.com:article/1", "title": "Soil moisture in dry seasons"}, {"id": "oai:ojs.journal.example.com:article/2", "title": "Groundwater recharge on terraced farms"}, {"id": "oai:ojs.journal.example.com:article/3", "title": "Rainfall records 1990 to 2020"}], "resumption": null} | ojs-sets 39. ok DSpace: three records, the community and collection sets, 14 formats, "DSpace at My University" | dspace-bad-prefix: dspace, ListRecords, errors ["cannotDisseminateFormat"], 0 sets, 0 formats, 0 records, findings ["error:oai:cannotDisseminateFormat"] | dspace-bad-verb: dspace, -, errors ["badVerb"], 0 sets, 0 formats, 0 records, findings ["error:oai:badVerb"] | dspace-formats: dspace, ListMetadataFormats, errors [], 0 sets, 14 formats, 0 records, findings [] | dspace-identify: dspace, Identify, errors [], 0 sets, 0 formats, 0 records, "DSpace at My University", findings ["warning:local-base-url","warning:dspace-defaults","warning:dspace-localhost-ids"] | dspace-no-records: dspace, ListRecords, errors ["noRecordsMatch"], 0 sets, 0 formats, 0 records, findings ["warning:oai:noRecordsMatch"] | dspace-records: dspace, ListRecords, errors [], 0 sets, 0 formats, 3 records, findings [] | dspace-sets: dspace, ListSets, errors [], 2 sets, 0 formats, 0 records, findings [] | ojs-bad-prefix: ojs, ListRecords, errors ["cannotDisseminateFormat"], 0 sets, 0 formats, 0 records, findings ["error:oai:cannotDisseminateFormat"] | ojs-bad-verb: ojs, -, errors ["badVerb"], 0 sets, 0 formats, 0 records, findings ["error:oai:badVerb"] | ojs-formats: ojs, ListMetadataFormats, errors [], 0 sets, 4 formats, 0 records, findings [] | ojs-identify: ojs, Identify, errors [], 0 sets, 0 formats, 0 records, "Example Journal", findings [] | ojs-records: ojs, ListRecords, errors [], 0 sets, 0 formats, 3 records, findings [] | ojs-sets: ojs, ListSets, errors [], 2 sets, 0 formats, 0 records, findings [] 40. ok OJS: three records, "Example Journal" | dspace-bad-prefix: dspace, ListRecords, errors ["cannotDisseminateFormat"], 0 sets, 0 formats, 0 records, findings ["error:oai:cannotDisseminateFormat"] | dspace-bad-verb: dspace, -, errors ["badVerb"], 0 sets, 0 formats, 0 records, findings ["error:oai:badVerb"] | dspace-formats: dspace, ListMetadataFormats, errors [], 0 sets, 14 formats, 0 records, findings [] | dspace-identify: dspace, Identify, errors [], 0 sets, 0 formats, 0 records, "DSpace at My University", findings ["warning:local-base-url","warning:dspace-defaults","warning:dspace-localhost-ids"] | dspace-no-records: dspace, ListRecords, errors ["noRecordsMatch"], 0 sets, 0 formats, 0 records, findings ["warning:oai:noRecordsMatch"] | dspace-records: dspace, ListRecords, errors [], 0 sets, 0 formats, 3 records, findings [] | dspace-sets: dspace, ListSets, errors [], 2 sets, 0 formats, 0 records, findings [] | ojs-bad-prefix: ojs, ListRecords, errors ["cannotDisseminateFormat"], 0 sets, 0 formats, 0 records, findings ["error:oai:cannotDisseminateFormat"] | ojs-bad-verb: ojs, -, errors ["badVerb"], 0 sets, 0 formats, 0 records, findings ["error:oai:badVerb"] | ojs-formats: ojs, ListMetadataFormats, errors [], 0 sets, 4 formats, 0 records, findings [] | ojs-identify: ojs, Identify, errors [], 0 sets, 0 formats, 0 records, "Example Journal", findings [] | ojs-records: ojs, ListRecords, errors [], 0 sets, 0 formats, 3 records, findings [] | ojs-sets: ojs, ListSets, errors [], 2 sets, 0 formats, 0 records, findings [] 41. ok the protocol’s errors, read by the tool: noRecordsMatch (DSpace before the import), cannotDisseminateFormat, badVerb on both | dspace-bad-prefix: dspace, ListRecords, errors ["cannotDisseminateFormat"], 0 sets, 0 formats, 0 records, findings ["error:oai:cannotDisseminateFormat"] | dspace-bad-verb: dspace, -, errors ["badVerb"], 0 sets, 0 formats, 0 records, findings ["error:oai:badVerb"] | dspace-formats: dspace, ListMetadataFormats, errors [], 0 sets, 14 formats, 0 records, findings [] | dspace-identify: dspace, Identify, errors [], 0 sets, 0 formats, 0 records, "DSpace at My University", findings ["warning:local-base-url","warning:dspace-defaults","warning:dspace-localhost-ids"] | dspace-no-records: dspace, ListRecords, errors ["noRecordsMatch"], 0 sets, 0 formats, 0 records, findings ["warning:oai:noRecordsMatch"] | dspace-records: dspace, ListRecords, errors [], 0 sets, 0 formats, 3 records, findings [] | dspace-sets: dspace, ListSets, errors [], 2 sets, 0 formats, 0 records, findings [] | ojs-bad-prefix: ojs, ListRecords, errors ["cannotDisseminateFormat"], 0 sets, 0 formats, 0 records, findings ["error:oai:cannotDisseminateFormat"] | ojs-bad-verb: ojs, -, errors ["badVerb"], 0 sets, 0 formats, 0 records, findings ["error:oai:badVerb"] | ojs-formats: ojs, ListMetadataFormats, errors [], 0 sets, 4 formats, 0 records, findings [] | ojs-identify: ojs, Identify, errors [], 0 sets, 0 formats, 0 records, "Example Journal", findings [] | ojs-records: ojs, ListRecords, errors [], 0 sets, 0 formats, 3 records, findings [] | ojs-sets: ojs, ListSets, errors [], 2 sets, 0 formats, 0 records, findings [] 42. ok the tool names the software that answered: DSpace for every DSpace answer, OJS for every OJS answer | dspace-bad-prefix: dspace, ListRecords, errors ["cannotDisseminateFormat"], 0 sets, 0 formats, 0 records, findings ["error:oai:cannotDisseminateFormat"] | dspace-bad-verb: dspace, -, errors ["badVerb"], 0 sets, 0 formats, 0 records, findings ["error:oai:badVerb"] | dspace-formats: dspace, ListMetadataFormats, errors [], 0 sets, 14 formats, 0 records, findings [] | dspace-identify: dspace, Identify, errors [], 0 sets, 0 formats, 0 records, "DSpace at My University", findings ["warning:local-base-url","warning:dspace-defaults","warning:dspace-localhost-ids"] | dspace-no-records: dspace, ListRecords, errors ["noRecordsMatch"], 0 sets, 0 formats, 0 records, findings ["warning:oai:noRecordsMatch"] | dspace-records: dspace, ListRecords, errors [], 0 sets, 0 formats, 3 records, findings [] | dspace-sets: dspace, ListSets, errors [], 2 sets, 0 formats, 0 records, findings [] | ojs-bad-prefix: ojs, ListRecords, errors ["cannotDisseminateFormat"], 0 sets, 0 formats, 0 records, findings ["error:oai:cannotDisseminateFormat"] | ojs-bad-verb: ojs, -, errors ["badVerb"], 0 sets, 0 formats, 0 records, findings ["error:oai:badVerb"] | ojs-formats: ojs, ListMetadataFormats, errors [], 0 sets, 4 formats, 0 records, findings [] | ojs-identify: ojs, Identify, errors [], 0 sets, 0 formats, 0 records, "Example Journal", findings [] | ojs-records: ojs, ListRecords, errors [], 0 sets, 0 formats, 3 records, findings [] | ojs-sets: ojs, ListSets, errors [], 2 sets, 0 formats, 0 records, findings [] 43. ok (tested on) the box reports its OS, kernel and the version of 9 package(s) | PRETTY_NAME="Ubuntu 24.04.5 LTS" | VIRT=none | KERNEL=6.8.0-151-generic | PKG ant 1.10.14-1 | PKG mariadb-server 1:10.11.14-0ubuntu0.24.04.1 | PKG nginx 1.24.0-2ubuntu7.21 | PKG openjdk-21-jdk-headless 21.0.13.1+2-1~24.04.1 | PKG php-fpm 2:8.3+93ubuntu2 | PKG postgresql-16 16.15-0ubuntu0.24.04.1 | dspace: DSpace version: 10.1 | solr: /opt/solr-9.11.0 | ojs: 3.5.0.6 ------------------------------------------------------------------------------ Commands and what they printed (6) ------------------------------------------------------------------------------ $ mkdir -p /tmp/oai $ curl -s -o /tmp/oai/dspace-no-records.xml 'http://localhost:8080/server/oai/request?verb=ListRecords&metadataPrefix=oai_dc' $ ls /tmp/oai/ | grep -c '^dspace-' 1 $ sudo -iu dspace /dspace/bin/dspace oai import 2>&1 | grep -E 'Total: |Purging' Total: 3 items Total: 0 items Purging cached OAI responses. $ mkdir -p /tmp/oai $ curl -s -o /tmp/oai/dspace-identify.xml 'http://localhost:8080/server/oai/request?verb=Identify' $ curl -s -o /tmp/oai/dspace-sets.xml 'http://localhost:8080/server/oai/request?verb=ListSets' $ curl -s -o /tmp/oai/dspace-formats.xml 'http://localhost:8080/server/oai/request?verb=ListMetadataFormats' $ curl -s -o /tmp/oai/dspace-records.xml 'http://localhost:8080/server/oai/request?verb=ListRecords&metadataPrefix=oai_dc' $ curl -s -o /tmp/oai/dspace-bad-prefix.xml 'http://localhost:8080/server/oai/request?verb=ListRecords&metadataPrefix=nosuchformat' $ curl -s -o /tmp/oai/dspace-bad-verb.xml 'http://localhost:8080/server/oai/request?verb=Nonsense' $ ls /tmp/oai/ | grep -c '^dspace-' 7 $ mkdir -p /tmp/oai $ curl -s -o /tmp/oai/ojs-identify.xml 'http://journal.example.com/index.php/example/oai?verb=Identify' $ curl -s -o /tmp/oai/ojs-sets.xml 'http://journal.example.com/index.php/example/oai?verb=ListSets' $ curl -s -o /tmp/oai/ojs-formats.xml 'http://journal.example.com/index.php/example/oai?verb=ListMetadataFormats' $ curl -s -o /tmp/oai/ojs-records.xml 'http://journal.example.com/index.php/example/oai?verb=ListRecords&metadataPrefix=oai_dc' $ curl -s -o /tmp/oai/ojs-bad-prefix.xml 'http://journal.example.com/index.php/example/oai?verb=ListRecords&metadataPrefix=nosuchformat' $ curl -s -o /tmp/oai/ojs-bad-verb.xml 'http://journal.example.com/index.php/example/oai?verb=Nonsense' $ ls /tmp/oai/ | grep -c '^ojs-' 6 $ cat > /tmp/oai-read.py <<'EOF' $ import json, sys, xml.etree.ElementTree as ET $ N = {'o': 'http://www.openarchives.org/OAI/2.0/', 'dc': 'http://purl.org/dc/elements/1.1/'} $ for f in sys.argv[1:]: $ r = ET.parse(f).getroot() $ t = lambda p: (r.findtext(p, namespaces=N) or None) $ recs = [{'id': x.findtext('o:header/o:identifier', namespaces=N), 'title': x.findtext('.//dc:title', namespaces=N)} for x in r.iterfind('.//o:ListRecords/o:record', N)] $ print(f.split('/')[-1][:-4], json.dumps({'errors': [e.get('code') for e in r.iterfind('o:error', N)], 'repositoryName': t('o:Identify/o:repositoryName'), 'baseURL': t('o:Identify/o:baseURL'), 'sets': [s.text for s in r.iterfind('.//o:ListSets/o:set/o:setSpec', N)], 'formats': [s.text for s in r.iterfind('.//o:metadataPrefix', N)], 'records': recs, 'resumption': (t('.//o:resumptionToken') or None)}, ensure_ascii=False)) $ EOF $ python3 /tmp/oai-read.py /tmp/oai/*.xml dspace-bad-prefix {"errors": ["cannotDisseminateFormat"], "repositoryName": null, "baseURL": null, "sets": [], "formats": [], "records": [], "resumption": null} dspace-bad-verb {"errors": ["badVerb"], "repositoryName": null, "baseURL": null, "sets": [], "formats": [], "records": [], "resumption": null} dspace-formats {"errors": [], "repositoryName": null, "baseURL": null, "sets": [], "formats": ["didl", "mods", "ore", "mets", "xoai", "datacite", "dim", "rioxx", "uketd_dc", "qdc", "oai_dc", "rdf", "marc", "etdms"], "records": [], "resumption": null} dspace-identify {"errors": [], "repositoryName": "DSpace at My University", "baseURL": "http://localhost:8080/server/oai/request", "sets": [], "formats": [], "records": [], "resumption": null} dspace-no-records {"errors": ["noRecordsMatch"], "repositoryName": null, "baseURL": null, "sets": [], "formats": [], "records": [], "resumption": null} dspace-records {"errors": [], "repositoryName": null, "baseURL": null, "sets": [], "formats": [], "records": [{"id": "oai:localhost:123456789/3", "title": "Soil moisture in dry seasons"}, {"id": "oai:localhost:123456789/5", "title": "Rainfall records 1990 to 2020"}, {"id": "oai:localhost:123456789/4", "title": "Groundwater recharge on terraced farms"}], "resumption": null} dspace-sets {"errors": [], "repositoryName": null, "baseURL": null, "sets": ["com_123456789_1", "col_123456789_2"], "formats": [], "records": [], "resumption": null} ojs-bad-prefix {"errors": ["cannotDisseminateFormat"], "repositoryName": null, "baseURL": null, "sets": [], "formats": [], "records": [], "resumption": null} ojs-bad-verb {"errors": ["badVerb"], "repositoryName": null, "baseURL": null, "sets": [], "formats": [], "records": [], "resumption": null} ojs-formats {"errors": [], "repositoryName": null, "baseURL": null, "sets": [], "formats": ["oai_marc", "oai_dc", "marcxml", "rfc1807"], "records": [], "resumption": null} ojs-identify {"errors": [], "repositoryName": "Example Journal", "baseURL": "http://journal.example.com/index.php/example/oai", "sets": [], "formats": [], "records": [], "resumption": null} ojs-records {"errors": [], "repositoryName": null, "baseURL": null, "sets": [], "formats": [], "records": [{"id": "oai:ojs.journal.example.com:article/1", "title": "Soil moisture in dry seasons"}, {"id": "oai:ojs.journal.example.com:article/2", "title": "Groundwater recharge on terraced farms"}, {"id": "oai:ojs.journal.example.com:article/3", "title": "Rainfall records 1990 to 2020"}], "resumption": null} ojs-sets {"errors": [], "repositoryName": null, "baseURL": null, "sets": ["example", "example:ART"], "formats": [], "records": [], "resumption": null} $ cat <<'EOF' $ dspace-bad-prefix: dspace, ListRecords, errors ["cannotDisseminateFormat"], 0 sets, 0 formats, 0 records, findings ["error:oai:cannotDisseminateFormat"] $ dspace-bad-verb: dspace, -, errors ["badVerb"], 0 sets, 0 formats, 0 records, findings ["error:oai:badVerb"] $ dspace-formats: dspace, ListMetadataFormats, errors [], 0 sets, 14 formats, 0 records, findings [] $ dspace-identify: dspace, Identify, errors [], 0 sets, 0 formats, 0 records, "DSpace at My University", findings ["warning:local-base-url","warning:dspace-defaults","warning:dspace-localhost-ids"] $ dspace-no-records: dspace, ListRecords, errors ["noRecordsMatch"], 0 sets, 0 formats, 0 records, findings ["warning:oai:noRecordsMatch"] $ dspace-records: dspace, ListRecords, errors [], 0 sets, 0 formats, 3 records, findings [] $ dspace-sets: dspace, ListSets, errors [], 2 sets, 0 formats, 0 records, findings [] $ ojs-bad-prefix: ojs, ListRecords, errors ["cannotDisseminateFormat"], 0 sets, 0 formats, 0 records, findings ["error:oai:cannotDisseminateFormat"] $ ojs-bad-verb: ojs, -, errors ["badVerb"], 0 sets, 0 formats, 0 records, findings ["error:oai:badVerb"] $ ojs-formats: ojs, ListMetadataFormats, errors [], 0 sets, 4 formats, 0 records, findings [] $ ojs-identify: ojs, Identify, errors [], 0 sets, 0 formats, 0 records, "Example Journal", findings [] $ ojs-records: ojs, ListRecords, errors [], 0 sets, 0 formats, 3 records, findings [] $ ojs-sets: ojs, ListSets, errors [], 2 sets, 0 formats, 0 records, findings [] $ EOF dspace-bad-prefix: dspace, ListRecords, errors ["cannotDisseminateFormat"], 0 sets, 0 formats, 0 records, findings ["error:oai:cannotDisseminateFormat"] dspace-bad-verb: dspace, -, errors ["badVerb"], 0 sets, 0 formats, 0 records, findings ["error:oai:badVerb"] dspace-formats: dspace, ListMetadataFormats, errors [], 0 sets, 14 formats, 0 records, findings [] dspace-identify: dspace, Identify, errors [], 0 sets, 0 formats, 0 records, "DSpace at My University", findings ["warning:local-base-url","warning:dspace-defaults","warning:dspace-localhost-ids"] dspace-no-records: dspace, ListRecords, errors ["noRecordsMatch"], 0 sets, 0 formats, 0 records, findings ["warning:oai:noRecordsMatch"] dspace-records: dspace, ListRecords, errors [], 0 sets, 0 formats, 3 records, findings [] dspace-sets: dspace, ListSets, errors [], 2 sets, 0 formats, 0 records, findings [] ojs-bad-prefix: ojs, ListRecords, errors ["cannotDisseminateFormat"], 0 sets, 0 formats, 0 records, findings ["error:oai:cannotDisseminateFormat"] ojs-bad-verb: ojs, -, errors ["badVerb"], 0 sets, 0 formats, 0 records, findings ["error:oai:badVerb"] ojs-formats: ojs, ListMetadataFormats, errors [], 0 sets, 4 formats, 0 records, findings [] ojs-identify: ojs, Identify, errors [], 0 sets, 0 formats, 0 records, "Example Journal", findings [] ojs-records: ojs, ListRecords, errors [], 0 sets, 0 formats, 3 records, findings [] ojs-sets: ojs, ListSets, errors [], 2 sets, 0 formats, 0 records, findings [] ------------------------------------------------------------------------------ The check's source (scripts/live/checks/tool-oai-pmh-viewer.mjs) As it ran. ------------------------------------------------------------------------------ /** * TOOL proof (plan07 §2): /tools/oai-pmh-viewer. Rented build server (LIVE_VPS + LIVE_VPS_NODOMAIN=1, 4 GB), per release. * Both repositories on one server, one after the other (4 GB holds one at a time): DSpace 10.1 as lesson 1 of the DSpace * course installs it (backend only, dspace-base.mjs) with three archived items (dspace-items.mjs); its answers are saved, * then DSpace and Solr are stopped and OJS 3.5 is installed as lesson 1 of the OJS course installs it, with a journal and * an issue of three articles (ojs-articles.mjs). All hidden; the steps start at the first saved answer. * * What it proves: the real OAI-PMH answers of both (Identify, ListSets, ListMetadataFormats, ListRecords, and the * protocol's own errors: noRecordsMatch before DSpace's `oai import`, cannotDisseminateFormat, badVerb), saved with curl * as the tool tells the reader to, are read by the tool's OWN parser (lib/tools/oai-pmh-viewer/parse.ts, through * scripts/tools/check-oai-pmh-viewer.ts --read) exactly as Python's own XML parser reads them on the server: the same * repository name and base URL, the same sets, formats, records (identifier and title) and error codes; and the tool * names the software that answered. The tool's refusals (HTML, broken XML, a cut-off answer …) run on this computer * (hidden, its result is a claim). */ import { execFileSync } from 'node:child_process' import { mkdtempSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { bareBox, reportBox } from '../lib.mjs' import { AS_DSPACE, basePackages as dsPackages, DSPACE, installDSpace } from '../dspace-base.mjs' import { addSampleItems } from '../dspace-items.mjs' import { basePackages as ojsPackages, createJournal, installOjs, OJS, SITE } from '../ojs-base.mjs' import { addSampleArticles } from '../ojs-articles.mjs' export const meta = { box: 'vps' } const RELEASE = process.env.LIVE_BOX_RELEASE || '24.04' const DS_DB = '[password]' const DS_ADMIN = '[password]' const ADMIN_EMAIL = 'admin@example.org' const OJS_DB = '[password]' const OJS_ADMIN = '[password]' const TOOL = 'scripts/tools/check-oai-pmh-viewer.ts' const D = 'http://localhost:8080/server/oai/request' const O = `http://${SITE}/index.php/example/oai` const REQUESTS = [ ['identify', 'verb=Identify'], ['sets', 'verb=ListSets'], ['formats', 'verb=ListMetadataFormats'], ['records', 'verb=ListRecords&metadataPrefix=oai_dc'], ['bad-prefix', 'verb=ListRecords&metadataPrefix=nosuchformat'], ['bad-verb', 'verb=Nonsense'], ] const save = (app, base, list) => ['mkdir -p /tmp/oai', ...list.map(([n, q]) => `curl -s -o /tmp/oai/${app}-${n}.xml '${base}?${q}'`), `ls /tmp/oai/ | grep -c '^${app}-'`].join('\n') // an independent reading on the server: Python's own XML parser, the same fields the tool reports const PY = `import json, sys, xml.etree.ElementTree as ET N = {'o': 'http://www.openarchives.org/OAI/2.0/', 'dc': 'http://purl.org/dc/elements/1.1/'} for f in sys.argv[1:]: r = ET.parse(f).getroot() t = lambda p: (r.findtext(p, namespaces=N) or None) recs = [{'id': x.findtext('o:header/o:identifier', namespaces=N), 'title': x.findtext('.//dc:title', namespaces=N)} for x in r.iterfind('.//o:ListRecords/o:record', N)] print(f.split('/')[-1][:-4], json.dumps({'errors': [e.get('code') for e in r.iterfind('o:error', N)], 'repositoryName': t('o:Identify/o:repositoryName'), 'baseURL': t('o:Identify/o:baseURL'), 'sets': [s.text for s in r.iterfind('.//o:ListSets/o:set/o:setSpec', N)], 'formats': [s.text for s in r.iterfind('.//o:metadataPrefix', N)], 'records': recs, 'resumption': (t('.//o:resumptionToken') or None)}, ensure_ascii=False))` const check = (ctx) => bareBox(ctx, async ({ sudoUser }) => { const sh = sudoUser() const { run, L } = sh const local = execFileSync('npx', ['tsx', TOOL], { encoding: 'utf8' }) ctx.check('the tool reads every OAI answer our DSpace and OJS guides captured, and refuses HTML, broken XML and cut-off answers with the reason (local check: all pass)', /0 failed/.test(local), local) // ── DSpace ──────────────────────────────────────────────────────────────────────────── installDSpace(ctx, sh, { release: RELEASE, dbPass: DS_DB, adminEmail: ADMIN_EMAIL, adminPass: DS_ADMIN, ui: false }) addSampleItems(ctx, L, { adminEmail: ADMIN_EMAIL }) const before = run(save('dspace', D, [['no-records', 'verb=ListRecords&metadataPrefix=oai_dc']]), { id: 'dspace-before-import' }) const imp = run(`${AS_DSPACE} /dspace/bin/dspace oai import 2>&1 | grep -E 'Total: |Purging'`, { id: 'dspace-oai-import', timeout: 600000 }) ctx.check('dspace oai import: "Total: 3 items"', /Total: 3 items/.test(imp.out), imp.out) const ds = run(save('dspace', D, REQUESTS), { id: 'dspace-answers' }) ctx.check('seven DSpace answers saved with curl (one before the import, six after)', /^1$/m.test(before.out) && /^7$/m.test(ds.out), `${before.out}\n${ds.out}`) L('sudo systemctl stop dspace solr') // ── OJS ─────────────────────────────────────────────────────────────────────────────── installOjs(ctx, sh, { dbPass: OJS_DB, adminPass: OJS_ADMIN }) createJournal(ctx, sh, { adminPass: OJS_ADMIN }) addSampleArticles(ctx, L) const oj = run(save('ojs', O, REQUESTS), { id: 'ojs-answers' }) ctx.check('six OJS answers saved with curl', /^6$/m.test(oj.out), oj.out) // ── Python's reading, on the server ─────────────────────────────────────────────────── const py = run(`cat > /tmp/oai-read.py <<'EOF'\n${PY}\nEOF\npython3 /tmp/oai-read.py /tmp/oai/*.xml`, { id: 'python-reads' }) const truth = Object.fromEntries(py.out.split('\n').map((l) => l.match(/^(\S+) (\{.*\})$/)).filter(Boolean).map((m) => [m[1], JSON.parse(m[2])])) ctx.check('Python reads all thirteen answers', Object.keys(truth).length === 13, py.out) // ── the tool's reading ──────────────────────────────────────────────────────────────── const dir = mkdtempSync(join(tmpdir(), 'oai-')) for (const n of Object.keys(truth)) writeFileSync(join(dir, `${n}.xml`), Buffer.from(L(`base64 -w0 /tmp/oai/${n}.xml`).trim(), 'base64')) const tool = Object.fromEntries( execFileSync('npx', ['tsx', TOOL, ...Object.keys(truth).map((n) => `--read=${join(dir, `${n}.xml`)}`)], { encoding: 'utf8' }) .trim() .split('\n') .map((l) => JSON.parse(l)) .map((r) => [r.file.split('/').pop().replace('.xml', ''), r]), ) const shown = run(`cat <<'EOF'\n${Object.entries(tool).map(([n, r]) => `${n}: ${r.app}, ${r.verb ?? '-'}, errors ${JSON.stringify(r.errors)}, ${r.sets.length} sets, ${r.formats.length} formats, ${r.records.length} records${r.repositoryName ? `, "${r.repositoryName}"` : ''}, findings ${JSON.stringify(r.findings)}`).join('\n')}\nEOF`, { id: 'tool-reads' }) const same = (n) => { const a = tool[n] const b = truth[n] return a && b && JSON.stringify(a.errors) === JSON.stringify(b.errors) && (a.repositoryName ?? null) === b.repositoryName && (a.baseURL ?? null) === b.baseURL && JSON.stringify(a.sets) === JSON.stringify(b.sets) && JSON.stringify(a.formats) === JSON.stringify(b.formats) && JSON.stringify(a.records.map((r) => [r.id, r.title ?? null])) === JSON.stringify(b.records.map((r) => [r.id, r.title])) && (a.resumption ?? null) === b.resumption } const names = Object.keys(truth) ctx.check('the tool reads each of the thirteen exactly as Python does: name, base URL, sets, formats, records (identifier and title), errors', names.every(same), `${shown.out}\npython:\n${py.out}\ndiffer: ${names.filter((n) => !same(n)).join(', ')}`) ctx.check('DSpace: three records, the community and collection sets, 14 formats, "DSpace at My University"', truth['dspace-records']?.records.length === 3 && truth['dspace-sets']?.sets.some((s) => s.startsWith('com_')) && truth['dspace-sets']?.sets.some((s) => s.startsWith('col_')) && truth['dspace-formats']?.formats.length === 14 && truth['dspace-identify']?.repositoryName === 'DSpace at My University', shown.out) ctx.check('OJS: three records, "Example Journal"', truth['ojs-records']?.records.length === 3 && truth['ojs-identify']?.repositoryName === 'Example Journal', shown.out) ctx.check('the protocol’s errors, read by the tool: noRecordsMatch (DSpace before the import), cannotDisseminateFormat, badVerb on both', tool['dspace-no-records']?.errors.join() === 'noRecordsMatch' && ['dspace', 'ojs'].every((a) => tool[`${a}-bad-prefix`]?.errors.join() === 'cannotDisseminateFormat' && tool[`${a}-bad-verb`]?.errors.join() === 'badVerb'), shown.out) ctx.check('the tool names the software that answered: DSpace for every DSpace answer, OJS for every OJS answer', names.every((n) => tool[n]?.app === n.split('-')[0]), shown.out) ctx.stepsDone() const ds2 = dsPackages(RELEASE) const oj2 = ojsPackages() reportBox( ctx, L, `A fresh Ubuntu ${RELEASE} server (4 GB of memory) with BOTH repositories installed by the check before the first step shown, one after the other: DSpace ${DSPACE} as lesson 1 of the DSpace course installs it (PostgreSQL, Solr, the backend as a service) with three archived items, its answers saved and then DSpace and Solr stopped; and OJS ${OJS.replace('-', '.')} as lesson 1 of the OJS course installs it, with one issue of three published articles (its site name ${SITE} points to the server through an /etc/hosts line). Reached over SSH as a sudo user.`, [...new Set([...ds2.packages, ...oj2.packages])], [...ds2.extra, ...oj2.extra], ) }) export default check