Skip to content
/ fireball Public
forked from fractos/fireball

PDF generation from a playbook.

Notifications You must be signed in to change notification settings

dlcs/fireball

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fireball

Fireball is a basic Flask app that takes a JSON payload and uses this to generate a PDF, which is uploaded to S3.

Running

# build docker image
docker build -t fireball:local .

# run listening to localhost:5001
docker run -it --rm -p 5001:80 --name fireball fireball:local

Environment Variables

The docker container accepts the following environment variables:

  • DEBUG - if True then debug logging is enabled, else Info logging is enabled. Default: TRUE.
  • FIREBALL_WORK_FOLDER - Working URL for storing working files. Default: /tmp.
  • FIREBALL_DOWNLOAD_POOL_SIZE - The number of workers to use for downloading resources. Default: 50.

Sample Payload

{
    "title": "Demo",
    "method": "s3",
    "output": "s3://dlcs-pdf/2/1/pdf-item/abcd1/0/result.pdf",
    "pages": [
        {
            "type": "pdf",
            "method": "download",
            "input": "https://wellcomelibrary.org/service/pdf-cover/abcd1"
        },
        {
            "type": "jpg",
            "method": "s3",
            "input": "s3://dlcs-thumbs/2/1/xyz1/low.jpg"
        },
        {
            "type": "redacted"
        }
    ],
    "customTypes": {
        "redacted": {
            "message": "This page has been removed."
        },
        "missing": {
            "message": "This page is missing."
        }
    }
}

About

PDF generation from a playbook.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Python 95.7%
  • Dockerfile 3.1%
  • Shell 1.2%