MojoMojo - make it private

| | Comments (0) | TrackBacks (0)
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
make
The 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 MojoMojo
After 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.pl
Done. Now you can deploy MojoMojo using mod_perl, FastCGI or just run it using Catalysts development webserver:
./script/mojomojo_server -p 3000
My 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>

0 TrackBacks

Listed below are links to blogs that reference this entry: MojoMojo - make it private.

TrackBack URL for this entry: http://www.pqpq.de/mt-tb.cgi/2

Leave a comment

About this Entry

This page contains a single entry by Johannes Plunien published on July 17, 2008 6:38 AM.

Remote form validation is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.