forked from jrockway/angerwhale
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: svn://svn.jrock.us/blog_software@391 c7da345c-2a10-0410-88b2-338622cc0b2c
- Loading branch information
jon
committed
Feb 9, 2007
1 parent
237c14a
commit 9400a74
Showing
166 changed files
with
16,144 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Makefile.PL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
This file documents the revision history for Perl extension Blog. | ||
|
||
0.01 Sun Mar 19 21:33:03 2006 | ||
- initial revision, generated by Catalyst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
use inc::Module::Install; | ||
use strict; | ||
use warnings; | ||
require 5.008006; | ||
|
||
name('Angerwhale'); | ||
abstract('exciting new weblogging software or something'); | ||
author('Jonathan Rockway <jrockway@cpan.org>'); | ||
version_from('lib/Angerwhale.pm'); | ||
include('ExtUtils::AutoInstall'); | ||
licence('gpl'); | ||
|
||
requires | ||
( | ||
'Catalyst' => '5.7', | ||
'Catalyst::View::TT::ForceUTF8' => 0, | ||
'Catalyst::Plugin::Cache::FastMmap' => 0, | ||
'Catalyst::Plugin::ConfigLoader' => 0, | ||
'Catalyst::Plugin::ConfigLoader::Environment' => '0.01', | ||
'Catalyst::Plugin::DefaultEnd' => 0, | ||
'Catalyst::Plugin::Prototype' => 0, | ||
'Catalyst::Plugin::LogWarnings' => 0, | ||
'Catalyst::Plugin::Scheduler' => '0.07', | ||
'Catalyst::Plugin::Setenv' => 0, | ||
'Catalyst::Plugin::Static::Simple' => 0, | ||
'Catalyst::Plugin::Unicode' => '0.2', | ||
'Catalyst::Plugin::Session::Store::File' => 0, | ||
'Catalyst::Plugin::Session::State::Cookie' => 0, | ||
'Catalyst::Plugin::Session' => 0, | ||
'Catalyst::Model::XML::Feed' => '0.01', | ||
'Class::C3' => 0, | ||
'Crypt::Blowfish' => 0, | ||
'Crypt::CAST5_PP' => 0, | ||
'Crypt::DES_EDE3' => 0, | ||
'Crypt::OpenPGP' => '1.03', | ||
'Crypt::RIPEMD160' => 0, | ||
'Crypt::Random' => '1.25', | ||
'Crypt::Rijndael' => 0, | ||
'Crypt::Twofish' => '2.00', | ||
'Data::GUID' => '0.04', | ||
'Digest::MD5' => 0, | ||
'Digest::SHA1' => 0, | ||
'File::Attributes' => 0, | ||
'File::Attributes::Recursive' => 0, | ||
'File::CreationTime' => '2.03', | ||
'File::Find' => 0, | ||
'File::Slurp' => '9999.12', | ||
'File::Temp' => 0, | ||
'HTML::TreeBuilder' => 0, | ||
'HTTP::Date' => 0, | ||
'Module::Pluggable' => 0, | ||
'NEXT' => '0.60', | ||
'Pod::Xhtml' => 0, | ||
'Pod::Simple::Text' => 0, | ||
'Quantum::Superpositions' => 0, | ||
'Scalar::Util' => 0, | ||
'Syntax::Highlight::Engine::Kate' => 0, | ||
'Template::Plugin::Lingua::EN::Inflect' => 0, | ||
'Template::Plugin::Filter' => 0, | ||
'Text::Autoformat' => 0, | ||
'Text::WikiFormat' => '0.77', | ||
'TeX::Hyphen' => 0, | ||
'Time::Duration' => 0, | ||
'URI' => 0, | ||
'URI::Escape' => '3.28', | ||
'XML::Atom::SimpleFeed' => '0.8', | ||
'XML::Feed' => '0.11', | ||
'YAML' => '0.60', | ||
'YAML::Syck' => '0.71', | ||
'base' => 0, | ||
'version' => 0, | ||
'Crypt::IDEA' => 0, | ||
'IO::String' => 0, | ||
); | ||
build_requires | ||
( | ||
'Test::More' => 0, | ||
'ok' => 0, | ||
'Directory::Scratch' => '0.12', | ||
'Test::HTML::Tidy' => 0, | ||
'HTML::Tidy' => 0, | ||
'Test::XML::Valid' => 0, | ||
'Test::YAML::Valid' => '0.02', | ||
'Test::WWW::Mechanize::Catalyst' => 0, | ||
); | ||
|
||
feature('Speed up crypto', ['Math::BigInt::GMP' => 0]); | ||
|
||
catalyst(); | ||
install_script(glob('script/*.pl')); | ||
auto_install(); | ||
license('GPL'); | ||
tests('t/*/*.t'); | ||
write_revision() if !-e 'root/revision.tt'; | ||
WriteAll( sign => 1, meta => 1 ); | ||
catalyst_par_core(); | ||
catalyst_par(); | ||
|
||
sub write_revision { | ||
# finally, dump the $Revision: $ to a template | ||
print "Dumping repository revision number to root/revision.tt\n"; | ||
eval { | ||
open(my $r, '>', 'root/revision.tt') | ||
or die "Couldn't open root/revision.tt: $!"; | ||
|
||
my $revision; | ||
if(-d '.svn'){ | ||
$revision = `svn info | grep Revision`; | ||
} | ||
else { | ||
$revision = `svk info | grep Mirrored.From`; | ||
} | ||
|
||
$revision =~ /(\d+)$/; | ||
die "No revision in repository! (got: $revision)" if !$1; | ||
|
||
print {$r} "$1" or die "Write error: $!"; | ||
close $r or die "Couldn't close file: $!"; | ||
}; | ||
if ($@){ | ||
warn $@; | ||
eval { | ||
open(my $r, '>', 'root/revision.tt') | ||
or die "Couldn't open root/revision.tt: $!"; | ||
print {$r} "UNKNOWN" or die "Write error: $!"; | ||
close $r or die "Couldn't close file: $!"; | ||
} | ||
} | ||
warn $@ if $@; # from the second eval | ||
|
||
# if this fails, we'll just use the revision.tt that is bundled. | ||
} | ||
|
||
sub MY::postamble { | ||
return <<'POSTAMBLE'; | ||
run: | ||
script/angerwhale_server.pl -r -d | ||
profile: | ||
perl -d:DProf script/angerwhale_server.pl -d | ||
POSTAMBLE | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Run script/blog_server.pl to test the application. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
title: Angerwhale | ||
description: Welcome to Angerwhale. You should change this. | ||
author: Your Name | ||
contact: nobody@example.com | ||
base: /var/blog | ||
sidebar_picture: ~ | ||
date_format: %c | ||
language: en-us | ||
feeds: ~ | ||
#feeds: | ||
# - title: "delicious" | ||
# location: "http://del.icio.us/rss/jrockway" | ||
# - name: "my TODO List" | ||
# location: http://hiveminder.com/let/jon%40jrock.us/feed/format/atom/tokens/not%20complete%20owner%20me%20starts%20before%20tomorrow%20accepted%20but_first%20nothing/e6334a62afaa66e6 | ||
max_feeds: 15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,213 @@ | ||
package Angerwhale; | ||
|
||
use strict; | ||
use warnings; | ||
use File::Temp qw(tempdir); | ||
use Catalyst qw/Unicode ConfigLoader Static::Simple | ||
Cache::FastMmap Setenv | ||
Session::Store::File Session::State::Cookie Session | ||
ConfigLoader::Environment/; | ||
#XXX: add C3 and LogWarnings back | ||
|
||
our $VERSION = '0.02'; | ||
|
||
binmode STDOUT, ':utf8'; | ||
|
||
__PACKAGE__->config->{session} = {flash_to_stash => 1}; | ||
|
||
__PACKAGE__->config({name => __PACKAGE__}); | ||
__PACKAGE__->config->{static}->{mime_types} = | ||
{ | ||
svg => 'image/svg+xml', | ||
js => 'text/javascript', | ||
}; | ||
__PACKAGE__->config->{cache}->{storage} = tempdir(CLEANUP => 1); | ||
__PACKAGE__->config->{cache}->{expires} = 43200; # 12 hours | ||
|
||
__PACKAGE__->config({VERSION => $VERSION}); | ||
|
||
__PACKAGE__->setup; | ||
|
||
1; | ||
|
||
__END__ | ||
=head1 NAME | ||
Angerwhale - filesystem-based blog with integrated cryptography | ||
=head1 SYNOPSIS | ||
Angerwhale is bloging software that reads posts from the filesystem, | ||
and determines authorship based on the post's PGP digital signature. | ||
These posts can be in a variety of formats (text, wiki, HTML, POD), | ||
and new formats can be added dynamically at runtime. Posting comments | ||
is also supported, and again, authorship is determined by checking | ||
the digital signature. | ||
Features include guaranteed valid XHTML 1.1 output, social tagging, | ||
categories, syntax highlighting (see | ||
L<http://blog.jrock.us/articles/Syntax%20Highlighting.pod> for | ||
details), RSS and YAML feeds for every article, comment, tag, and | ||
category, nested comments, intelligent caching of I<everything>, | ||
space-conserving mini-posts, search-engine (and human!) friendly | ||
archiving, a flashy default theme, and B<lots of other cool stuff>. | ||
=head1 GETTING STARTED | ||
Trying Angerwhale is pretty simple. Download the tarball from | ||
CPAN, and extract it. Then, run | ||
$ perl Makefile.PL | ||
$ make | ||
This will install any necessary dependencies (there are a few). Once | ||
that's finished, open up the config file C<angerwhale.yml> and change | ||
the C<base> to where you want to store blog posts -- the directory | ||
must exist or the tests will fail. | ||
After that, run | ||
$ make test | ||
which will run the test suite to make sure Angerwhale works on your | ||
system. If all goes well, open up the config file, C<angerwhale.yml>, | ||
and customize the other options to your heart's content. (There are | ||
more config options than those listed; for now grep the source for | ||
"config" to find them all. You shouldn't need to change the defaults, | ||
though; they're reasonable.) | ||
The final step is to run: | ||
$ perl script/angerwhale_server.pl | ||
You'll then be able to connect to L<http://localhost:3000> and see | ||
your blog. Add a file to the C<base> you set up earlier, and you'll | ||
see it rendered as a blog post. Edit it, and watch Angerwhale update | ||
the modification time (but preserve the creation time). Sign it, and | ||
watch your name show up on the post. Log in (on the login page), and | ||
add tags. Create a subdirectory in C<base>, symlink some posts into | ||
it, and watch them show up in a new category. Try posting some | ||
comments. | ||
There's tons more you can do, so explore the code or join the IRC | ||
channel! Enjoy! | ||
=head1 DEPLOYMENT | ||
Angerwhale is a L<Catalyst|Catalyst> application, so if you'd like to | ||
run it in a production environment, check out the | ||
L<Catalyst deployment manual|Catalyst::Manual::Deployment>. | ||
Basically, you can run it as a FastCGI, mod_perl, or plain CGI. | ||
=head1 RESOURCES | ||
=over 4 | ||
=item * | ||
IRC channel at L<irc://irc.perl.org/#angerwhale> or perhaps | ||
L<irc://irc.perl.org/#catalyst>. (The author is "jrockway".) | ||
=item * | ||
Wiki and source code browser is at L<http://trac.jrock.us/blog_software>. | ||
=item * | ||
The Offical Angerwhale Blog (tm) is at | ||
L<http://blog.jrock.us/categories/Angerwhale>. It's updated pretty | ||
frequently, and always has some interesting Angerwhale tips. (And of | ||
course, it's running Angerwhale.) | ||
=back | ||
=head1 TODO | ||
Lots of things TODO. Patches welcome; but ask on IRC before you get | ||
started. I'll give you a commit bit so you can work at your leisure. | ||
=over 4 | ||
=item * | ||
Image support. Support loading OO.org or RTF documents with embedded images, | ||
and then resize them to look nice at web resolution. | ||
=item * | ||
ACLs. Based on the logged-in user's key, restrict posting or allow | ||
them to post. Allow administrators to delete SPAM posts, etc. | ||
=item * | ||
Spam filtering. | ||
=item * | ||
More tests. Test coverage is pretty good (85% or so), but 100% is the goal. | ||
=item * | ||
More docs. Angerwhale has a lot of nice features, but you'll only | ||
know about them if you're me, or you hang out on IRC when I'm | ||
implementing them. If you're reading the code and see something you | ||
like, send a short snippet of POD to add to the docs! I'll love you | ||
forever if you do! | ||
=back | ||
=head1 BUGS | ||
Although Angerwhale's not yet feature complete, the code that exists | ||
is pretty solid (it's been in use for almost a year). | ||
If you'd like to request a feature or report a bug, either open an RT | ||
ticket, or join C<#angerwhale> on C<irc.perl.org>. Thanks in advance | ||
for your contribution. | ||
=head1 AUTHOR | ||
Jonathan Rockway C<< <jrockway AT cpan.org> >> | ||
L<http://blog.jrock.us/> | ||
=head1 CONTRIBUTORS | ||
These people have been nice enough to test Angerwhale and provide | ||
patches when something didn't work quite right: | ||
=over 4 | ||
=item * | ||
Ash Berlin - L<http://perlitist.com/> | ||
=item * | ||
Bogdan Lucaciu - L<http://blog.wiz.ro/> | ||
=back | ||
Thanks! | ||
=head1 COPYRIGHT | ||
Copyright (C) 2007 Jonathan Rockway and Contributors | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2, or (at your option) | ||
any later version. | ||
This program is distributed in the hope that it will be useful, but | ||
WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program; if not, write to the Free Software | ||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
USA. | ||
=cut |
Oops, something went wrong.