Browse the code

Revision log Information on the revision Clone the sources
Revision 601


Show the differences
* Started to develop the smartphone/screen-less-than-800px-wide CSS
You can get the sources via Subversion.


Download this file


This file is a step-by-step how to for install and set up CodingTeam on your
own server. Before read this document, you should install all dependencies
listed in the README file.
   1. Apache HTTPD configuration
You have to set up a VirtualHost for CodingTeam like this example:
  <VirtualHost *:80>
    DocumentRoot "/path/to/codingteam"
    <Directory /path/to/codingteam>
      AllowOverride All
      Require all granted
    <Directory /path/to/codingteam/public>
      php_flag engine off
      AllowOverride None
      Options -Indexes
    <Directory /path/to/codingteam/public/upload/projects/*/releases>
      Options +Indexes
    ErrorLog /var/log/apache2/error.log
    LogLevel warn
    CustomLog /var/log/apache2/access.log combined
    ServerSignature On
Now, you have to set up another VirtualHost for SVN repositories like this one:
  <VirtualHost *:80>
    include /path/to/codingteam/public/svn/_apache/*
    ErrorLog /var/log/apache2/error.log
    LogLevel warn
    CustomLog /var/log/apache2/access.log combined
And now, another VirtualHost for HG repositories:
  <VirtualHost *:80>
    include /path/to/codingteam/public/hg/_apache/*
    RewriteEngine on
    RewriteRule (.*) /path/to/codingteam/scripts/hg/hgwebdir.cgi/$1
    DocumentRoot /path/to/codingteam/scripts/hg
    <Directory "/path/to/codingteam">
      AllowOverride None
    <Directory "/path/to/codingteam/scripts/hg">
      Require all granted
      AllowOverride All
      Options ExecCGI FollowSymLinks SymLinksIfOwnerMatch
      AddHandler cgi-script .cgi
    ErrorLog /var/log/apache2/error.log
    LogLevel warn
    CustomLog /var/log/apache2/access.log combined
Last but not least, the configuration needed for Git repositories:
  <VirtualHost *:80>
    SetEnv GIT_PROJECT_ROOT /path/to/codingteam/trunk/public/git
    ScriptAlias / /usr/lib/git-core/git-http-backend/
    include /path/to/codingteam/trunk/public/git/_apache/*
    ErrorLog /var/log/apache2/error.log
    LogLevel warn
    CustomLog /var/log/apache2/access.log combined
Also, please be sure that mod_rewrite and mod_cgi are activated. You should
check that other Apache HTTPD modules you load are compatible with them.
To get Mercurial repositories working, you should create a configuration file
in scripts/hg/hgweb.config:
  $ mv hgweb.config-example hgweb.config
   2. Folders owners and rights
First of all, directories inc/modules must be writable by CodingTeam (in order
to enable and disable modules and views). This is not mandatory but this is
required to configure the modules directly from CodingTeam.
Basically, you can do a:
  $ chown www-data:root inc/modules/*/infos.xml
  $ chown www-data:root inc/data/*
Now, you have to create some directories in the public/ one.
The firsts have to be writable by PHP, so, you must do a chmod 770 and set the
owner www-data:root:
    → public/cache/atom
    → public/cache/rss
    → public/cache/xhtml
    → public/upload/avatars
    → public/upload/briefcase
    → public/upload/projects
    → public/upload/teams
    → public/codestats/temp
    → public/codestats/reports
For DVCS/VCS integration, you must create following directories. This allows
CodingTeam to create DVCS/VCS repositories in the public/ paths. Apache
configurations are stored in public/*/_apache and authentification files in
Just recursively set the owner www-data:root on these directory.
    → public/svn/_apache
    → public/svn/_authz
    → public/hg/_apache
    → public/hg/_authz
    → public/git/_apache
    → public/git/_authz
   3. CodingTeam configuration
CodingTeam use a XML-based configuration. There is an example in
inc/codingteam.cfg-example. Start by rename it:
  $ mv codingteam.cfg-example codingteam.cfg
Now, you can start to write your config (your XML-base file have to be conform
to the XSD XMLSchema).
Here a little explanations of the possibles values:
  db->type:                The software that run the database
                           There are only 1 database software supported:
                               * for MySQL 5.x:           `mysql`
                               * for PostgreSQL:          `pgsql`  PLANNED
  db->hostname:            The hostname of your mysql base
  db->database:            The name of the database 
  db->username:            The name of the user
  db->password:            The password of the user
  svn->subdomain:          Subdomain for SVN (second VirtualHost example)
  svn->location:           Text between subdomain and project name (default: /)
  hg->subdomain:           Subdomain for HG (third VirtualHost example)
  hg->location:            Text between subdomain and project name (default: /)
  git->subdomain:          Subdomain for Git (fourth VirtualHost example)
  git->location:           Text between subdomain and project name (default: /)
  auth->method:            The method used by users to login
                           There are 2 methods supported:
                               * by username/password:    `sql`
                               * by XMPP (XEP-0070):      `xmpp`
  errors->show_debug:      1 to show source code and memory dump on a error
  errors->catch_fatal:     1 to catch even PHP fatal errors
  errors->show_notice:     1 to show PHP E_NOTICE errors
  errors->log_errors:      1 to log all errors in a file
  errors->log_level:       -1, 0, 1, 2 or 3
  config->theme:           The template theme for your forge.
                           There's only 1 template distributed with CodingTeam:
                               * Default template:        `default`
  config->timezone         The default datetime timezone.
  config->mldomain         The domain name for mailing lists support.
 - You really should disable errors->show_debug in a production environement
   because some data in the dump can be very critical and a bad intent person
   can use them.
 - If you enable errors->show_notice boolean, notice errors will be displayed
   like every other errors (blocking and causing die), this is not recommanded
   in a production environement but is useful to debug. If you disable it,
   E_NOTICE errors can still be logged.
 - If you enable errors->log_errors boolean you should create an error.log
   file in the CodingTeam root directory and set www-data:root as owner of
   this file.
 - When you enable errors->log_errors, you should set an appropriate value for
   errors->log_level. It's an integer of the first error level to catch. So, if
   you want to log only critical (2) and internal errors (3), set it to 2. The
   recommanded value is 1, it catches important, critical and internal errors.
Now, you are ready to import the SQL shema in your database with the
codingteam.sql file!
When the SQL shema is imported, you should follow this final step to add a
minimal configuration for CodingTeam:
  INSERT INTO `config` (`group`, `field`, `value`, `text`) VALUES
  ('global', 'mailfrom', 'MyForgeName <>', 'The FROM and REPLYTO headers of sended mail.'),
  ('global', 'cache-max-files', '2000', 'The maximum files number for the cache.'),
  ('global', 'title', 'CodingTeam', 'The title of your forge.'),
  ('global', 'show-exectime', 'false', 'true or false if you want to hide execution time.'),
  ('global', 'force-login', 'false', 'true or false if you want to make your forge public.'),
  ('global', 'briefcase-max', '20', 'The maximum size (in Mo) allowed for each user\'s briefcase.'),
  ('global', 'authorize-anonymous-posts', 'true', 'Authorize content posted by anonymous.'),
  ('jabber', 'omnipresence-jid', '', 'The Jabber ID of the Omnipresence bot.'),
  ('jabber', 'omnipresence-url', '', 'The HTTP URL of the Omnipresence bot.'),
  ('jabber', 'server', '', 'The domain of the jabber server.'),
  ('jabber', 'muc', '', 'The Jabber ID of the conference component.'),
  ('jabber', 'username', 'username', 'The username of the bot.'),
  ('jabber', 'password', 'password', 'The password of the bot.'),
  ('jabber', 'nickname', 'nickname', 'The nickname of the bot.'),
  ('jabber', 'allow-notifications', 'false', 'true or false if you don\t want to allow notifications over XMPP.'),
  ('openforge', 'esearch-active', 'false', 'true or false if you want to disable external search.'),
  ('openforge', 'esearch-servers', '', 'A list of external servers, separated by a ";".'),
  ('projects', 'need-validate', 'true', 'true or false if you don\'t want to validate all new projects.'),
  ('projects', 'allow-adding', 'true', 'true or false if you don\'t want to disable projects adding.'),
  ('projects', 'allow-donation', 'false', 'true or false if you don\'t want to disable projects donation.'),
  ('projects', 'allow-private', 'false', 'true or false if you don\'t want private projects.'),
  ('users', 'allow-registration', 'true', 'true or false if you don\'t want to disable users registration.');
By default, omnipresence-jid and omnipresence-url are already set because
it's the only Omnipresence server we know. Omnipresence allows CodingTeam to
retrieve the avatar of a member via his Jabber account and some funny things
like that. You could install your own Omnipresence and use it instead of the
JabberFR ones. See:
   4. Internationalization
If you want to build translation files, you just have to go in scripts/i18n and
It will prompt you the language you want to construct (only french is available
at the moment) and it will create the file for this language.
That's all you need to do to translate your forge.
   5. Mailing Lists configuration
In order to make mailing lists work, you just have to configure your SMTP
server to forward mails to our script. Here's some rules to make this work with
the Postfix server.
Then, make sure your Postfix's contains:
  virtual_alias_maps = regexp:/etc/postfix/virtual-regexp
  transport_maps = hash:/etc/postfix/transport
The virtual-regexp file should contains:
  /^([-a-z0-9_]+)@lists\.example\.org$/ ctml
The transport one should contains: ctml:
You now have to add this line to your
ctml    unix    -       n       n       -       1       pipe
  flags=FRq user=www-data argv=/path/to/codingteam/scripts/miscellaneous/mailing-list.php
Finally you have to launch these commands:
  postmap hash:/etc/postfix/virtual-regexp
  postmap hash:/etc/postfix/transport
  postfix reload
   6. CodingTeam maintenance
At this step, CodingTeam is ready to work on your server. You just have to
configure a few recurring tasks.
1) XMPP notifications.
If you want your users to use XMPP notifications, you have to set the key
jabber.allow-notifications to TRUE in the configuration keys editor.
You also have to add a cron rule:
  */5 * * * * /path/to/codingteam/scripts/miscellaneous/xmpp-notifications.php
2) Apache HTTP reload for SCM.
You need to reload the configuration of the HTTPD server each time you add a
DVCS/VCS repository. That's why scripts/miscellaneous/ contains the Shell script.
While the server hasn't be reloaded, the new configuration file created with
the new repository isn't read and thus everyone have write access on them. The
solution is to use incron (packaged in a lot of GNU/Linux distributions).
Here are the rules that you can write in your incrontab:
  /path/to/codingteam/public/svn/_apache IN_CLOSE_WRITE /path/to/codingteam/scripts/miscellaneous/
  /path/to/codingteam/public/hg/_apache IN_CLOSE_WRITE /path/to/codingteam/scripts/miscellaneous/
  /path/to/codingteam/public/git/_apache IN_CLOSE_WRITE /path/to/codingteam/scripts/miscellaneous/
3) Generating statistics on the source code.
CodingTeam can generate statistics on the source code of the projects. In order
to get this feature working, you have to set up another cron rule, that will
get executed each weeks.
  0 0 * * 0 /path/to/codingteam/scripts/miscellaneous/code-stats.php
   7. Drink a beer!
Ok, you're done!
Once you did everything that came before, CodingTeam should work just fine. You
can now start Apache and discover your new forge. :)