https://github.com/arkivverket/archive-uploader
A simple TUSD upload client.
https://github.com/arkivverket/archive-uploader
electron oslo-1 react tus tusd
Last synced: about 1 year ago
JSON representation
A simple TUSD upload client.
- Host: GitHub
- URL: https://github.com/arkivverket/archive-uploader
- Owner: arkivverket
- License: apache-2.0
- Created: 2018-11-29T20:43:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-19T01:21:55.000Z (almost 3 years ago)
- Last Synced: 2024-04-14T21:54:09.666Z (about 2 years ago)
- Topics: electron, oslo-1, react, tus, tusd
- Language: JavaScript
- Homepage:
- Size: 13.6 MB
- Stars: 3
- Watchers: 7
- Forks: 0
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Archive Digitisation Uploader
## Getting started
Clone the repo and run the following command:
```console
npm install
```
Next you can start the application in development mode using the following command:
```console
npm run start
```
> 💡 React components will automatically be reloaded when modified. However, if you make changes to the Electron main process files (`public/*`) then you'll have to restart the application.
## Build for production
If you want to build a production-ready version the application for macOS then use the following command:
```console
npm run build-mac
```
If you want to build a production-ready version the application for Windows then use the following command:
```console
npm run build-win
```
> ⚠️ Building signed versions should only be done on the dedicated code-signing machine.
## Build for test
If you want to build a production-ready unsigned version the application for macOS then use the following command:
```console
npm run build-mac-test
```
If you want to build a production-ready unsigned version the application for Windows then use the following command:
```console
npm run build-win-test
```
---
## Protocol
The application will be launched using the custom `dpldr` protocol. The link will consist of the protocol followed by a base64 enoded JSON payload:
```text
dpldr://eyJmb2xkZXJOYW1lIjoxNTQzOTI1NDM2LCJ1cGxvYWRVcmwiOiJodHRwOlwvXC9leGFtcGxlLm9yZ1wvdXBsb2FkIiwibWV0YSI6eyJ1c2VySWQiOjEyMywidW5pdElkIjoxMjMsImZvbGRlck5hbWUiOjE1NDM5MjU0MzZ9fQ==
```
> Note that the protocol is `dpldrdev` when the application run in development mode.
The payload must contain the following data. Note that the meta block is optional (in this example it is specific for the Archive Digitisation application):
```php
$data = [
'reference' => 'RA/EA-4070/Ki/L0009', // (required) Name or reference that lets the user identify of the upload
'uploadUrl' => 'http://example.org/upload', // (required) URL to the tusd endpoint
'uploadType' => 'directory', // (optional) Upload type. The allowed types are 'directory' and 'tar' (default: 'directory')
'meta' => [ // (optional) Metadata that is sent back to the tusd server when the upload starts
'userId' => 123, // Value must be signed
'unitId' => 123, // Value must be signed
'folderName' => 123, // Value must be signed
],
];
```
> The meta values must be signed by the Archive Digitisation application as they will be used to validate the upload using a TUS hook.