MojoMojo is a wiki written in Catalyst and DBIx::Class. It was the best choice to replace my private MediaWiki. The installation is straight forward:
svn co http://code2.0beta.co.uk/mojomojo/svn/trunk/ MojoMojo cd MojoMojo perl Makefile.PL makeThe standard way to install MojoMojo is through CPAN. You can find the distribution for it here, or you can install it from the command line like this:
sudo cpan MojoMojoAfter successful installation MojoMojo needs to be configured using its mojomojo.conf. Generally you can just edit this file directly, but if you're using the svn checkout and probably want to contribute some changes later you better go for a new mojomojo_local.conf. So you can have your database credentials in that file and you don't have to worry about committing it by accident.
<Model::DBIC>
connect_info dbi:mysql:mojomojo
connect_info mojomojo
connect_info sTrOnGpAsSwOrD
</Model::DBIC>
Create database tables:
./script/mojomojo_spawn_db.plDone. Now you can deploy MojoMojo using mod_perl, FastCGI or just run it using Catalysts development webserver:
./script/mojomojo_server -p 3000My previous MediaWiki installation was only accessible by username and password. So i needed to get my head around the authorization implementation in MojoMojo. First of all you need to add some lines to the config:
<permissions>
check_permission_on_view 1
cache_permission_data 1
create_allowed 0
delete_allowed 0
edit_allowed 0
view_allowed 0
attachment_allowed 0
</permissions>
Additionally there are a few database changes necessary:
-- add a new role
insert into role values (null, 'user', 1);
-- add this role to the standard admin user
insert into role_member values (1, 2, 1);
-- allow everything to that new role
insert into path_permissions values
('/', 1, 'no', 'yes', 'yes', 'yes', 'yes', 'yes');
insert into path_permissions values
('/', 1, 'yes', 'yes', 'yes', 'yes', 'yes', 'yes');
How does it look like now?
mysql> select * from role;
+----+------+--------+
| id | name | active |
+----+------+--------+
| 1 | user | 1 |
+----+------+--------+
mysql> select * from role_member;
+------+--------+-------+
| role | person | admin |
+------+--------+-------+
| 1 | 2 | 1 |
+------+--------+-------+
mysql> select * from path_permissions\G
*************************** 1. row ***************************
path: /
role: 1
apply_to_subpages: no
create_allowed: yes
delete_allowed: yes
edit_allowed: yes
view_allowed: yes
attachment_allowed: yes
*************************** 2. row ***************************
path: /
role: 1
apply_to_subpages: yes
create_allowed: yes
delete_allowed: yes
edit_allowed: yes
view_allowed: yes
attachment_allowed: yes
To get this working please make sure to use at least version 0.999018 or revision 927 of MojoMojo.
In next release of MojoMojo there will be also a new flag to enforce login:
<permissions>
enforce_login 1
</permissions>

Leave a comment