Boundary Labs Blog

An eclectic mix of product and industry news, software development stuff, and technical topics of interest.

August 13, 2019

One of the interesting things about Tesla cars is that they are packed full of cameras (8 of them on the Model 3). Tesla allows you to plug in a USB drive and click a button on the touch screen to save videos from the forward and two side cameras when an event of interest takes place. Earlier this year, Tesla also introduced a feature called Sentry Mode which uses the car's cameras to record activity when someone does something like lean on your car (or something more nefarious).

Focus started as a way to scratch my own itch, so to speak. What I'm ultimately interested in is playing with image recognition techniques and automatic detection of activity. I think this would make the Sentry Mode concept much easier to deal with on a regular basis - I mean, who wants to sit and skim through 60 second videos to figure out why the car was triggered?

This first release handles combining the videos from the three available cameras and merging them into one. The calendar functionality (which I shamelessly stole from Memoir) makes it much easier to find videos than just a big list view, and I find the flag feature works great for "interesting" videos. I think it's the most capable app of it's kind, and a solid first release. Having never actually done any video work prior to a month ago, there was a learning curve in getting this going, and so there's a lot of room for new features and improvements. We'll see where it goes!


July 26, 2019

First off, a back story. You should jump ahead if you just want instructions on how to handle hosting Vapor on a Mac.

One of the things I've learned about myself over the years is that I need variety in my work. Every two or three years I look around and see what I could be doing differently to increase productivity and keep software development interesting.

I've had the opportunity over the past 15 years to do a lot of web development work for a variety of clients. Several years ago, after a particularly demanding project, it was clear to me that I needed to find something better on the server side (I was mostly doing PHP at the time). That's when I found Laravel. Laravel felt comfortable from the start, and I've been using it for the past 5 years. I've used it to power everything from simple sites with a few forms to larger sites that process several hundred orders per day. In short, if you program in PHP, you should check it out.

Last year, when I started working on our new website - I again had this feeling that I needed something different. Maybe it was the fact that I'd been using Swift a lot, and going back to PHP just felt... wrong. So, I set about searching to see if there was something that would allow me to stay in Swift-land, something again to make web development fun. I found Vapor.

What's great about Vapor? Much like Laravel, it's just comfortable. I found out later that Laravel was somewhat of an inspiration for Vapor, so that probably helped. The fact that it's Swift means it is instantly familiar, and I feel like I'm context switching less. True, I still need to do front end work in a JavaScript framework, but not continuously moving between PHP and Swift has eliminated a lot of the friction to just getting things done.

This brings me to the other really cool thing about Swift: you can easily leverage existing macOS frameworks to build your backend. For me, this means I can utilize libraries like Core Image or Foundation, opening up a huge set of frameworks that I'm already familiar with. This also exposes what I consider a hole in the ecosystem - hosting. In order to take advantage of Apple frameworks, you need to be running on macOS. For many projects that don't rely only on Foundation, this isn't a problem - Swift on Linux supports these just fine, and there are instructions out there to handle this. Even better, the creators of Vapor have an excellent service they offer, Vapor Red, which I prefer to handle sites that don't require a macOS host. But what if you want to take advantage of the many frameworks available only on macOS?

Hosting Vapor on macOS

This assumes you have the developer tools on your host Mac, but little else. On the host Mac, install Homebrew:

% /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Once installed, pull in Vapor:

% brew tap vapor/tap % brew install vapor/tap/vapor

Clone your vapor project to wherever it is you want it to run from, then change your directory to your vapor project and build:

% vapor build —release % swift build --configuration release

Run your project:

% .build/release/Run —env=production

You need to make sure that your site starts up on boot. For this, I use supervisord, which you can install using homebrew:

% brew install supervisor

Create the supervisord configuration file:

% mkdir /usr/local/etc/supervisor.d % nano /usr/local/etc/supervisor.d/yourapp.ini

Open a text editor, and enter the following for the yourapp.ini file:

[program:] directory = [program directory] command= bash -c ".build/release/Run serve --env production --hostname 0.0.0.0" user= autostart=true autorestart=true startretries=3 stdout_logfile=/usr/local/var/log/supervisor/-stdout.log stderr_logfile=/usr/local/var/log/supervisor/-stderr.log

Make sure that whatever directory you choose to put your log files in, that it exists before you start supervisord. Then, start the supervisord service:

% brew services start supervisor

The next thing to do is to create a proxy which passes traffic from the http port (80) and, optionally, the https port (443), to the running application. To do so, first ensure that apache isn't already running on your host:

% sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

Then go ahead and install nginx (also fomr homebrew):

% brew install nginx % sudo brew services start nginx

Set up nginx:

% sudo nano /usr/local/etc/nginx/nginx.conf

Modify the “user” on the first line:

user [your user id] staff;

Comment out the existing server block (or remove it).

Create a new server in the servers directory:

% cd /usr/local/etc/nginx/servers % nano [servername]

Set up a new server block that redirects all traffic on port 80 to port 8080 (where your vapor project is running):

server { listen 80 default_server; listen [::]:80 default_server; location / { proxy_pass http://127.0.0.1:8080; } }

Once this is complete, just restart nginx and you should be able to browse to your server on port 80:

% sudo brew services start nginx

I’d recommend setting up SSL for whatever you’re doing, certbot works great for this. Instructions are available on their website.

That's it for now. If you have any questions or comments, I'm reachable both via email at rob@boundarylabs.com and on Twitter at @rminerick.

Other pertinent references that might help:


June 14, 2019

I've been working on Memoir 3 for about the last two years, going in fits and starts between consulting work and working on another startup company. As I've transitioned out of consulting and my requirements at the other business have been reduced, Memoir development has picked up steam - and I'm finally ready to announce a brand new version, Memoir 3.

Memoir 3 is a complete rewrite of the original version. The interface has been streamlined, and support for many of the latest macOS features are included. The product page has more detail, and the help files have been moved online so it's easier to see how Memoir operates. As always, a free trial is available, so you can purchase Memoir after you see if it's a good fit. Memoir 3 is a free upgrade for existing users, macOS 10.13 and higher.

Dossier

Now that Memoir is out the door, Dossier is up next. In the past, much of the code has been shared between the two programs; with Memoir 3 this has changed. Memoir will remain a application focused on keeping notes on your Mac. Dossier will evolve into something larger, keeping it's advanced features (and adding more) while also moving onto Apple's other platforms. Much of the knowledge gained in Memoir will lend itself to Dossier, resulting in a quicker release. Dossier is still in the planning phase, so I won't have details on the release date and new features for some time.

All that being said, the current version of Dossier is long in the tooth. I've removed it from the Mac App Store, as I could not provide a meaningful update within Apple's requested timeline. Today, Dossier has been updated to version 2.7.3. I've also reduced the price to $14.99, with a free upgrade to version 3. A more substantial update is in the works, fixing bugs that have cropped up over the years with new macOS releases, and adding some new features. At it's core, Dossier is still a very capable program - and I now have the time to keep it maintained until I can complete work on a rewrite.

Licensing and Serial Numbers

The majority of sales of both Memoir and Dossier have gone through the Mac App Store. The Memoir 3 update will be available on the App Store soon. For those who bought directly from Boundary Labs, new licenses are now available for the latest releases of Memoir and Dossier. A new license is required for the latest versions, though the upgrade is free. Please email us if you do not receive the new license via email.

New Website

We have a new website that has been written from the ground up in Swift using the Vapor framework. I've so far focused on enabling purchasing and integrating with our eCommerce partner (FastSpring), so I feel like things are a bit bare at the moment. It will fill out over the coming months, with a focus on help and support content.

This Blog

Lastly, there's this blog. As the tagline above notes, I don't intend it to be a product blog (or not specifically a product blog). On the previous website, I've occasionally posted tutorials or experiences on getting tricky things to work on macOS. These were sometimes hidden, posted for my own future use or sent along to someone who was having technical issues similar to my own. So, instead of a product blog, I'll be keeping those kinds of things here.

That's it for now. If you have any questions or comments, I'm reachable both via email at rob@boundarylabs.com and on Twitter at @rminerick.