Skip to content

About

Desktop app (planned) for uploading documents and metadata to DSpace 7+ repositories via the REST API; with example scripts

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

dspace-upload-app

DSpace Upload: a small desktop app (Tauri 2 + Svelte) for institutions digitising large collections over variable-quality connections. Point it at a folder, and it uploads every file in it to a DSpace 7+ collection through the REST API. Started for the Université du Burundi's repository (DSpace 10), during Africa Evidence Week 2026, as part of Openscholar's work with African institutional repositories.

Rationale

Digitisation can produce files faster than it produces metadata. The usual routes into DSpace tend to ask for both at once, which, in our experience, can slow the work down:

  • The repository may be close to the scanner. At a university, the computer doing the digitisation and the DSpace server are often on the same campus network. Putting files into DSpace can then be quick, while moving them elsewhere (shared drives, cloud folders, USB sticks) may be slower or less safe.
  • DSpace's bulk import can be hard to use in practice. DSpace can import many items at once, but only from a prepared package in its "Simple Archive Format": a ZIP with one folder per item, each holding the files, a contents list and a dublin_core.xml metadata file. Importing through the web interface also depends on the server being set up for it (a working directory for imports, and the import process enabled for the right users). As bulk import is used fairly rarely, staff may not be aware of it, and it may be switched off, as it currently is on the Université du Burundi's repository.
  • Waiting for metadata may keep files on personal drives. If items can only go into the repository once their metadata is complete, scans may stay on individual computers, or be passed around on drives, while someone catalogues them. That can make files easier to lose and working together harder.
  • Many small uploads may be safer than one large one. DSpace receives each file in a single request and, as far as we can tell, cannot resume an upload that breaks off part-way (downloads can resume; uploads start again from the beginning). A bulk import of 100 scans of 5 MB each, as one 500 MB ZIP, would have to arrive in one piece: a dropped connection near the end means sending all of it again, and by default DSpace accepts at most 512 MB per request. Uploading the files one by one means a break costs at most the file in progress, which the app retries; files already uploaded are kept and skipped on the next run. Scans are usually compressed already, so a ZIP would not make the transfer much smaller.

The approach we suggest is therefore to upload first and describe later. Each file goes into the repository straight away, with minimal metadata (the file name and the file's modification time, and for PDFs the year and faculty from the document properties); material that should not be public yet can go into a private collection. Once the files are in DSpace, others with access can work on them, and metadata can be extracted or added from the repository copy, without files having to be passed around on drives.

So far, the connection seems good enough for this. On 2 December 2026 we measured downloads from the Université du Burundi's repository, from outside Burundi, at about 5 MB/s for large files, with about 2 seconds of overhead per request (a 4.6 MB thesis took 4–5 seconds). On 3 December, the university's digitisation team uploaded with this app at about one file every 20–30 seconds, and we were able to retrieve the first 31 files (about 75 MB) for metadata extraction without difficulty. These are single measurements, and speeds will vary.

Why Tauri: the app is built with Tauri rather than Electron, to help keep the download small. Tauri uses the web view that is already part of the operating system (WebView2 on Windows 10 and 11) instead of shipping its own browser, so the Windows installer is about 2.5 MB (similar in size to a single scanned PDF), where an Electron app typically needs 100 MB or more. This can matter where connections are slow or expensive, and it helps keep updates quick.

What it does

  • The interface is in English, French, Spanish, Portuguese, Swahili and Arabic (language menu at the top right; Arabic is shown right to left). It starts in the computer's language if it is one of these, and remembers the choice.
  • The window has three tabs: Login (with the interface language), Upload and Crossref DOI; the last two ask you to log in first. Log in with email and password (the address must start with https://, so the password is never sent unencrypted). The server, email, collection and last folder are remembered; so are the DSpace and Crossref passwords, unless Remember the password on this computer is unticked (the Crossref password is then kept only until the app closes). The login and the Crossref settings are kept in prefs.json in the app's settings folder (on Windows the local, not roaming, AppData folder), created readable only by the person's own account and written all at once (passwords in plain text, so untick the box on a shared computer). A row at the top of the login form, Fill in default settings, has two buttons: Université du Burundi (the address, and the university's DOI suffix start and institution name where these are empty; it clears the demo login) and Use demo server (demo.dspace.org with its public admin account, for trying the app with dummy files). If other default settings would be useful, for example for your own repository, let us know by opening an issue.
  • Choose one of the collections the account can submit to, and a folder.
  • Every file in the folder (and its subfolders) becomes one item; hidden and system files (Thumbs.db, desktop.ini, Office ~$ lock files, shortcuts) are skipped:
    • dc.title = the file name without its extension;
    • dc.description = File last modified: <the file's modification time> and, on the next line, Source file: <its path within the folder>;
    • for a PDF, the metadata the scanning team typed into it (document properties) is kept: the Subject (the year) and the Keywords (the faculty). A year in the Subject becomes dc.date.issued (for an academic year such as 2014-2015, the later year); the Keywords become dc.subject; and both are added, as written, to dc.description (Embedded PDF metadata: Subject: …; Keywords: …), so nothing is lost if a value does not fit a field. This matters because DSpace adds a citation cover page to PDFs on download, which rewrites the file and drops these properties.
  • Two routes, chosen automatically:
    • site administrators: items are created directly (POST /core/items, ORIGINAL bundle, bitstream), bypassing the submission form, so nothing beyond the fields above is set;
    • everyone else (submit or collection-admin rights): when the server refuses the first direct upload (403), the app uses DSpace's normal submission route (draft, metadata, file, licence, submit). Fields are set only where the collection's form has them. If the form requires (marks as mandatory) a date issued or a type that the file does not give, it gets the placeholder 2211 or Other, to be corrected later (search for 2211). In a collection without a review step the items are archived at once.
  • The collection's default access rules apply, so a private collection gives private items.
  • Before uploading, the app reads what is already in the collection and finds each file's item by the Source file line (or dc.identifier.other), so two files with the same name in different subfolders are two items. Items made before the Source file line existed are matched by title, but only if this app made them and they hold a file of the same size (or no file). A file whose item is there with that file is skipped; an item that is there without its file (an earlier upload broke off) gets the file added, keeping its handle; a file that has changed since it was uploaded (its item holds a file of another size) is reported and not uploaded again: replacing a file in the repository is left to a person. Records not made by this app are never changed.
  • Failures: temporary errors (network, timeouts, server errors 5xx, 408, 429) are retried after 15 s, 1 min and 3 min; permanent ones (e.g. 403, 413 file too large, 422) are not. Files that still fail get a second pass at the end of the run. A failed upload deletes its half-made item (direct route) or draft (submission route); if the connection is too bad even for that, the item is given its file on the next attempt and the draft is deleted later, and an item whose creation reply was lost is looked for before trying again. There is no overall time limit on sending a file (a connection that sends or receives nothing for 5 minutes is given up), and Stop interrupts a file being sent. Running the folder again retries whatever is still missing.
  • A ledger, .dspace-upload-ledger.jsonl in the folder (which must be writable: the run does not start otherwise), gets one line per upload attempt, including files skipped as already there and failures with their error message. Each line has the file's path, size and modification time, the outcome, and when uploaded the handle and checksum; for PDFs the embedded Subject and Keywords and the year taken from them (embedded), plus any field the collection's form had no place for (not_set). Stopping and starting again continues where it left off.
  • Telemetry (opt-in): on first start the app asks whether it may send usage data; nothing is sent unless the person agrees. The box Enable telemetry at the bottom of the window changes the choice at any time. While it is on, the app sends usage events to the developers' PostHog project: logins (server and email, never the password), each file's path within the folder, title, PDF properties and upload success or failure (with the error message), a summary of each run, which includes the folder's name (not its full path), and the counts of each Check and Register run. Never the files themselves. Details in TELEMETRY.md.
  • An expired login token (about 30 minutes) is renewed automatically during long runs.

DOIs

The Crossref DOI tab (after logging in on the Login tab) registers Crossref DOIs for items that have none, through the DSpace REST API (no change to the DSpace server is needed).

  • Crossref settings: test system (test.crossref.org: nothing is published, DSpace is not changed) or live system; DOI prefix; the start of the suffix (default ubgsm); Crossref username (a role, or email/role for a personal account) and password; depositor name and email; and the institution named in thesis records. DOIs have the form 10.PREFIX/ubgsm.<handle number>: handle 123456789/1095 gets 10.PREFIX/ubgsm.1095, so registering an item again updates its record and never makes a second DOI.
  • Check (changes nothing) goes through a collection or the whole repository, optionally articles or theses only. For each item without a DOI in DSpace it searches Crossref by title and first author, and reports found (very likely the same work; the DOI and Crossref's metadata, such as the journal, volume and pages, are shown), possibly found (to check by hand), or not found. For theses it also says whether the metadata is complete. Items uploaded by this app and not catalogued yet (no author; the title is the file name) are listed as such and not looked up; untyped items that do not look like theses are listed as not recognisable as a thesis.
  • Register gives DOIs to theses (dc.type Thesis, Thèse, Mémoire or Dissertation; an item without dc.type is shown as thesis? in Check but never registered) that are public (not private, withdrawn or still in review), have a title, at least one author whose value is a person's name (not a note such as "Sous la direction de : …", which belongs in dc.contributor.advisor), a real year in dc.date.issued (not the 2211 placeholder), a handle and a URI, and that Crossref does not already seem to know. At most the number given in Theses to register, at most per run (Check has no limit: it only reports). The window passes the chosen system (test or live) with the request, and the app refuses to run if it differs from the saved settings; the batch names and the ledger record which system was used. They are sent to Crossref in batches of 20 as dissertation records (schema 5.3.1; authors, title, abstract, approval date, institution with dc.publisher as department, and the handle URL as the landing page), and the app waits up to 30 minutes for each batch's result. Stop sends nothing more (a batch already sent cannot be called back; theses not sent are listed). Crossref's "Warning" counts as registered, with its remark shown; if Crossref refuses a whole batch (e.g. a schema error), its message is shown on every row. On the live system, a DOI that Crossref accepts is added to the item as dc.identifier.doi (https://doi.org/…); this needs an account that may edit the items. A batch Crossref has not finished is reported as pending; registering again later is safe. On the live system, Register first asks doi.org whether the item's DOI is already registered (say, because an earlier run was stopped or closed while waiting for Crossref); if it is and points to this item's page, the DOI is added to the item in DSpace and not sent again; if it points to another page (two items would get the same DOI), nothing is sent or changed and the item is reported as a conflict. An item that already has a DOI under the prefix in the settings is checked at doi.org: Check reports one that is not registered, and Register registers it with that DOI (a thesis with complete metadata; DSpace is not changed). DOIs under other prefixes are left alone.
  • Records: every run writes a CSV report (Save report); registrations go into a ledger (doi/ledger.jsonl), and each batch sent to Crossref and its result are kept as XML (doi-batches/), all in the app's data folder.
  • Not yet: articles, books and other types are checked but not registered. A repository copy of an article that already has a publisher DOI must not get a second one, and articles without one need journal details that DSpace often lacks.

Updates

From version 0.2.0 the app updates itself: when it starts, it checks the latest GitHub release and, if there is a newer version, shows Update now (in the chosen language). Check for updates, next to the version number at the bottom of the window, does the same at any time. One click downloads the signed installer, installs it and restarts the app (not during an upload). Version 0.1.0 has no updater, so install 0.2.0 or later by hand once.

To publish a release: scripts/release.sh X.Y.Z. It sets the version in package.json, src-tauri/tauri.conf.json and src-tauri/Cargo.toml, commits, tags vX.Y.Z and pushes; GitHub Actions builds and signs the installers and publishes the release with latest.json. Updates are signed: the public key is in tauri.conf.json, the private key and its password are the repository secrets TAURI_SIGNING_PRIVATE_KEY and TAURI_SIGNING_PRIVATE_KEY_PASSWORD (keep a copy of both outside GitHub: without them, installed apps can no longer be updated).

Download and build

Download: the installers are on the release page, https://github.com/OpenDevEd/dspace-upload-app/releases/latest (no GitHub account needed): for Windows the -setup.exe (or the .msi), for Linux the .AppImage (or .deb / .rpm). The installers are not yet code-signed, so Windows may warn about an unknown publisher: choose More info, then Run anyway.

Releases are built by GitHub Actions from a version tag (scripts/release.sh, see Updates): the release stays a draft until Windows and Linux are both built, then it is published. Every push to main is also built, with the installers attached to the run as artifacts (for testing; these need a GitHub login).

To build locally: Node.js, Rust (1.92 or later) and the Tauri prerequisites, then

npm ci
npm run tauri dev      # run in development
npm run tauri build    # installers in src-tauri/target/release/bundle/

A local build includes telemetry only if local/telemetry-webhook.conf (gitignored) holds the PostHog token and host; releases built by GitHub Actions take them from the repository secrets POSTHOG_TOKEN and POSTHOG_HOST. Without them the app sends nothing. See TELEMETRY.md.

Examples in src-tauri/examples/ exercise the app's code without the window (run them in src-tauri/):

  • cargo run --example upload_demo -- BASE USER PASSWORD COLLECTION_UUID FILE: upload one file, including its PDF properties;
  • cargo run --example repair_demo -- BASE USER PASSWORD ITEM_UUID FILE: add a file to an item that lacks it;
  • cargo run --example check -- BASE USER PASSWORD_FILE: log in and list the collections the account administers (read-only);
  • cargo run --example telemetry_demo: send one test event of each kind to PostHog and print the answers;
  • cargo run --example crossref_check -- BASE_SERVER_URL [all|articles|theses] [N]: what the Crossref DOI tab's Check reports, for the first N items of a public repository, without logging in;
  • cargo run --example add_doi_demo -- BASE USER PASSWORD ITEM_UUID DOI: add a DOI to an item, as Register does on the live system.

Python examples

examples/dspace-api.py logs in with a password and reports what the account may do (read-only). examples/dspace-upload.py is the prototype of the app (same ledger format), with --mode admin (default) or --mode submit (through the submission form).

examples/dspace-api.py check        # who am I, groups, site rights, collections I can submit to or administer
examples/dspace-api.py get PATH     # GET one API path (e.g. /core/collections) and print the JSON
examples/dspace-api.py --creds FILE check

Credentials go in .credentials.json (gitignored, mode 600):

{"base": "https://your-repository.example.org/server/api",
 "user": "user@example.org",
 "password_file": "/path/to/password.txt"}

password_file is relative to the credentials file, or absolute; "password": "..." works too.

DSpace REST login, in short

  1. GET /server/api/authn/status returns a CSRF token (DSPACE-XSRF-TOKEN header plus cookie).
  2. POST /server/api/authn/login with form fields user, password and header X-XSRF-TOKEN returns Authorization: Bearer <JWT> (about 30 minutes).
  3. Send the bearer token on every request, and X-XSRF-TOKEN on writes; a refreshed token in any response replaces the old one.

Testing against the public demo

https://demo.dspace.org (DSpace 10.x) and https://sandbox.dspace.org (11.x) are public and reset regularly. Their published accounts use the password dspace: dspacedemo+submit@gmail.com (submitter) and dspacedemo+admin@gmail.com (administrator). Use a separate credentials file, e.g. .credentials-demo.json with "base": "https://demo.dspace.org/server/api".

Licence

Copyright © 2026 Open Development & Education. Licensed under the GNU Affero General Public License, version 3 or (at your option) any later version (AGPL-3.0-or-later); see LICENSE.

About

Desktop app (planned) for uploading documents and metadata to DSpace 7+ repositories via the REST API; with example scripts

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages