Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Latest commit

 

History

History
74 lines (57 loc) · 1.89 KB

README.md

File metadata and controls

74 lines (57 loc) · 1.89 KB

Torchbox Christmas Card Generator

Requirements

  • Python 3
  • S3 storage for videos required

Run locally

pip install -r requirements.txt
./run.py

Make sure images are rotated correctly, e.g. with

mogrify -alpha on -auto-orient *.jpg

FE assets

To compile Sass please.

yarn  # to install dependencies, run it once
yarn scss:watch

Todo

  • convert these TODOs to issues
  • add letters to images
  • edit images for consistent lighting and scale
  • name letter holding images with letter and number, e.g. a1.jpg
  • write generate(message) method which creates a video made from images for each letter in message
  • append audio file to video. video must be same duration as audio file (~20 seconds)
  • store the video on s3, e.g. happy-christmas-tomasz-heart-torchbox.mp4
  • build web UI for card creation
  • build web UI for card viewing / sharing
  • database for tracking created videos, views and shares

Deployment notes

Please set the following environmental variables

  • CACHE_FLUSH_PASSWORD - password used to flush already created videos.
  • S3_BUCKET, S3_ACCESS_KEY, S3_SECRET - S3 storage variables

Add dokku to your git remote:

git remote add dokku [email protected]:beatbox

Add port 80:

dokku proxy:ports-add beatbox http:80:5000
dokku config:set SECRET_KEY='your app secret key' S3_SECRET='' S3_ACCESS_KEY='' S3_BUCKET='' CACHE_FLUSH_PASSWORD=''

Add Nginx caching:

dokku plugin:install https://github.com/koalalorenzo/dokku-nginx-cache.git nginx-cache
dokku nginx-cache:enable beatbox

Flushing created videos

curl -X POST -d "password=your-password-here" https://beatbox.torchbox.com/flush-s3/
curl -X POST -d "password=your-password-here" https://beatbox.torchbox.com/flush-tmp/

Flushing the Nginx cache

dokku nginx-cache:clear