Skip to content

Service for zipping and downloading file bundles

Notifications You must be signed in to change notification settings

als-computing/zip-service

This branch is 416 commits behind SciCatProject/zip-service:develop.

Folders and files

NameName
Last commit message
Last commit date
Mar 17, 2021
Aug 25, 2021
Aug 25, 2021
Dec 9, 2020
Mar 5, 2020
Aug 26, 2021
Nov 27, 2018
Mar 25, 2021
Mar 25, 2021
Jun 4, 2021
Aug 31, 2020
Mar 15, 2021
Aug 26, 2021
Aug 27, 2021
Jul 30, 2021
Dec 3, 2020

Repository files navigation

Build Status DeepScan grade Known Vulnerabilities

Description

A service for zipping and downloading a group of files with a common directory on the same machine as the service is running. Authorization is based on the properties username:string groups:string[] in the JWT.

Install

docker-compose up or npm install && npm start

Usage

zip with download

Zip requests are sent as POST to /zip, which redirect to a download progress page. The post body should have the following format:

data: {
  "jwt": "token",
  "directory": "/path/to/files",
  "files": ["file1","file2","file3"]
}

/zip shows a page with a progress bar, resulting in a downloadable zip-file.

zip in place

While zip with download is a two step process (the file is zipped to a temporary directory on the server and then downloaded from the browser), another route, /zip_in_place exists which zips the payload in the same time as downloading.

local.config.json

Required in the root directory.

property key Data type Description
zipDir string directory where generated zip files are stored. Note that zip-files are deleted periodically
zipRetentionMillis number The number of milliseconds zip files are stored before they're deleted
sessionSecret string Used to sign session ids to detect client side tampering
facility string Different facilities have different ways of authorizing file access. This property is used to determine which mechanism to use
dramDirectory string Upload directory?
testData Object Optional. Default input values at the index route
testData.jwt string Optional. Default jwt
testData.directory string Optional. Default directory
testData.files string[] Optional. Default files.

Example data

{
  "zipDir": "/tmpZip",
  "zipRetentionMillis": 3600000,
  "jwtSecret": "secret123",
  "sessionSecret": "fj9832mnsaf3j9adsa",
  "facility": "maxiv",
  "dramDirectory": "uploads/",
  "testData": {
    "jwt": "<jwtToken>",
    "directory": "<testFileDirectory>",
    "files": [
      "<testFileName1>",
      "<testFileName2>",
      "<testFileName3>",
    ]
  }
}

About

Service for zipping and downloading file bundles

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages

  • TypeScript 58.6%
  • EJS 19.6%
  • Python 10.6%
  • CSS 6.2%
  • Dockerfile 3.0%
  • Makefile 2.0%