Jon Alluredhttps://www.jonallured.com/posts2023-05-24T00:00:00+00:00Jon AlluredMigrating Away From Google Serviceshttps://www.jonallured.com/posts/2023/05/24/migrating-away-from-google-services.html2023-05-24T00:00:00+00:002024-02-04T19:11:09+00:00Jon Allured<p>Nothing specifically happened to make me want to migrate away from Google
services. It's not like there was a last straw-type of situation, I just decided
it was time. Google's business does not align with my personal preferences any
longer and I would prefer to pick services that do.</p>
<h2>Don't Be Evil</h2>
<p>Google famously had this internal mantra of "Don't Be Evil" that I used to think
was so cool. Imagine a tech company that was self-aware enough to know that it
<em>could</em> be evil but wasn't because it reminded itself not to do that. That's
cool!</p>
<p>But I don't think that's the reality of today. Google might not be evil in the
way a demon might be evil but they sure like to do things that I dislike!</p>
<h2>I Am Not a Product</h2>
<p>The thing that makes me the most interested in migrating away from Google
services is that I consider myself a user not a product. Many have said that if
you don't pay for something, then you are the product and Google search is a
pretty good example of this.</p>
<p>When I search for something on Google I don't pay for that search. Instead
Google subsidizes that search by allowing advertisers to pay for placement on
the results page. This is how Google makes the vast majority of their money. In
this situation I am the product - my attention and clicks on ads are what fuel
the search engine.</p>
<p>And I was fine with this arrangement for many years. This same situation exists
for Gmail - I don't pay for Gmail thus I am the product. They don't directly
make money off me in this way but rather they mine data to make their ads more
relevant and it all feeds back into this cycle where my best interests play
almost no role.</p>
<h2>Will Pay for Software</h2>
<p>At other times in my life I was pretty uninterested in paying money for
software, especially if there was a free alternative. As I've gotten older and
my financial situation has changed so has this attitude. I've actually come full
circle and now <em>prefer</em> to pay for software! With some caveats of course.</p>
<p>I've also been gainfully employed as a person who makes software and so my views
on what and to whom I should be paying money when I use software have changed
too. When I see Twitter trying to get people to pay $8 for a blue check mark I
want nothing to do with it. But when I see Tapbots trying to get people to pay
for their excellent Mastodon client called Ivory then I'm like sign me up!</p>
<h2>Turns Out Privacy Has Value</h2>
<p>Given that I don't want to be a product and that I'm willing to pay for software
then it follows that I believe my privacy has value! Value that I'm willing to
spend real dollars on.</p>
<p>I'd consider paying Google money to respect my privacy but that's not their
business model.</p>
<h2>Finding Alternative to Google Services</h2>
<p>So this all leads me back to a desire to migrate away from Google services. In
my estimation the main things to migrate away from are:</p>
<ul>
<li>Chrome</li>
<li>Google Search</li>
<li>Gmail</li>
</ul>
<p>I've already set Safari as my default web browser on my laptops so that first
one isn't too hard. I will miss some of the features I've come to rely on with
Chrome but I bet I'll adapt pretty quickly.</p>
<p>For Google Search there are def alternatives that would be easy to migrate to -
DuckDuckGo seems like an easy one to pick. I'm also interested to try out a paid
search engine but that'll take some experimentation.</p>
<p>Last is Gmail and I might have already overcome this pretty quickly. I asked my
pal <a href="https://hachyderm.io/@erikk">Erik</a> about this and he recommended Fastmail. I've already set up an account
and have migrated my 15+ years of email over so...maybe this is mostly done?</p>
<p>I still have to go through the process of updating friends and family about the
new address and then update the LOTS of accounts that are tied to my old Gmail
address but that's all something I can do over time.</p>
<p>Which is sort of a theme here - migrating to something else with an eye towards
eventually deleting my Google account but not right away. Let's see how this
goes!</p>
Week in Review: Week 25, 2021https://www.jonallured.com/posts/2021/06/27/week-in-review-week-25-2021.html2021-06-27T00:00:00+00:002024-02-04T19:11:09+00:00Jon Allured<p>This week I was able to spend some time poking at Apache log files and learned a
lot more about how they work and what parts of the logged data I'm interested
in. What I have is a folder on S3 with daily log files. I pulled them down to my
local machine and then used a couple Ruby gems to inflate, parse and filter
them. There is a lot of noise in these files so the filtering part took the most
time - more time than I had anticipated for sure!</p>
<p>So that's where things stand - I've got a script that I used to slice and dice
down a file of data into what appears to be the signal from the noise. Where I
want to get to is a weekly email that shows me how my sites are doing.
Connecting pieces to achieve this goal would be the next step.</p>
<h2>Highlights</h2>
<ul>
<li>worked 38:30, 1:30 of PTO</li>
</ul>
<h2>Next Week</h2>
<p>We're headed to visit family for the 4th of July so I probably won't have too
much time to work on things. I'm really looking forward to the break from normal
life; the haze of this last year of pandemic life is lifting more each time we
take a trip. I'm very grateful to be able to reconnect with people in person!</p>
Week in Review: Week 24, 2021https://www.jonallured.com/posts/2021/06/20/week-in-review-week-24-2021.html2021-06-20T00:00:00+00:002024-02-04T19:11:09+00:00Jon Allured<p>I had high hopes for this week but ended up not having much time to tinker with
things until this morning. That's ok, I was pretty productive and got the
remainder of my static sites migrated over to my new server and updated to use
GitHub Actions to deploy.</p>
<p>When I went to migrate and deploy this site I also wanted to upgrade Ruby to 3
and found it pretty challenging. I ran into issues with the latest 4.x Middleman
release on RubyGems but when I switched over to GitHub and the master branch it
worked great. I don't love being on an unreleased version of the main lib I'm
using for a project but I didn't feel like I had many better options.</p>
<p>I did run into a couple relevant comments on GitHub:</p>
<ul>
<li><a href="https://github.com/middleman/middleman/issues/2400#issuecomment-732464743">middleman/middleman#2400</a></li>
<li><a href="https://github.com/middleman/middleman/issues/2422#issuecomment-819745887">middleman/middleman#2422</a></li>
</ul>
<p>So my particular problem was fixed but unreleased on the 4.x branch but also the
v5 work seems like it might not come out? Very confused and yeah open source can
be like this.</p>
<h2>Highlights</h2>
<ul>
<li>worked 31:00, 9:00 PTO</li>
<li>published <a href="https://puddingtime.buzzsprout.com/1470301/8727720-season-1-finale">Season 1 Finale</a> for Pudding Time</li>
<li>published <a href="https://www.buzzsprout.com/1781859/8721383">Request for Comment #5</a> for Artsy Engineering Radio</li>
</ul>
<h2>Next Week</h2>
<p>Now that I've got all my static sites migrated it's time to decommission the old
server. I <em>think</em> this will be as easy as destroying the Droplet in DO's
interface but I'm going to give it a few more days to be sure that my DNS
changes have had a chance to propagate out.</p>
<p>Either way, my next goal was to drop Google Analytics. The aforementioned
difficulties upgrading to Ruby 3/Middleman 5 caused me to actually already do
this. The existing Middleman extension for GA isn't compatible with MM5 so I
just dropped it outright.</p>
<p>But I'd like to return to this topic of analytics. I think the MVP here is some
routine process that scrapes my log files and computes a report that's sent to
my email. Just something simple like a table of the sites hosted and each day's
total requests or something. I can iterate from there.</p>
Week in Review: Week 23, 2021https://www.jonallured.com/posts/2021/06/13/week-in-review-week-23-2021.html2021-06-13T00:00:00+00:002024-02-04T19:11:09+00:00Jon Allured<p>Well I was able to find the time to migrate only one of my static sites, but
better than zero!</p>
<h2>Highlights</h2>
<ul>
<li>worked 32:00, 8:00 PTO</li>
<li>migrated <a href="https://www.fortyeven.com">fortyeven.com</a> over to GitHub Actions
with <a href="https://github.com/verynicecode/forty-site/pull/28">verynicecode/forty-site#28</a></li>
</ul>
<h2>Next Week</h2>
<p>This next week is a short week at work because they're giving us Friday off. I'm
not sure what I'm going to do with the day but I'm really looking forward to it!</p>
Week in Review: Week 22, 2021https://www.jonallured.com/posts/2021/06/06/week-in-review-week-22-2021.html2021-06-06T00:00:00+00:002024-02-04T19:11:09+00:00Jon Allured<p>Well I've missed a few weekly update posts but that's ok, posting these every
week isn't the goal - the goal is the habit and life happens around it. Last
weekend was my birthday and we were out of town which was so so nice. It meant a
short work week but I actually got a lot done!</p>
<p>Anyway, I <em>finally</em> finished setting up a new server for my static sites and
wrote up the notes for a post (see below). A notable change I'm trying out:
separate the work of CI from the deployment. So given a static site like
<a href="https://www.cybertail.systems">cybertail.systems</a> have CircleCI run the tests but then configure GitHub
Actions with a workflow that deploys the site to DigitalOcean:
<a href="https://github.com/verynicecode/cybertail-site/pull/4">verynicecode/cybertail-site#4</a>.</p>
<p>Why this extra complexity? Well the thing is that when it comes to deploying I
have to specify some secrets. If I do this with CircleCI then that prevents me
from building forked pull requests. This doesn't really matter for a project
like the Cybertail site, but I noticed that when my pal Steve Hicks <a href="https://github.com/jonallured/pear/pull/28">opened a
PR</a> on <a href="https://github.com/jonallured/pear">pear</a> it did not build.</p>
<p>That got me thinking about my approach and while pondering I remembered that
GitHub Actions existed and that I could build a separate deployment pipeline and
not interfere with the PR feedback pipeline. More complex yes, but also simple
in the sense that what happens at CircleCI is open and what happens with GitHub
Actions is closed. That's a simple mental model so I like that aspect of this
setup. We shall see!</p>
<h2>Highlights</h2>
<ul>
<li>worked 32:00, 8:00 PTO</li>
<li>published <a href="https://www.jonallured.com/posts/2021/06/05/configure-prompt-on-ios-with-ssh-keys.html">Configure Prompt on iOS With SSH Keys</a> on here</li>
<li>published <a href="https://www.jonallured.com/posts/2021/06/05/updated-digitalocean-server-setup.html">Updated DigitalOcean Server Setup</a> on here</li>
</ul>
<h2>Next Week</h2>
<p>Like I said, I have a brand new spiffy server to host my static sites - woo!
I've migrated a couple sites over and hope to find the time to migrate the rest
over the next week.</p>
<p>I think the next milestone on this front is figuring out what to do with the
Apache log files I'm generating. I'd really like to drop Google Analytics from
any sites I host but want to have server logs as a close-enough replacement. My
bet is that I can find some tool to parse and display these log files so it'll
probably just take a bit of research/tinkering to set it all up.</p>
Updated DigitalOcean Server Setuphttps://www.jonallured.com/posts/2021/06/05/updated-digitalocean-server-setup.html2021-06-05T00:00:00+00:002024-02-04T19:11:09+00:00Jon Allured<p>I recently wanted to setup a new server and found that <a href="https://www.jonallured.com/posts/2016/09/09/my-digital-ocean-server-setup.html">my existing
guide</a> needed some updating. The biggest change between that guide and
this one is using Homebrew for installing software but otherwise the overall
approach remains mostly unchanged. Still, I wanted to collect the procedure in
one place so it would make following it easier.</p>
<h2>Create Droplet</h2>
<p>Start by using the <a href="https://www.digitalocean.com/">DigitalOcean</a> interface to create a droplet. I pick the
latest Ubuntu release and the cheapest settings. I do also like to enable
backups in case something terrible happens.</p>
<h2>Root User SSH Setup</h2>
<p>When you create a new Droplet, be sure to add your SSH keys and they will be
copied to the root user's <code>authorized_keys</code> file automatically. That means you
can SSH into the new server like this:</p>
<pre><code>$ ssh root@ipaddress
</code></pre>
<h2>Create Dev User</h2>
<p>To create a user:</p>
<pre><code>root@servername:~# adduser dev
</code></pre>
<p>Use 1Password to set a really long password.</p>
<h2>Add Dev User to Sudo Group</h2>
<pre><code>root@servername:~# gpasswd -a dev sudo
</code></pre>
<h2>Add Server to 1Password</h2>
<p>Create an entry in 1Password for the server providing both the dev user's
password and the IP Address.</p>
<h2>Copy SSH Keys to Dev User</h2>
<p>Since we added our SSH keys to the root user's <code>authorized_keys</code> during Droplet
creation, let's copy those keys over to our new dev user:</p>
<pre><code>root@servername:~# mkdir /home/dev/.ssh
root@servername:~# cp .ssh/authorized_keys /home/dev/.ssh/
root@servername:~# chown -R dev:dev /home/dev/.ssh/
</code></pre>
<h2>Configure SSH</h2>
<p>We're going to configure SSH so that only our <code>authorized_keys</code> will work for
SSH and while we're at it, we're going to disable root login.</p>
<pre><code>root@servername:~# vim /etc/ssh/sshd_config
</code></pre>
<p>Make the following changes:</p>
<pre><code>PermitRootLogin no
...
ChallengeResponseAuthentication no
...
PasswordAuthentication no
...
UsePAM no
</code></pre>
<p>With those changes made, restart the <code>ssh</code> service so that they take effect:</p>
<pre><code>root@servername:~# service ssh restart
</code></pre>
<h2>Add SSH Config</h2>
<p>In order to make SSHing into the machine easier, add an entry to your SSH
config:</p>
<pre><code>$ vim ~/.ssh/config
</code></pre>
<pre><code>Host servername
Hostname ipaddress
User dev
</code></pre>
<p>With those settings, you can now SSH into the machine like this:</p>
<pre><code>$ ssh servername
</code></pre>
<h2>Generating SSH Keys for Dev User</h2>
<pre><code>dev@servername:~$ ssh-keygen -t rsa -b 4096 -C "jon.allured@gmail.com"
dev@servername:~$ eval "$(ssh-agent -s)"
dev@servername:~$ ssh-add ~/.ssh/id_rsa
</code></pre>
<h2>Configure GitHub</h2>
<p>In order to use SSH on the repos you clone down from GitHub, you'll want to add
the server's public key. There's a nice <a href="https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/#platform-linux">write up</a> on how to do this, but
you'll need to copy the key down to your machine:</p>
<pre><code>$ ssh servername 'cat .ssh/id_rsa.pub' | pbcopy
</code></pre>
<p>Next, head over to the <a href="https://github.com/settings/ssh">GitHub SSH Settings page</a> and add the key.
Then you can confirm that it worked with this:</p>
<pre><code>dev@servername:~$ ssh -T git@github.com
</code></pre>
<h2>Using Homebrew for Managing Software</h2>
<p>The major change was that I decided to use Homebrew rather than apt for managing
the software installed on the machine. There are a few requirements we'll want
to install before setting up Homebrew so that looks like this:</p>
<pre><code>dev@servername:~$ sudo apt-get update && sudo apt-get -y install build-essential procps curl file git
</code></pre>
<p>And then we can install Homebrew:</p>
<pre><code>dev@servername:~$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
</code></pre>
<p>Then this:</p>
<pre><code>dev@servername:~$ eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
</code></pre>
<p>That will adjust the path such that the current session can see Homebrew. It'll
work for now and my dotfiles will adjust the path moving forward.</p>
<h2>Change Dev User to Use ZSH</h2>
<pre><code>dev@servername:~$ brew install zsh
dev@servername:~$ command -v zsh | sudo tee -a /etc/shells
dev@servername:~$ chsh -s "$(command -v zsh)"
</code></pre>
<p>You'll need to log out and back in for this to take affect.</p>
<h2>Install More Software</h2>
<p>Kick this off and then do something else because it'll take a while:</p>
<pre><code>dev@servername:~% brew install asdf awscli bat fd fzf gh git httpie hub jq rcm the_silver_searcher tmux vim
</code></pre>
<h2>Create Code Folder</h2>
<pre><code>dev@servername:~% mkdir code
</code></pre>
<h2>Install Dotfiles</h2>
<p>I'd be lost without my dotfiles so I install them even on my servers:</p>
<pre><code>dev@servername:~/code% git clone git@github.com:jonallured/dotfiles.git
dev@servername:~/code% cd dotfiles
dev@servername:~/code/dotfiles% env RCRC=$HOME/code/dotfiles/rcm/rcrc rcup -t linux
</code></pre>
<p>I also have a file of secrets that needs to come over:</p>
<pre><code>$ scp ~/code/secrets/rcm/zshrc.private servername:~/.zshrc.private
</code></pre>
<h2>Install From Tool Versions</h2>
<p>After adding the plugins, a bare install command will get the default versions
all installed for me.</p>
<pre><code>dev@servername:~% asdf plugin add ruby
dev@servername:~% asdf plugin add nodejs
dev@servername:~% asdf plugin add python
dev@servername:~% asdf install
</code></pre>
<h2>Setup VIM</h2>
<p>I use vim-plug to manage VIM these days and have a command called replug to get
everything setup:</p>
<pre><code>dev@servername:~% replug
</code></pre>
<h2>Snapshot This Config</h2>
<p>You can save the state of a Digital Ocean server by creating a snapshot. To do
this, you first have to power off the machine:</p>
<pre><code>dev@servername:~% sudo poweroff
</code></pre>
<p>Then use the Digital Ocean interface to take your snapshot:</p>
<pre><code>Droplets > [Pick Droplet] > Snapshots > Take Snapshot
</code></pre>
<p>You might want to pick a name like "basic config" or something and then you can
use it to either restore or create new droplets.</p>
<p>One thing I'd note here is that the keys generated for this server will be used
when using this snapshot. When you have a server you want to restore to a known
state, that's a good thing, but when you what to use the snapshot to make a new
server, I'd say those keys should be re-generated.</p>
Configure Prompt on iOS With SSH Keyshttps://www.jonallured.com/posts/2021/06/05/configure-prompt-on-ios-with-ssh-keys.html2021-06-05T00:00:00+00:002024-02-04T19:11:09+00:00Jon Allured<p>I got a fancy new iPad recently and bought a copy of <a href="https://panic.com/prompt/">Prompt</a> so that I could
SSH into my servers from the comfort of my couch. The process turned out to be
more tricky than I expected so here's my notes on how I did it.</p>
<h2>Generate the Keys</h2>
<p>The first step was to generate the keys, I did this like so:</p>
<pre><code>$ ssh-keygen -m PEM -t rsa -C "prompt@cypher" -f keys/prompt/cypher
</code></pre>
<h2>Add Public Key to Server</h2>
<p>This won't work if you don't add the newly generated public key to the server so
let's do that next:</p>
<pre><code>$ ssh-copy-id -i keys/prompt/cypher.pub domino -f
</code></pre>
<h2>Add Private Key to Prompt</h2>
<p>This is the part that caused me some trouble. There's an interface in the Prompt
app to add keys by picking a file from your iCloud Drive but it didn't behave as
I expected. I had the keys there but they were greyed out and I couldn't pick
them.</p>
<div class="imageWrapper">
<a href="/images/post-58/prompt-import-wtf.png">
<img alt="Interface in Prompt for picking SSH keys." src="/images/post-58/prompt-import-wtf.png" width="700" />
</a>
<p><em>click for bigger</em></p>
</div>
<p>What I figured out was that they needed a file extension in order to work:</p>
<pre><code>$ cp keys/prompt/cypher ~/Desktop/cypher-private.txt
</code></pre>
<p>Then I could find and pick that file as the key in Prompt and it would add it to
the list of known keys. Next was finishing the server settings in Prompt and
saving them so that it could be one-tap to connect. Behold:</p>
<div class="imageWrapper">
<a href="/images/post-58/prompt-connected-to-domino.png">
<img alt="Connected to Domino in Prompt." src="/images/post-58/prompt-connected-to-domino.png" width="700" />
</a>
<p><em>click for bigger</em></p>
</div>
Week in Review: Week 19, 2021https://www.jonallured.com/posts/2021/05/16/week-in-review-week-19-2021.html2021-05-16T00:00:00+00:002024-02-04T19:11:09+00:00Jon Allured<p>Mother's Day was last weekend and we were so busy I didn't have time to write
anything up so playing a bit of catch up here - I shipped a bunch of podcast
episodes but didn't make much progress on my DigitalOcean setup so that's still
WIP.</p>
<p>I did find some time at work to improve the <a href="https://github.com/jonallured/braze_ruby">braze_ruby</a> gem that I've been
tinkering with. What I wanted to get going was automated publishing. There are
lots of ways to do this, my current preferences is:</p>
<ul>
<li>run a script locally when you want to publish a new version</li>
<li>that script bumps the version and tags the resulting SHA</li>
<li>that work is then pushed to GitHub</li>
<li>CircleCI sees the tag being pushed and that triggers a publish job</li>
<li>the publish job uses a RubyGems API key to release the new version</li>
</ul>
<p>So that's what I setup with these two PRs:</p>
<ul>
<li><a href="https://github.com/jonallured/braze_ruby/pull/29">Add release workflow to publish gem from CI</a></li>
<li><a href="https://github.com/jonallured/braze_ruby/pull/30">Add script to help automate releases</a></li>
</ul>
<p>And I used this config to publish version <code>0.5.0</code> just to be sure everything was
setup correctly.</p>
<h2>Highlights</h2>
<ul>
<li>worked 39:30, no PTO</li>
<li>published <a href="https://puddingtime.buzzsprout.com/1470301/8480831-kid-swap">Kid Swap</a> for Pudding Time</li>
<li>published <a href="https://puddingtime.buzzsprout.com/1470301/8523115-what-a-crock">What a Crock</a> for Pudding Time</li>
<li>published <a href="https://podcasts.apple.com/us/podcast/17-request-for-comment-3/id1545870104?i=1000521629173">Request for Comment #3</a> for Artsy Engineering Radio</li>
<li>shipped <a href="https://github.com/jonallured/jay/pull/45">minor fix</a> for jay</li>
</ul>
<h2>Next Week</h2>
<p>I'd love to return to my static site work and finish up that DigitalOcean server
post. Let's see if I can make that happen.</p>
Week in Review: Week 17, 2021https://www.jonallured.com/posts/2021/05/02/week-in-review-week-17-2021.html2021-05-02T00:00:00+00:002024-02-04T19:11:09+00:00Jon Allured<p>I got my second shot and it really kicked my ass so I didn't get to writing one
of these last weekend. Some of these highlights would have been covered in that
post so I wanted to capture them.</p>
<h2>Highlights</h2>
<ul>
<li>worked 40:00, 8:00 PTO</li>
<li>published <a href="https://puddingtime.buzzsprout.com/1470301/8397537-both-and">Both And</a> for Pudding Time</li>
<li>published <a href="https://puddingtime.buzzsprout.com/1470301/8437989-distress-signals">Distress Signals</a> for Pudding Time</li>
<li>published <a href="https://podcasts.apple.com/us/podcast/14-request-for-comment-2/id1545870104?i=1000518231707">Request for Comment #2</a> for Artsy Engineering Radio</li>
<li>published <a href="https://www.jonallured.com/posts/2021/04/24/deploying-static-sites-via-circleci.html">Deploying Static Sites via CircleCI</a> on here</li>
</ul>
<h2>Next Week</h2>
<p>I've been tinkering with my DigitalOcean servers, working on updating my guide
for setting up a webserver there. I haven't really touched those servers in a
while so it's been fun to revisit this topic and learn about things I can do to
improve my setup. Hoping to wrap this work up this week and write about it!</p>
Deploying Static Sites via CircleCIhttps://www.jonallured.com/posts/2021/04/24/deploying-static-sites-via-circleci.html2021-04-24T00:00:00+00:002024-02-04T19:11:09+00:00Jon Allured<p>Hosting static sites at DigitalOcean has been working out great for me but I
wanted to make it even better so I've set them up to build and deploy at
CircleCI on merges to the main branch. Here I'll outline how I do this.</p>
<h2>Configuration Updates</h2>
<p>My approach is to have a <code>deploy</code> job in the CircleCI config that sends the
freshest build of my site to DigitalOcean. The formula for this operation is
something like this:</p>
<ol>
<li>install rsync</li>
<li>add ssh keys</li>
<li>scan the DigitalOcean server for keys and update known hosts</li>
<li>build the site using Middleman</li>
<li>deploy the site using rsync</li>
</ol>
<p>Here's an example of these steps:</p>
<pre><code class="yaml">steps:
- run:
name: Installing rsync
command: sudo apt-get update && sudo apt-get install -y rsync
- add_ssh_keys
- run:
name: Scan server keys
command: touch ~/.ssh/known_hosts && ssh-keyscan jonallured.com >> ~/.ssh/known_hosts
- checkout
- restore_cache:
name: Restore bundler cache
key: bundler-v2-{{ checksum "Gemfile.lock" }}
- run:
name: Bundle install
command: bundle install --jobs=4 --retry=3 --path vendor/bundle
- run:
name: Deploying site
command: bundle exec rake deploy
</code></pre>
<p>See also <a href="https://github.com/jonallured/jonallured.com/blob/853feb355ff45b2b8d870e40a498139e99c0f652/.circleci/config.yml">my complete CircleCI config</a> file for this site.</p>
<h2>Setting Up SSH Keys</h2>
<p>In order to safely allow CircleCI to deploy the site to DigitalOcean we have to
generate and set some SSH keys. Start by creating a key pair like so:</p>
<pre><code>$ ssh-keygen -m PEM -t rsa -C "jonallured-com@circleci" -f keys/circleci/jonallured-com
</code></pre>
<p>I do this in a <code>~/code/secrets</code> folder on my machine and then check in these
keys. This is an end-to-end encrypted git repo outside any particular project
and I host it with Keybase.</p>
<p>Next up let's send the public key to our DigitalOcean server and update the
authorized keys file there:</p>
<pre><code>$ ssh-copy-id -i keys/circleci/jonallured-com.pub psylocke -f
</code></pre>
<p>Then upload the private key in the CircleCI interface:</p>
<div class="imageWrapper">
<a href="/images/post-55/circleci-ssh-key.png">
<img alt="Add SSH Key Screen in CircleCI Settings." src="/images/post-55/circleci-ssh-key.png" width="700" />
</a>
<p><em>click for bigger</em></p>
</div>
<p>Make sure you add the ENV var at CircleCI too:</p>
<pre><code>DEPLOY_TARGET=dev@jonallured.com:/var/www/jonallured.com
</code></pre>
<p>And that should correspond with the keyscan command in the yaml config so that
the deploy doesn't hang on waiting for a yes/no answer on accepting the identity
of the host.</p>
<h2>Deploying The Site</h2>
<p>I've got a rake task that builds and deploys the site:</p>
<pre><code class="ruby">desc 'Deploy site'
task :deploy do
system 'middleman build --clean'
system "rsync -av -e ssh --delete build/ #{ENV['DEPLOY_TARGET']}"
end
</code></pre>
<p>At this point our next steps will be to create a PR, get it merged to main and
then our servers should be doing things automatically for us!</p>
Week in Review: Week 15, 2021https://www.jonallured.com/posts/2021/04/18/week-in-review-week-15-2021.html2021-04-18T00:00:00+00:002024-02-04T19:11:09+00:00Jon Allured<p>This week was graduation time at Jack's Karate studio and he did great! He
didn't get the next belt but that's ok. They earn points for doing chores at
home and then can get recognized for that in addition to the actual moves
they're working on. He had been doing a good job with this and ended up placing
third in terms of these points. That got him an award plus a medal and he was
super proud. I'm not tearing up, you are!</p>
<h2>Highlights</h2>
<ul>
<li>worked 40:00, 0:30 PTO</li>
<li>published <a href="https://puddingtime.buzzsprout.com/1470301/8350175-bare-boatin-with-brian-dunn">Bare Boatin' (with Brian Dunn)</a> for Pudding Time</li>
<li>published <a href="https://www.jonallured.com/posts/2021/04/17/my-lab-notebook.html">My Lab Notebook</a> on here</li>
</ul>
<h2>Next Week</h2>
<p>Now that I've shipped a post about my [lab notebook][] project I want to get back to
a couple things I've been wanting to add, namely tags. Middleman supports this
but I've not really tinkered with it before. I think this will be a nice way to
find related notes.</p>
<p>Then after that I wanna setup something so that I can easily search through the
notes. This is a bit tricker because it'll involve some tech - maybe
<a href="https://www.elastic.co/elasticsearch/">Elasticsearch</a>? Need to do more pondering/research.</p>
<p>Friday I get my second shot and I'm super excited to be fully vaccinated. I
expect to feel a little sick from it based on what people have said and that the
first one knocked me back a bit.</p>