Blog platform

stephen 2335fe6b77 Merge branch 'pages' of stephen/Pressr into master 6 days ago
app 89cabd7a29 Blog pages 6 days ago
bin 41bed356f4 First commit 1 month ago
config 89cabd7a29 Blog pages 6 days ago
db 89cabd7a29 Blog pages 6 days ago
lib 41bed356f4 First commit 1 month ago
log 41bed356f4 First commit 1 month ago
public 89cabd7a29 Blog pages 6 days ago
storage 41bed356f4 First commit 1 month ago
test 89cabd7a29 Blog pages 6 days ago
tmp 41bed356f4 First commit 1 month ago
util da9f2c71b7 Docker complete! 1 week ago
vendor b0688937a5 Image upload 1 month ago
.browserslistrc 41bed356f4 First commit 1 month ago
.gitignore b4b62d0d84 Carrierwave gitignore 1 month ago
.ruby-version 41bed356f4 First commit 1 month ago
Dockerfile da9f2c71b7 Docker complete! 1 week ago
Gemfile d5d4a4d601 Allows users to edit themselves 1 week ago
Gemfile.lock d5d4a4d601 Allows users to edit themselves 1 week ago
README.md 5d4a74bdc7 Updated readme 6 days ago
Rakefile 41bed356f4 First commit 1 month ago
babel.config.js 41bed356f4 First commit 1 month ago
config.ru 41bed356f4 First commit 1 month ago
docker-compose.yml da9f2c71b7 Docker complete! 1 week ago
dockerstart.sh da9f2c71b7 Docker complete! 1 week ago
package.json 41bed356f4 First commit 1 month ago
postcss.config.js 41bed356f4 First commit 1 month ago
webapp.conf da9f2c71b7 Docker complete! 1 week ago
yarn.lock 41bed356f4 First commit 1 month ago

README.md

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

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

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!

  1. Run docker-compose once

docker-compose up

  1. Terminate the process and create an admin account

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

  1. Start docker compose again

docker-compose up

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

Deployment (Debian 10)

  1. Ensure system is up to date

sudo apt update && sudo apt upgrade

  1. 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

  1. Create a new user

sudo useradd deploy

sudo usermod -aG sudo deploy

sudo su deploy

cd ~

  1. 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

  1. Configure Postgres

sudo su postgres

createuser deploy

psql

ALTER USER deploy CREATEDB;

exit

exit

  1. 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

  1. 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

  1. 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;
        root /home/deploy/Pressr/public;

}

Restart Nginx

sudo service nginx start

Browse to http://<your server ip> and you should see the web interface!