Michael J Wright Archive Documentation

Submit Worker Deployment Guide

Overview

The Submit Worker (submit.michaeljwright.com.au) is a Cloudflare Worker that provides a user-friendly interface for non-technical users to ingest content into the Michael J Wright Digital Archive.

Features:

Location: /workers/submit-ingest/


Project Structure

workers/
└── submit-ingest/
    ├── wrangler.toml          # Cloudflare Worker configuration
    └── src/
        └── index.js           # Worker logic + form UI

Setup & Deployment

Step 1: Install Dependencies

In the submit-ingest directory:

cd workers/submit-ingest
npm install wrangler@latest --save-dev

Step 2: Configure Wrangler

The wrangler.toml is already configured for:

Step 3: Set Secrets

Before deployment, configure the Fedora authentication secret:

# Navigate to submit-ingest directory
cd workers/submit-ingest

# Set the FEDORA_BASIC_AUTH secret (base64 encoded username:password)
npx wrangler secret put FEDORA_BASIC_AUTH
# When prompted, paste: Basic base64(curator1:password)
# Example: Basic Y3VyYXRvcjE6Q2hhbmdlVGhpcyBDdXJhdG9yUGFzc3dvcmQ3ODkh

To generate the base64 string locally:

# In PowerShell
$credentials = "curator1:ChangeThisCuratorPassword789!"
$bytes = [System.Text.Encoding]::UTF8.GetBytes($credentials)
$base64 = [Convert]::ToBase64String($bytes)
Write-Host "Basic $base64"

Then paste the output into the secret prompt.

Step 4: Deploy Worker

npx wrangler deploy

Expected output:

✓ Published mjw-submit-ingest@1.0.0
✓ Deployment successful!
- https://submit.michaeljwright.com.au/

Step 5: Configure Cloudflare Zero Trust (Optional)

To protect the submit interface with SSO:

  1. Go to Cloudflare Zero Trust dashboard
  2. Navigate to Access → Applications
  3. Create new application:
    • Domain: submit.michaeljwright.com.au
    • Type: Public hostname
    • Policy: Allow authenticated users (your preferred IdP: Google, GitHub, etc.)
  4. Save and apply

The worker will automatically respect Cloudflare Access headers.


Usage Flow

For Non-Technical Users

  1. Navigate to https://submit.michaeljwright.com.au/
  2. Step 1: Select content type (Painting, Photograph, Poem, Notebook), series name, and year
  3. Step 2: Upload files via drag-drop or file browser (max 100 files, 50MB each)
  4. Step 3: Review auto-generated catalog IDs (MJW-P-2024-001, MJW-P-2024-002, etc.)
  5. Step 4: Enter bulk metadata (description, keywords, medium, dimensions, condition)
  6. Step 5: Add unique title for each file; optionally override bulk metadata per-file
  7. Step 6: Review and submit

For Curators

Files are ingested directly to Fedora at:

/fcrepo/rest/{type}s/{catalog-id}/
├── Metadata (Dublin Core JSON-LD)
└── Binary file attachment

All metadata is Dublin Core compliant and immediately queryable via Fedora REST API.


API Endpoints

GET /

Returns the submission form HTML interface.

curl https://submit.michaeljwright.com.au/

POST /api/submit

Ingests files and metadata to Fedora.

Request:

Response:

{
  "ingested": 40,
  "total": 40,
  "errors": null
}

Fedora Integration

The worker creates Fedora containers with the following Dublin Core mapping:

Form Field Dublin Core Note
Title dc:title Auto: {CatalogID}: {CustomTitle}
Creator dc:creator Always "Michael J Wright"
Content Type dc:type Painting, Photograph, Poem, Notebook
Year dc:date ISO 8601 format
Format/Medium dc:format User-entered (e.g., "Oil on canvas")
Keywords dc:subject Comma-separated, split into array
Description dc:description User-entered
Catalog ID dc:identifier Auto-generated MJW-{TYPE}-{YEAR}-{NNN}
Rights dc:rights Static: "Copyright © Michael J Wright. All rights reserved."
Series dcterms:series Custom extension
Dimensions mjw:dimensions Custom extension
Condition mjw:condition Custom extension (Excellent, Very good, Good, Fair, Poor)

File Validation

Accepted File Types:

Client-side validation:

Server-side validation:


Monitoring & Troubleshooting

Check Deployment Status

npx wrangler deployments list

View Live Logs

npx wrangler tail

Test File Upload Locally

npx wrangler dev
# Opens http://localhost:8787/

Common Issues

Issue: "Fedora authentication not configured"

Issue: Files uploaded but not appearing in Fedora

Issue: "Maximum 100 files allowed" error


Updating the Worker

To make changes to the submission form or ingestion logic:

  1. Edit /workers/submit-ingest/src/index.js
  2. Test locally: npx wrangler dev
  3. Deploy: npx wrangler deploy

Integration with Pages

The homepage at https://data.michaeljwright.com.au/ includes:

Users can seamlessly navigate between documentation, archive browse, and content submission.


Next Steps


Questions?

Refer to: