Code Monkey home page Code Monkey logo

marley's Introduction

Marley

Marley is minimal blog engine without admin interface written in Sinatra framework (sinatra.rubyforge.org).

It has no admin interface for writing posts. Use your favorite text editor to edit plain-text files and synchronize them to server. Marley uses plain-text files for storing articles and SQLite database for storing comments (set data location in config.yml). It comes with Rake and Capistrano tasks for installing and deploying the application, and for syncing articles from your local machine to the server.

The master branch is bare application, restafari_org branch is what runs @ www.restafari.org.

In case you like to use Marley, you should fork it and then make your own branch for your own styling, so you can git pull any future updates from the master and then merge/cherry-pick them into your branch. Marley has support for themes: see themes directory. Just duplicate the default directory and start tweaking. Obviously, do not use the restafari theme for your own blog, please.

Ingredients

  • Sinatra, Rack and Thin

  • ActiveRecord and SQLite

  • Akismet filtering (see ./vendor/akismetor.rb)

  • YAML configuration

  • RDiscount for Markdown –> HTML conversion

  • Builder for Atom feed generation

  • Rake and Capistrano tasks

Installation and dependencies

You have to install or update following Rubygems:

$ sudo gem install sinatra rack thin activerecord sqlite3-ruby rdiscount builder capistrano

Edit this configuration file:

config/config.example.yml

and save it as config/config.yml.

Install the application with this Rake task:

$ rake app:install

Load this URL in your browser:

http://localhost:4567

You’re done. SRSLY.

Deployment on server

Ensure that you have correct information in config/config.yml. Rename example deploy file to config/deploy.rb and fill in proper information for: user, repository, deploy_to, app, web, db. Then run:

  • cap deploy:setup

  • cap deploy:cold

Normal Capistrano deployment procedures apply (ie. you use cap deploy very often).

Of course, you have to ensure that there is at least some content on the server in data directory. See next section!

Synchronizing content

Marley has no administrative interface for writing articles inside some silly <textarea>. It assumes you like to write in your favorite text editor, using Markdown, previewing on the fly, and just synchronize when you’re ready to publish.

There are several ways how to do that:

  • You can be hardcore and write articles over SSH in Vim directly on the server for “just-in-time-publication” when you hit :w

  • You can be less glorious, of course, and save your articles to some folder on your disk and scp-ing said folder to the server. Or use SFTP? Cyberduck drag & drop? Aaargh, not reccommended unless you really like to see what you’re doing, in real time.

  • You can implement some sane practice and start versioning your writing with Git. (What else?) This way, you can setup remote repository on your server, just push-ing changes whenever you feel like you want to say something in public. A post-commit hook is completely neccessary in this case, of course. (It isn’t paramount of convenience having to SSH on your server to run git pull origin master in some folder.) See Capistrano task cap sync:setup:hook for setting this up.

  • When you already use Git, you can push to Github (where else?), and have Github call Marley by it’s Post-Receive Hooks (github.com/guides/post-receive-hooks). Github then calls Marley’s /sync and it will git pull changes from Github. How is this authenticated? Good question. By setting up a (possibly long and secure) token in the config file. OMG! Could be overheard in the internets! If you’re worried or prudent, do not use this. (See Capistrano task cap sync:setup:github for adding remote Github repo on the server!)

You can set-up last two options by running Capistrano task cap sync:setup. Choose whether you like to upload your local data as a Git repository to the server (and setup post-receive hook in doing so) or you want to clone data from Github repository. You should add a Post-Receive URL in your repo’s administration on Github as told by the task when it has runned.

Of course, put other ideas in the Marley Wiki (github.com/karmi/marley/wikis)

Managing spam

Marley displays spam comments on the article page, by default. You can easily mark and delete spam in admin interface, when you prepend article URL with admin – as in localhost:4567/admin/my-slashdotted-article.html. Log in with credentials set in config.yml.

In addition, there are Rake and Capistrano tasks for easily destroying spam from command line or a cron job: rake manage:spam:prune and cap manage:spam:prune. You just lose “false positives” this way. But there aren’t much of them with Akismet.

Todo

  • Authenticate Github hook by HTTP-Auth, not token

  • Enable commenters edit their comments for 15 minutes after posting (based on cookie)

  • Kick Markdown formatting into a Formatter so everyone can use whatever formatter she likes

  • Kick articles extraction logic into an Interface so everyone can use whatever data store she likes, not being plain (texter) like me

Licence

Copyright © 2008 Karel Minarik (www.karmi.cz)

Code released under the MIT license, do not reuse graphical assets and styles in the restafari_org branch, please

marley's People

Contributors

karmi avatar gma avatar gf3 avatar

Stargazers

Andrew Johnson avatar zhjpaul avatar Lewis avatar Lydia Guchu avatar 曹文忠 avatar S_P avatar Angus H. avatar Karsten Gresch avatar Pavel avatar Tina A. avatar Daniel Bigler avatar Roberto Salas avatar  avatar Jesly Varghese avatar Gambhiro avatar Marcello Seri avatar 延 avatar Steven Lee avatar Marco avatar Nazeeruddin Ikram avatar Gabriel avatar Jo Meenen avatar Nurul Imam avatar  avatar Michael Reynolds avatar Magesh avatar Charles Shen avatar Sam avatar Abhijith Reddy avatar Drew Strojny avatar Gabe Hesse avatar Zachary Smith avatar  avatar tisa007 avatar Richard Hess avatar Ondra Beneš avatar 404 avatar  avatar Vasiliy Bukharev avatar flyabroad avatar Luke Morton avatar Nicholas Fowler avatar Braden Douglass avatar Tomas Svarovsky avatar Andreas Eger avatar Saggi Malachi avatar Derek Bender avatar Brad Johansen avatar  avatar Ninad avatar Benjamin Fleischer avatar Mark Woods avatar Fr. Mesrop Ash avatar  avatar Stephen Day avatar  avatar Petr Messner avatar Zifei Tong avatar Elliando Dias avatar Rob Rhyne avatar Richard Drake avatar Chris Blunt avatar Eric M avatar Andrew Ellis avatar Elvis Gratton avatar Richard Thorne avatar Ryan Mathews avatar Taurus Olson avatar maicos avatar Curt Hasselschwert avatar Elio Grieco avatar  avatar Tyler Nelson avatar Konstantin Tennhard avatar WssTeam avatar  avatar Hernán Sánchez Albert avatar Allen Madsen avatar Ben Lee-Cohen avatar Matías Iturburu avatar  avatar Scott Brisko avatar Nicholas Fine avatar yohei sugigami avatar Lonnon Foster avatar Faun avatar  avatar Mihail Szabolcs avatar Elle Meredith avatar Jason Harrelson avatar punkin avatar Ross Timson avatar Brian Haberer avatar cbmeeks avatar  avatar BJ Neilsen avatar  avatar Steve Murphy avatar Ken Liu avatar David Cizek avatar

Watchers

 avatar James Cloos avatar S_P avatar  avatar  avatar

marley's Issues

no such file to load -- config/app/marley (LoadError)

I followed the instructions, set up my app per the README, successfully deployed via capistrano, but I cannot start the server! I have no idea what gives! rake server:start appears to fire up thin, which immediately exits and dumps the following in thin's log file:

Exiting!
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require': no such file to load -- config/app/marley (LoadError) from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire'
from config/config.ru:6
from /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/builder.rb:46:in instance_eval' from /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/builder.rb:46:ininitialize'
from config/config.ru:1:in `new'
from config/config.ru:1

I have tried for hours to get this to work by moving files around (even trying to have config.ru in both APP_ROOT/ and APP_ROOT/config/), attempting to override the rackup path in a thin config file to no avail, and even updating the rack and thin gems on my server to their latest versions. Nothing seems to work!

The .txt files form data/ doesn't go to new posts

Hi, I've recently tried to check Marley on my local machine.

I'm a semi-noob, so I apologize for suggesting this issue if it is not important.

I've installed it (had to register at Akismet to get the key, otherwise rake aborts).

I've created a data/ folder and put a .txt file into it. No new posts. I reloaded the server (by the way can I use 'ruby marley.rb' to start the app on the local machine?).

After the reloading, no new posts appear. I even copied and pasted the text from the test article to preserve the markup, but still no new posts.

Sorry if it's a silly issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.