Pressr

Pressr is a multi-user, multi-blog website written in Ruby on Rails. Although it uses Javascript by default, it is still fully functional even when it is turned off.

Sample instance

My blog(Uses Pressr)

Features

Comments and comment replies

Multi-user support

Multi-blog support

Multi-page support

Automatic pagination

Image upload

Markdown support

Very lightweight

StatsD integration

Custom per-blog theming

RSS feeds

Draft posts/pages

Categories

Configuration

Database settings are configured in config/database.yml. It defaults to Postgres running on localhost.

Custom settings are configured in config/pressr.yml.

Deployment (Docker)

A sample docker-compose.yml is provided. Make sure to change the SECRET_KEY_BASE ! This is very important!

Run docker-compose once

docker-compose up

Terminate the process and create an admin account

docker-compose run web bash -c 'util/createAdmin.sh'

Start docker compose again

docker-compose up

You will be able to access Pressr at http://localhost:3000

Deployment (Debian 10)

Ensure system is up to date

sudo apt update && sudo apt upgrade

Install dependencies

sudo apt install build-essential dirmngr gnupg ruby ruby-dev zlib1g-dev libruby libssl-dev libpcre3-dev libcurl4-openssl-dev rake ruby-rack dirmngr postgresql-11 nginx apt-transport-https ca-certificates curl git libpq-dev

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -

echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

sudo apt update && sudo apt install yarn

Create a new user

sudo adduser deploy

sudo usermod -aG sudo deploy

sudo su deploy

cd ~

Install Ruby via RVM

gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB

curl -sSL https://get.rvm.io | bash -s stable --ruby

source ~/.rvm/scripts/rvm

rvm install ruby-2.6.4

rvm --default use ruby-2.6.4

gem install bundler -v 2

Configure Postgres

sudo su postgres

createuser deploy

psql

ALTER USER deploy CREATEDB;

exit

exit

Install Pressr

git clone https://git.scd31.com/stephen/Pressr

cd Pressr

export RAILS_ENV=production

export EDITOR=nano

bundle install

rm config/credentials.yml.enc

rails credentials:edit

Edit config/database.yml and comment out username and password under the header production

rake db:create

rake db:migrate

rake assets:precompile

Install Phusion

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7

sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger buster main > /etc/apt/sources.list.d/passenger.list'

sudo apt-get update

sudo apt-get install libnginx-mod-http-passenger

Configure nginx

Open /etc/nginx/conf.d/mod-http-passenger.conf . Verify these lines are present:

passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;

passenger_ruby /usr/bin/passenger_free_ruby;

Open /etc/nginx/sites-available/default in a text editor. Remove everything except for:

server { listen 80 default_server; listen [::]:80 default_server; passenger_enabled on; passenger_user deploy; passenger_min_instances 1; client_max_body_size 100M; root /home/deploy/Pressr/public; } passenger_pre_start http://localhost:3000/;

Restart Nginx

sudo service nginx start