Inspiration

When I first started using Butler in 2016 it was absolutely mind blowing. I had started doing some automation of Trello using Google Apps Script from the Little Blue Monkey "Pimp Your Trello Cards" script, but Butler was totally next level.

In February 2018 they told me I wasn't allowed to use it as a consulting platform anymore, after I had spent a year building complex business systems for my clients using the platform, so I built Trellinator, an open source framework for automating Trello (and other things) using Google Apps Script. I then ported all 1,800 Butler commands that I had written for my clients, over to Trellinator.

Even though some people other than me and my clients use Trellinator, the barrier to entry setting it up as a Google Apps Script is so high that most people fail to get started.

I had the idea to build a "hosted Trellinator", and BenkoBot was born!

What it does

BenkoBot is a hosted and secure environment for executing Trellinator code to quickly and easily create Trello API automations.

How we built it

The biggest challenge was getting a secure way to execute user submitted code. I followed an example from a Medium post on how to use docker combined with gvisor and the Node.js "vm2" package to create a secure sandbox that is capable of executing code, and also allowing external access to other APIs without exposing the underlying file system.

We used beanstalkd as the work queue to handle the long running process of executing the code in a docker container on a GCP cloud instance, and stuck a really basic "quick n dirty" PHP frontend on it to test it out.

We actually have a much nicer React interface on the way, but couldn't get it running in time for the submission deadline. It might be online by the time you test it out though ;)

Challenges we ran into

Getting the secure code execution under docker working really smoothly and allowing easy use of external APIs while still keeping the "sandbox" secure took up a lot of time. The challenge then was racing to build a nicer looking interface, but we figured it's better to have something that works and proves the concept, and looks terrible, rather than something that looks nice but doesn't run!

Accomplishments that we're proud of

The code execution backend is super robust and secure. It sits on a separate cloud instance that's not web accessible, and communicates with the frontend via a beanstalkd queue, so the user can have long running code executing and the interface can remain responsive. This will also allow easy extension into handling notifications and scheduled jobs.

What we learned

How to do secure code execution using Node, docker and gvisor! Also that CloudRun is great for hosting docker containers but that it doesn't work sometimes for weird reasons (part of the reason why our slicker looking interface isn't online!)

What's next for BenkoBot

Well, as mentioned, getting a better interface online.

Once we have that, we will be adding in all the Trellinator features:

  • Handling notifications (when this happens, do this)
  • Scheduled executions
  • Installing functionality on individual boards, groups of boards or globally
  • Account management/multiple credential handling (for example so consultants can easily write code for multiple clients)
  • Bitbucket integration so that all your code is version controlled, and also so you can build and test in your own environment then deploy with a post commit hook to BenkoBot

Built With

Share this project:

Updates