Skip to content

jberger/Galileo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME

Galileo - A simple modern CMS built on Mojolicious

SYNOPSIS

$ galileo setup
$ galileo daemon

DESCRIPTION

Galileo is a Perl CMS with some unusual features. It uses client-side markdown rendering and websockets for saving page data without reloading. Galileo relies on many other great open-source projects, see more in the "TECHNOLOGIES USED" section.

DISCOURAGED

Galileo was an experiment in several technologies, in ways that I had hoped would be interesting. I'm not certain it worked out. Websockets are overused, the ORM is abused in certain ways. I'm not going to officially deprecate it (yet) but I don't encourage new users. I do eventually hope to try my hand at a CMS again, but in the meantime perhaps consider Yancy.

INSTALLATION

Galileo uses well-tested and widely-used CPAN modules, so installation should be as simple as

$ cpanm Galileo

when using App::cpanminus. Of course you can use your favorite CPAN client or install manually by cloning the "SOURCE REPOSITORY".

SETUP

Environment

Although most of Galileo is controlled by a configuration file, a few properties must be set before that file can be read. These properties are controlled by the following environment variables.

GALILEO_HOME

This is the directory where Galileo expects additional files. These include the configuration file and log files. The default value is the current working directory (cwd).

GALILEO_CONFIG

This is the full path to a configuration file. The default is a file named galileo.conf in the GALILEO_HOME path, however this file need not actually exist, defaults may be used instead. This file need not be written by hand, it can be generated as a result of running the galileo config command.

The galileo command line application

Galileo installs a command line application, galileo. It inherits from the mojo command and so provides all those commands, but it provides extra functions specifically for use with Galileo.

setup

$ galileo setup

This command starts the app in setup mode. It can write a configuration file, and setup or upgrade the database.

This step is required after both installation and upgrading Galileo, because the database page will deploy or upgrade the database used by your Galileo site. It will use the default DBI settings (SQLite) or whatever is setup in the GALILEO_CONFIG configuration file.

Warning: As usual, proper care should be taken when upgrading a database. This mechanism is rather new and while it should be safe, the author makes no promises about anything yet! Backup files and database before upgrading!

Although Galileo does not need to be configured, it is recommended to do so to set your application's secret. The secret can be any string, however stronger is better. You do not need to memorize it or even remember it. This secret protects the cookies employed by Galileo from being tampered with on the client side.

Notes:

  • The database deployment tools may emit debugging information unexpectedly to your terminal, especially messages about "overwriting" and some internal "peek" information. These message are harmless, but as yet cannot be suppressed.

  • Upgrading database schemas from before Galileo version 0.012 (when schema versioning was introduced) is no longer supported as of version 0.037. The process wasn't testable anyway.

dump

$ galileo dump
$ galileo dump --directory pages -t
$ galileo dump --directory pages -t --encoding utf-8

This tool dumps all the pages in your galileo site as markdown files. The directory for exporting to may be specifed with the --directory or -d flag, by default it exports to the current working directory.

The title of the page is by default includes as an HTML comment. To include the title as an <h1> level directive pass --title or -t without an option. Any other option given to --title will be used as an sprintf format for rendering the title (at the top of the article).

The document will be encoded as UTF-8 by default, if other encoding of the content is desired, use --encoding or -e flag. Available value of the --encoding is same as Encode module of Perl.

RUNNING THE APPLICATION

$ galileo daemon

After the database has been setup, you can run galileo daemon to start the server.

You may also use morbo (Mojolicious' development server) or hypnotoad (Mojolicious' production server). You may even use any other server that Mojolicious supports, however for full functionality it must support websockets. When doing so you will need to know the full path to the galileo application. A useful recipe might be

$ hypnotoad `which galileo`

where you may replace hypnotoad with your server of choice.

Logging

Logging in Galileo is the same as in Mojolicious. Messages will be printed to STDERR unless a directory named log exists in the GALILEO_HOME path, in which case messages will be logged to a file in that directory.

Extra Static Paths

By default, if Galileo detects a folder named static inside the GALILEO_HOME path, that path is added to the list of folders for serving static files. The name of this folder may be changed in the configuration file via the key extra_static_paths, which expects an array reference of strings representing paths. If any path is relative it will be relative to GALILEO_HOME.

Upload Path

By default, if Galileo detects a folder named uploads inside the GALILEO_HOME path, that path is used for uploads, specifically user-uploaded images. This path is added to the static files. The name of this folder may be changed in the configuration file via the key upload_path, which expects a string representing the path. If the path is relative it will be relative to GALILEO_HOME.

NOTE: as for this writing, this option doesn't do anything but append to the static files paths. Eventually it will be where uploads go, but NOT YET!

CUSTOMIZING

The "config" keys extra_css and extra_js take array references pointing to CSS or Javascript files (respectively) within a static directory. As an example, the default extra_css key contains the path to a simple theme css file which adds a gray background and border to the main container.

As yet there are no widgets/plugins as such, however a clever bit of javascript might be able to load something.

TECHNOLOGIES USED

  • Mojolicious - a next generation web framework for the Perl programming language

  • DBIx::Class - an extensible and flexible Object/Relational Mapper written in Perl

  • PageDown (Markdown engine) - the version of Attacklab's Showdown and WMD as used on Stack Overflow and the other Stack Exchange sites

  • PageDown Extra - Markdown Extra Plugins for Pagedown

  • Bootstrap - the beautiful CSS/JS library from Twitter

  • jQuery - because everything uses jQuery

  • html5sortable - Lightweight jQuery plugin to create sortable lists and grids using native HTML5 drag and drop API

  • HumaneJS - A simple, modern, browser notification system

SEE ALSO

SOURCE REPOSITORY

http://github.com/jberger/Galileo

Travis CI build status

AUTHOR

Joel Berger, <[email protected]>

CONTRIBUTORS

Boris Däppen

Helmut Wollmersdorfer

Holger Rupprecht

Irfan Afifullah

Keedi Kim

Neil Bowers

Nils Diewald

OpossumPetya

Sergey Rubanov

COPYRIGHT AND LICENSE

Copyright (C) 2012-2014 by "AUTHOR" and "CONTRIBUTORS"

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.