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:
- Multi-file upload (up to 100 files, 50MB each)
- Automatic catalog ID generation (MJW-{TYPE}-{YEAR}-{NNN})
- Bulk metadata for entire submission (applies to all files)
- Per-file title and metadata overrides
- Dublin Core metadata mapping
- Direct Fedora 6 integration
- Cloudflare Zero Trust SSO support (managed via Cloudflare dashboard)
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:
- Route:
submit.michaeljwright.com.au/* - Zone:
michaeljwright.com.au - Environment variables for Fedora URL and file size limits
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:
- Go to Cloudflare Zero Trust dashboard
- Navigate to Access → Applications
- Create new application:
- Domain:
submit.michaeljwright.com.au - Type: Public hostname
- Policy: Allow authenticated users (your preferred IdP: Google, GitHub, etc.)
- Domain:
- Save and apply
The worker will automatically respect Cloudflare Access headers.
Usage Flow
For Non-Technical Users
- Navigate to
https://submit.michaeljwright.com.au/ - Step 1: Select content type (Painting, Photograph, Poem, Notebook), series name, and year
- Step 2: Upload files via drag-drop or file browser (max 100 files, 50MB each)
- Step 3: Review auto-generated catalog IDs (MJW-P-2024-001, MJW-P-2024-002, etc.)
- Step 4: Enter bulk metadata (description, keywords, medium, dimensions, condition)
- Step 5: Add unique title for each file; optionally override bulk metadata per-file
- 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:
- Content-Type:
multipart/form-data - Fields:
files(multiple): File objects to uploadcontentType: P, PH, PM, or NBcreationYear: 4-digit yearseriesName: Collection/series name (optional)startingNumber: Sequential number start (001-999)bulkDescription,bulkKeywords,bulkMedium,bulkDimensions,bulkConditionindividualMetadata: JSON object with per-file overrides
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:
- Images:
.jpg,.jpeg,.png,.gif,.tiff,.webp - Documents:
.pdf,.doc,.docx,.txt - Any type up to 50MB
Client-side validation:
- Max 100 files per submission
- Max 50MB per file
- Prevents duplicate file names in single submission
Server-side validation:
- Fedora authentication check
- Catalog ID conflict detection (future)
- MIME type 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"
- Fix: Ensure
FEDORA_BASIC_AUTHsecret is set (npx wrangler secret put FEDORA_BASIC_AUTH)
Issue: Files uploaded but not appearing in Fedora
- Fix: Check Fedora logs and verify catalog ID matches path structure
- Ensure Cloudflare Tunnel is connected and healthy
Issue: "Maximum 100 files allowed" error
- Fix: Submit in batches of 100 or fewer
Updating the Worker
To make changes to the submission form or ingestion logic:
- Edit
/workers/submit-ingest/src/index.js - Test locally:
npx wrangler dev - Deploy:
npx wrangler deploy
Integration with Pages
The homepage at https://data.michaeljwright.com.au/ includes:
- CTA Button: "Submit Content" →
https://submit.michaeljwright.com.au/ - Card: "Submit Content" with description
- Back Link: Submit form includes link back to main site
Users can seamlessly navigate between documentation, archive browse, and content submission.
Next Steps
- Deploy worker with
npx wrangler deploy - Configure Fedora BASIC_AUTH secret
- Set up Cloudflare Zero Trust Access policy (if desired)
- Test end-to-end: upload test files, verify in Fedora
- Document for non-technical users
- Monitor initial submissions via Wrangler logs
Questions?
Refer to:
- Worker code:
/workers/submit-ingest/src/index.js - Main archive docs:
/docs/ - Fedora API docs: https://wiki.lyrasis.org/display/FEDORA6x/