It turns out installing plugins, and particularly the openid plugin, on a shared dreamhost environment is arduous at best. �After a bit of work and research I managed to get it to work so here you go:
I. Perform a one-click install of trac from the web panel
if you don’t know how to do this you shouldn’t even try to proceed.
II. Setup a virtual python environment
Having a shared account with no sudo access you need to setup a local python environment to do all of the building. I found a reference here
on how to do that. Here are the steps
III. Build the plugin
hg clone http://bitbucket.org/Dalius/authopenid-plugin/
python setup.py install –prefix=$HOME
cp ~/lib/python2.4/site-packages/*.egg <your_trac>/plugins
For more info see this
IV. Configure openid
add the following lines:
trac.web.auth.* = disabled
authopenid.* = enabled
see the above article for more config options.
V. Install Element Tree
As of this writing, element tree
was not installed in the dream host system python cache. �In order to get around this do the following:
In order to get our trac instance to pick up this library, we need to package it as an egg
edit its setup.py
from distutils.core import setup, Extension
from setuptools import setup, Extension
python setup.py bdist_egg
cp dist/*.egg <your_trac>/plugins
you now have all of the files installed you need to run openid on trac
VI. Creating the plugin schema
If you go to you project home page and you see the message:
TracError: The Trac Environment needs to be upgraded.
Then like me you need to initialize the SQL tables used by the python-openid plugin. If that is the case then do the following:
CREATE TABLE oid_nonces(server_url VARCHAR);
CREATE TABLE oid_associations(server_url VARCHAR(2047),handle VARCHAR(255),secret BLOB(128),issued INTEGER,lifetime INTEGER,assoc_type VARCHAR(64),PRIMARY KEY (server_url, handle));
See the�source code
for more info. Now we need to “upgrade” the schema
tar xzvf python-openid-2.2.4.tar.gz
on the above line you must
use the absolute path
to your trac instance. No using ~ as a home dir shortcut.
This should run successfully.If the output of that command is �”no such table oid…” Then something was messed up with using sqllite. Go back in and use the command .tables and make sure the two tables are there. If not, re-run the create table commands and look for error messages.
DONE! You should now be able to log in to your trac instance.
VII. Setting OpenId permissions in trac
Setup your account with permissions.ant more? log in and check trac.log
change the logging section so it looks like this:
log_file = trac.log
log_level = DEBUG
log_type = file
save and exit. Now:
tail -n 200 -F <your_trac>/log/trac.log
Next log in to your trac instance (using a web browser) using a openid account.
You’ll see something like�Retrieving session for ID u’http://xxxxxxxxxxxxxxxxxxxxxxxxx’
Everything between the single quotes is your account name. Now we can use trac-admin to give our openid account some permissions:
permission add <account_name> <PERMISSION>
where permission is something �like TRAC_ADMIN. �Use the command permission list to see currently assigned permissions
One thing I dislike about the one click install is it messes up the logo area. �Here’s a simple fix
after the line
RewriteCond $1 !^htdocs(.*).png$
add the line
RewriteCond $1 !^chrome(.*).png$
save and the logo should now show up.
Good luck. let me know if you run into other stumbling blocks and I’ll update the instructions.