Showing posts with label simile timeline. Show all posts
Showing posts with label simile timeline. Show all posts

Monday, October 3, 2011

Combating selinux for the timeline

That timeline that was being worked on ended up being hosted on foss.rit.edu, but getting it there took  nothing less than an arduous battle with selinux. I first created an alias so that I could put all my work in a single directory on a separate user account on the box, and tossed it into the right /etc/httpd/conf.d/ configuration file.



Alias /timeline "/home/myusraccount/timeline"

AllowOverride All
Options Indexes
order allow,deny
Allow from all



Any work from here on out could be tossed in /home/myusraccount/timeline/. While this is convenient, this posed a slight problem. The form I had created to give me an easy way to add events to my timeline posts its information to be handled by my python cgi script. This script gets effectively run as the "apache" user, and selinux has a slight problem allowing the apache user modify files inside /home/myusraccount/timeline.

First I changed the owner of the relevant file and the timeline directory file to the apache user. No luck.

I then tried to add apache and myusraccount to the same group, giving the group full permissions of the file and directory being touched by the cgi script. No luck.

For random kicks, I turned off selinux. That did the trick. Turning it back on, I tried to change the context of the files and directories myself, but couldn't get anything to work for the life of me. My mentors in the fossbox showed me a nifty tool, audit2allow, which allows users to generate allow rulesets for specific operations. This tool parses the logs for denied permissions messages, and can automatically generate exceptions to them. Basically do what you want to do, watch it fail, run audit2allow, and apply a rule. Of course, you'll want to be careful with the rule you do apply, since selinux could very well be protecting your machine from a big security risk.

Tuesday, September 27, 2011

RIT Remix Hosting and Interactive Timeline

The spin remix is now hosted. Thank you Ralph Bean for tossing that up! I hope that I'll have a chance to tinker with it in the future and make some improvements to it later. For now, there's a different task at hand.

One of the key things that is missing from the FOSS Box @ RIT is a slick timeline that can show the world what we've been up to - something that's polished and comprehensive. Remy Decausemaker's forked version of MIT's Simile Exhibit project fit the bill perfectly. The project uses a whole bunch of javascript magic to render its visuals, but at its source, generates its content from a single contributors file.

Adding entries to the timeline is trivial. It's just a matter of going from this and this to a series of formatted entries:


{    "type" :                  "Event",
     "label" :                 "ImagineRIT 2010",
     "discipline" :            "Event",
     "date" :                  "2010-05-01",
     "relationship" :          "Event",
     "relationship-detail" :   "ImagineRIT 2010",
     "imageURL" :              "Event.png",
     "url" :                   "http://www.rit.edu/imagine/"
},

Not a difficult process, but a time-consuming one. One that I'm not so willing to do in the future, so I decided to create a pretty simply html form that would let me enter entires. The form is simple HTML and creates a little something like this. After creating the form, I whipped up a simple CGI script in python, which has a module that makes form handling easy. Lastly, this form launches a simple script that appends entries to the contributor.js file.

This should save a lot of hassle in the future. Of course, I wasn't able to host this simple web service on my CS webspace, given the restricted permissions that disallowed me to create any sort of .htaccess file without a headache. Gives me a good opportunity to check out openshift which has been getting a lot of buzz lately.