CORTEX REAVER - A dangerous Ruby blog engine, with a photographic memory.

Cortex Reaver is a terrifying machine which stalks the corridors of Citadel Station, searching for humans to assimilate into Shodan’s perfection.

Cortex Reaver is also a blog engine for textual journals, photographs, and projects; written using Ramaze and Sequel. It supports tags, comments, and simple attachments. Features include canonically named URLs (/journals/show/a-post-title) with conflict resolution, useful formatting modules for content (HTML sanitizing, attachment references, BlueCloth, etc), and custom pages.

Why Cortex Reaver


  • Adaptible. Runs on every web server and database Ramaze and Sequel support.

  • Visual. Large, beautiful photographs, with concise EXIF support.

  • Comprehensive. Comments, file attachments, and tags on everything.

  • Devastating. The main page of Aphyr.com scales to ~400 requests/second.

Getting Started


mkdir cortex_reaver # Create an empty directory for Cortex Reaver to lurk in. cd cortex_reaver cortex_reaver –migrate # Initialize an SQLite database. cortex_reaver –start # Start the daemon.

Then point your web browser at localhost:7000, hit control-x, and log in with username “shodan”, password “citadelstation”.

You can check Cortex Reaver’s status with –status, and when you’re done, shut it down with –stop.

Configuration


You’ll need a YAML configuration file to define Cortex Reaver’s configuration. See proto/cortex_reaver.yaml. If no config file is specified on the command line with –config, Cortex Reaver assumes you mean cortex_reaver.yaml in the working directory. Copy lib/proto/cortex_reaver.yaml to get started.

Databases


Cortex Reaver uses Sequel (sequel.rubyforge.org/), so you can (in theory) use any database Sequel supports. By default, Cortex Reaver builds an SQLite database in the working directory, but you can set a different database in the config file, either as a Sequel string or with hash of options.

For MySQL:

create database cortex_reaver; grant all privileges on cortex_reaver.* to ‘cortex_reaver’@‘localhost’

identified by 'some-password' with grant option;

When you’ve set up a new database, run cortex_reaver –migrate to update it to the latest version. If you need to wipe your database and start over, use cortex_reaver –blank to drop the schema and rebuild it.

Customization


You may find development mode useful: it reloads source files when they’re changed, displays traces for errors instead of 404 and 500 responses, logs more, and runs in the console instead of detaching by default. Just set :mode

> :development in your configuration.

Requests for static objects (images, css, javascript, etc.) is pulled from public/, which can be specified in your configuration or defaults to ‘cwd`/public. If a request for a file can’t be found there, it’s retrieved from Cortex Reaver’s own public directory in lib/public.

You can also set up your own view templates: copy lib/view to some other directory, and specify :view_root in your configuration.

Credits


I am indebted to the good folks of #sequel and #ramaze for their many suggestions in writing Cortex Reaver, and also to Ryan Grove (wonko.com), the author of the excellent (and very similar) blog system Thoth, for invaluable advice and code. Cortex Reaver should have been a fork of Thoth, but my schema is just too complex for the changes to be maintainable going forward.