Please Refer to labs.riseup.net/crabgrass/documentation for the latest¶
Crabgrass is a software libre web application designed for group and network
organizing, and tailored to the needs of the global justice movement. The long
term goal is to provide the technical tools to facilitate active, confederal,
and directly democratic social change networks.
- for running the sphinx search daemon, see doc/SPHINX_README
- for adminstration notes, see doc/ADMIN_README
- for details about what the gems are used for, see doc/GEMS_README
- for multilingual support, see doc/MULTILINGUAL_README
- for plugin details, see vendor/plugins/README
- for more information on crabgrass, visit we.riseup.net/crabgrass
INSTALL FOR DEVELOPMENT¶
prepare your environment¶
For more details, see docs/ASSETS_README.
Additional packages may be required for special features of crabgrass. See the
README files in the docs folder.
These gems are required:
gem install -y rails rmagick tzinfo RedCloth ruby-debug hpricot mime-types haml --no-ri --no-rdoc
These gems are optional:
gem install mime-types ruby-debug hpricot nokogiri launchy chronic packet --no-ri --no-rdoc
See GEMS for a description of what these gems are used for.
grab the code¶
To get a copy of the most recent code:
git clone git://labs.riseup.net/crabgrass.git
Make sure your git-core is a version => 220.127.116.11
See labs.riseup.net/code for information on releases.
setup mysql database¶
Start Mysql Damean and check
You can check to see if its running "ps aux | grep mysql”
ps aux | grep mysql
create the databases:
mysqladmin -u root -p create crabgrass_development mysql -u root -p -e 'GRANT ALL PRIVILEGES ON crabgrass_development.* TO crabgrassdevuser@localhost IDENTIFIED BY '"'1rdbp2Ucl8taZppPqcL8'"
(use only needed databases. obviously, choose a unique password on that last line)
When you are editing config/database.yml, set up the database name, user and password you just created as root in the “development” stanza.
codetitle. X.509 SHA1 fingerprint for code.autistici.org (prompted during svn step) should match:
There is a sample database configuration file in the ‘config’ directory of the
crabgrass application. Use that to create a config/database.yml file. For some
linux distributions, you may need to specify a socket file for mysql like so:
“socket: /var/run/mysqld/mysqld.sock”. You can probably figure out what socket
to use by running “ps -ef | grep mysql”.
There is a sample database configuration file in the config directory of the crabgrass application. Use that to create a config/database.yml file:
cd crabgrass/config cp database.yml.example database.yml
For development mode, the example database.yml should be good to go, unless you have a set a password for mysql.
There are several required configuration files:
As a non-privileged user run in the crabgrass directory:
editor config/database.yml # and above the ther other config files accordingly ln -s /usr/share/rails vendor/
From inside crabgrass directory run these commands.
You might have to fix permission on this file crabgrass/log/development.log. run chmod 0666
export RAILS_ENV=production # just for development, of course rake create_a_secret rake db:schema:load # load the crabgrass schema rake db:migrate # upgrade the crabgrass database after pulling in new code rake db:fixtures:load rake cg:load_default_data # populate it with test data
For some linux distributions, you may need to specify a socket file for mysql like so: socket: /var/run/mysqld/mysqld.sock. You can probably figure out what socket to use by running ps -ef | grep mysql.
Also, ‘rake —version’ must be 0.8.1 or greater.
To upgrade the crabgrass repository later:
git pull rake db:migrate
Start it Up
This will run crabgrass in development mode, which is probably what you want. If
you don’t want to use webbrick (the mini-web-server that comes with rails) you
can install the mongrel gem or debian package. If installed, script/server will
pick them instead.
If you have run ‘rake db:fixtures:load’, there will be a bunch of test data
loaded, including users. To get started, you can login as user ‘blue’ with
rake db:test:prepare rake test
A great deal of the crabgrass code is in the form of engines-enhanced
and crabgrass-specific plugins. See mods/README and tools/README for
more information. To run the tests for these special plugins:
To run the test for a particular tool or mod:rake test:tools TOOL=gallery_tool rake test:mods MOD=gibberize
You should now be able to connect to http://localhost:3000/, which will be your development instance.
Things that are still needed¶
- tzinfo is still being installed as a gem. can this be debianized? i haven’t found any indication that anyone is packaging it yet.
- this doesn’t cover ferret
- this doesn’t cover latex integration
INSTALL FOR PRODUCTION¶
If you are not running over https only, then you must comment out this line in
Crabgrass::Config.https_only = true
It is important that you specify your own secret in the sites.yml file.
You can use ‘rake secret’ to generate a secret value.
mysql5 -u root create database crabgrass_test; create database crabgrass_development; flush privileges;
If your mysql root user has a password, don’t leave the password field blank. Alternately, you can create a crabgrass user in mysql.
For installing on a production server, most everything is the same
as a development setup except for these differences.
For development work, there is not much need to create a database user for
crabgrass. For deployment, however, this is a typical permissions setup:
Edit config/database.yml accordingly.
To create the production database is the same as for development, except
that we don’t want to load the test fixture data:
cd ~/development/crabgrass rake db:schema:load RAILS_ENV=production #rake cg:load_default_data RAILS_ENV=production # this should not be necessary
create your sites with
rake cg:site:create NAME=weltladen RAILS_ENV=production
Copy template database.yml:
cp config/database.yml.example config/database.yml
Edit database.yml so that it looks like this:
development: encoding: utf8 adapter: mysql database: crabgrass_development username: root password: host: localhost socket: /opt/local/var/run/mysql5/mysqld.sock test: encoding: utf8 adapter: mysql database: crabgrass_test username: root password: host: localhost socket: /opt/local/var/run/mysql5/mysqld.sock production: encoding: utf8 adapter: mysql database: crabgrass username: root password: host: localhost socket: /opt/local/var/run/mysql5/mysqld.sock
running background tasks¶
There are many tasks which crabgrass needs to run regularly in the background,
including cleaning out cache files and recreating the sphinx index.
These tasks will be run if you have backgroundrb running. You can configure the
frequency of these tasks by editing config/backgroundrb.yml.
First, install the backgroundrb requirements:
sudo gem install chronic packet --no-ri --no-rdoc
h2. running sphinx
Sphinx must be running when crabgrass is started for it to be used. If sphinx
searchd daemon is not detected, then crabgrass will not use fulltext searching.
First make sure that you have an up to date sphinx database:
rake ts:index RAILS_ENV=production
Then to start sphinx, run this:
rake ts:start RAILS_ENV=production
h2. other tips
You can run analysis on the logs using pl_analyze if the ‘SyslogLogger’
gem is installed.
There is an example capistrano deploy.rb in the config directory.
Mysql DB Problem: http://www.bluestatic.org/blog/2007/12/04/mysql-in-leopard/
If you get:
extconf.rb:11:in `require': no such file to load -- mkmf (LoadError)
…then you need also to install ruby1.8-dev.
Via the console¶
One goal in Crabgrass system design is to avoid creating different levels of
privilege for users. Shall this be an egalitarian social network, or shall we
build another anarchist bureaucracy? But what about when people need a new
Example: RESETING A PASSWORD
$ script/console production >> u = User.find_for_forget("user's email") >> u.password = u.password_confirmation = "new password" >> u.save
h2. Via super_admin mod
There is a mod that is disabled by default that gives certain users
a super admin interface.
(1) Edit config/sites.yml to add which users should be super admins
(2) Edit config/mods_enabled.list to enable super_admin module
(3) Edit config/routes.rb and uncomment the super_admin routes
(4) restart rails, login, and browse to /admin
gem install mongrel
lets you output to the console when running lightppd
See also crabgrass-install-on-debian-lenny
i just installed it in ubuntu 7.04 (i hate those names)
– i compiled and installed imagemagick from the source, because the repository only had version 6.2.4 and minimal requirement is 6.3. i got it from here www.imagemagick.org/script/install-sour...
then it ran smoothly!
i’m using hardy heron beta—still a little buggy, but at least my ati graphics card is working now.
apt-get gs-esp (The Ghostscript PostScript interpreter – ESP version) for pdf previews
on debian lenny it kicked an error when running gem install rmagick:
I still can’t get my lenny install to work. It kicks this error:
if ubuntu is giving you an error about openssl, try this:
This is on lenny. I installed that package, same error. Then I ran script/backgroundrb as superuser. Now it kicks this error:
the gem ‘haml’ is now reguired. i updated the README but forgot to update this wiki page.