M .gitignore => .gitignore +3 -0
@@ 1,4 1,7 @@
.env
+.ruby-version
+.ruby-gemset
public/*
spec/examples.txt
+log/*
tmp/*
M Gemfile => Gemfile +1 -0
@@ 3,6 3,7 @@
source "https://rubygems.org"
gem 'sinatra'
+gem 'puma'
gem 'dotenv'
gem 'indieauth-token-verification'
gem 'mime-types'
M Gemfile.lock => Gemfile.lock +5 -1
@@ 9,6 9,9 @@ GEM
mime-types-data (3.2019.1009)
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
+ nio4r (2.7.3)
+ puma (6.4.2)
+ nio4r (~> 2.0)
rack (2.2.9)
rack-protection (3.2.0)
base64 (>= 0.1.0)
@@ 28,7 31,8 @@ DEPENDENCIES
dotenv
indieauth-token-verification
mime-types
+ puma
sinatra
BUNDLED WITH
- 2.1.4
+ 2.5.13
M README.md => README.md +3 -1
@@ 8,7 8,7 @@ Babbas is a Media endpoint for use with an IndieWeb [Micropub](http://micropub.r
## Installation
-Babbas is currently used as the Media endpoint for my personal website (https://deeden.co.uk/) and, as such, is configured to work for me. It should work for someone else if properly configured (via `.env`). For my purposes I run Babbas through [Passenger](https://www.phusionpassenger.com/) on a [Dreamhost VPS](https://www.dreamhost.com/hosting/vps/).
+Babbas is currently used as the Media endpoint for my personal website (https://deeden.co.uk/) and, as such, is configured to work for me. It should work for someone else if properly configured (via `.env`). For my purposes I run Babbas through [Puma](https://github.com/puma/puma) on a [Dreamhost VPS](https://www.dreamhost.com/hosting/vps/).
## Configuration
@@ 25,6 25,8 @@ Use of the application **requires** a number of environment variables to be spec
| DATA_DIRECTORY | Directory path | A more specific directory (within `ENDPOINT_BASE`) for where your media will be stored. |
| TOKEN_ENDPOINT | URL | The token endpoint used to verify any IndieAuth token |
| DOMAIN | URL | The domain any IndieAuth token will be verified to be valid for |
+| PORT | Number | The port number to run the server on |
+| LOG_FILE | File path | The path to where logs should be written |
##### `ENDPOINT_BASE` vs `DATA_DIRECTORY`
M config.ru => config.ru +8 -0
@@ 2,4 2,12 @@ require 'dotenv/load'
require 'sinatra'
require './lib/babbas/application'
+set :port, ENV["PORT"]
+
+configure do
+ file = File.new(ENV["LOG_FILE"], 'a+')
+ file.sync = true
+ use Rack::CommonLogger, file
+end
+
run Babbas::Application