Setup RSS Reader with Stringer and dokku

Previously I have created a blog with dokku and I wanted to create some application with database.

This is a guide on setup your own Stringer rss reader with dokku.

Dokku Host configuration


Create App

Create the app the normal way

1
dokku apps:create rss

Stringer will use postgresql, install the plugin and create database

1
2
sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git
dokku postgres:create rss-database

You need to link the app and database together

1
dokku postgres:link rss-database rss

Setup swap

For dokku to build Stringer image, you need more ram and swap space.

In my case, I created a 8G swapfile for it to build properly.

1
2
3
4
5
sudo fallocate -l 8G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

Client-side configuration


Clone Repository

1
2
git clone git://github.com/swanson/stringer.git
cd stringer

Update Configuration files

I have tried to add environment variable in dokku, it will alway fail with invalid argument: -p $PORT while deploy.

Edit Procfile, replace $PORT to 8080

The content should be like this

1
2
web: bundle exec unicorn -p 8080 -c ./config/unicorn.rb
console: bundle exec racksh

Deploy to dokku


Push to dokku (Client-side)

1
2
git remote add dokku dokku@example.com:rss
git push dokku master

If it failed to deploy, go to remote host and run this command

1
dokku config:set rss CURL_TIMEOUT=600

After deploy (Host)

1
2
3
4
dokku config:set rss APP_URL="rss.example.com"
dokku config:set rss SECRET_TOKEN=`openssl rand -hex 20`
dokku run rss bundle exec rake db:migrate
dokku ps:restart rss

Let’s encrypt (Host)

1
2
3
dokku config:set --no-restart rss DOKKU_LETSENCRYPT_EMAIL=user@example.com
dokku letsencrypt rss
dokku letsencrypt:cron-job --add

Auto Refresh (Host)

Add this in your dokku host crontab -e

1
@hourly dokku --quiet --rm run rss bundle exec rake fetch_feeds

Fever API

Stringer include fever api, if your reader support this (Reeder / Unread), you can sync with the following info:

In this example, I use https://rss.example.com as your rss application url.

Fields Input
Server https://rss.example.com/fever
Email stringer
Password yourpassword
Share Comments