This is a generic Node.js implementation of the Backblaze Custom Action for Frame.io.
We specifically tested the container as a Rising Cloud web service, but it should run on any container platform. This implementation forks child processes as workers; a separate Rising Cloud-specific implementation uses Rising Cloud tasks.
We leverage the container platform to handle TLS termination. If you want to expose the container directly we strongly recommend you implement TLS within the app code directly.
- Sign up for a Backblaze account if you do not already have one.
- Sign in to the web console.
- Click Buckets under B2 Cloud Storage in the navigation menu on the left, then click Create a Bucket.
- Enter a bucket name; leave the rest of the settings with their defaults. Note that bucket names must be globally unique. It may take a couple of tries to find an unused bucket name.
- Click Create a Bucket.
- Still in the Backblaze web console, click App Keys under Account in the left nav menu, then click Add a New Application Key.
- Supply a key name (key names need not be globally unique).
- Click the dropdown by Allow access to Bucket(s): and select the bucket you created in the previous step. Leave the rest of the settings with their defaults.
- Click Create New Key.
- IMPORTANT: make a note of the key ID and application key before leaving this page. You will not be able to go back and retrieve the application key later!
Login to the Frame.io Developer Site and create a custom action (Developer Tools > Custom Actions > Create a Custom Action):
- NAME: Backblaze B2
- DESCRIPTION: Import or export assets and projects to Backblaze B2
- EVENT: import-export
- URL: Set this to your container's endpoint
- TEAM: Select your team
- ACCESS: Enable if you wish collaborators to have access to the custom action.
Still in the Frame.io Developer Site, create a token (Developer Tools > Tokens > Create a Token). Provide a suitable token description, enable the Create and Read scopes under Assets, and click Submit.
You need to set the following environment variables in the container environment. The easiest way to do this is to create a .env
file.
FRAMEIO_TOKEN
= The Frame.io developer token you obtain from https://developer.frame.io/app/tokensFRAMEIO_SECRET
= the Frame.io Custom Action secret you obtain from https://developer.frame.io/app/custom-actionsBUCKET_ENDPOINT
= Your Backblaze B2 S3-compatible endpoint, in the formhttps://s3.REGION.backblazeb2.com
BUCKET_NAME
= Your Backblaze B2 bucket nameACCESS_KEY
= Your Backblaze B2 access key - it is strongly recommended this is unique for this appSECRET_KEY
= Your Backblaze B2 secret key - it is strongly recommended this is unique for this appUPLOAD_PATH
= Path in Backblaze B2 for exports, for examplefio_exports
DOWNLOAD_PATH
= Folder in Frame.io for imports, for exampleb2_imports
To build the Docker image:
$ docker build .
Docker responds with an image id. Start a container in daemon mode, listening on port 8888, with the .env
file you created and the image ID:
$ docker run -d -p 8888:8888 --env-file .env IMAGE_ID
Follow the instructions in the test-client directory.