[chora] Chora, Mime Types and File Extensions

Ryan Creasey rcreasey at ign.com
Mon Sep 26 22:06:33 PDT 2005


I'm working on setting up chora to be the Subversion repository browser for a linux admin team and I'm having a bit of difficulty getting Chora to source some of my files properly.  The files are almost entirely bash scripts, perl scripts, config files (think httpd.conf), or RPM SPEC files for our custom built RPMs.  Usually one of three things will happen:
 
1. the file will output entirely blank, without any of the horde templates being parsed and the file is sent plaintext, as if it were passing the GET directly to apache and it parses it as text/plain.
2. the file will be output in the chora co format (where it includes the templates), but there aren't any line numbers and the font used isn't a fixed-width font (which looks goofy on some files).
3. The file will be output, the horde interface is parsed, but none of the file is sourced.  There will be just a blank box where the file contents usually are.
 
I know enough about horde to know that it defines its mime types in horde/config/mime_drivers.php, and there are different drivers for mime header types.  What I'm confused about is how it associates files with that mime type.  Does it do it by file extension?  Does it rely on apache to dictate mime type?
 
If I had a bash script named 'dnsedit' (withouth a .sh), but the first line of the file is "#!/bin/bash", is it possible to have it detect along this line?  Let's just say I want chora to default to using enscript for all it's source formatting (its output is purty). How would I add support for files like this, or ones with extensions like '.conf', '.spec', etc?
 
Any help would be appreciated.
 
--
Ryan C. Creasey
Systems Administrator
IGN Entertainment


More information about the chora mailing list