Savannah Internals
This page describes inner workings of the GNU Savannah platform (web frontend + backend processes).
Some terminology
- GNU Savannah (or just Savannah)
- The name of the entire platform, encompassing the various hosts (see SavannahArchitecture), services (see SavannahServices), people (see SavannahTeam) and other odds and ends.
- Savane (French for 'savannah')
- The code name for the source code which runs many parts of the Savannah platform (most notably: the web frontend at savannah.gnu.org).
While usually these are distinguished, they are sometimes used interchangeably, and should be appropriately understood by the context.
- groups
- In savane code, software development projects are an informal subset of "groups" (examples of groups that are not projects in that sense are GNU and FSF audio and video and the Spanish GNU Translation Team. The database table is named `groups`, and several PHP files are named `groupXXX.php`. `group_id=N` in URLS refer to group internal ID.
- Savannah Administrators
- Volunteers with special access permissions on the Savannah frontend website (see 'becoming super-user' below) and administrator ssh access to the Savannah hosts. See SavannahTeam and List of current administrators.
- Group Administrators
- Savannah users who have administrative access to their group. As an example, these people are group administrators for GNU AWK.
Savannah source code
The source code for the PHP frontend and most of the backend
scripts is available at Savane Git
repository.
N.B. That's the administration
group, and the
git repository named savane
within it.
This repository is the only official one.
Warning about repositories
There are several other
repositories/clones/forks which look like the savane repositories (e.g.,
savane-cleanup).
All code running on Savannah hosts comes from the administration
group, using
several version control systems there: git, cvs, subversion; each of
which holds different stuff.
Savannah hosts
See SavannahArchitecture and SavannahServices.
Workflow - overview
- A user submits a new group. Savannah administrators approve the group (see ApprovingSubmission).
- Group administrators of existing group can change group settings (e.g., add a mailing list, switch from cvs to git, etc.).
- The PHP code on
frontend
updates the MySQL database, and optionally runs one-time creation scripts. - On
vcs
anddownload
, cron jobs regularly query the database for updates, and make the necessary changes (e.g., create a new git repository for a new group). - The
cvsweb
repositories hold the files which are the source for a group web pages. When these are updated, a special hook calls a CGI script onwww.gnu.org
to request a website update. - A cron job on
www.gnu.org
regularly checks for update requests, andcvs updates
the requested repositories. - Obsolete.
- Publishing a new tarball release for GNU packages is performed by an automated process, explained in the GNU Maintainer's guide. It is not managed by Savannah administrators, and only mentioned here for completeness.
- GNU Bug Tracker (http://debbugs.gnu.org) is based on Debian Bug Tracking System. It is not managed by Savannah administrators. Packages hosted on Savannah, either GNU or non-GNU, can request to use the bug tracker. More information: http://debbugs.gnu.org/Using.html.
- For non-GNU groups, group members can upload new files to be available for download as 'releases' (e.g., http://download.savannah.gnu.org/releases/freetype/). While GNU groups can also store files this way, it is very strongly recommended that official GNU packages use ftp.gnu.org via the automated ftp uploads (see item 8, above). For details, see download section in SavannahServices. See also UserAuthentication.
- Group members can push code to the repositories
on
vcs
using ssh. See 'vcs' section in SavannahServices for configuration details. See CvsGettingStarted, Svn, UsingHg, UsingBzr, UsingGit for usage information, and UserAuthentication for ssh authentication details.
User registration (frontend)
Anyone with a valid email account can register on GNU Savannah.
Public URL: https://savannah.gnu.org/account/register.php
Source code: /frontend/php/account/register.php
The
register.php
form creates a new record in the databaseuser
table, withSTATUS='P'
, and sends the user a confirmation URL (e.g.,https://savannah.nongnu.org/account/verify.php?confirm_hash=a1b2...
).The confirmation URL leads to /frontend/php/account/verify.php, which updates the user's record in
user
table toSTATUS='A'
.
Warning: the email that Savannah sends will often be considered spam by big email providers, or outright rejected.
For further details, see IdleAccounts.
Group submission (frontend)
Any Savannah user can submit a new group request. This procedure is for non-GNU groups only (for GNU packages, the first and additional step is evaluating software for GNU.
- Public URL: https://savannah.gnu.org/register/
- Source code: /frontend/php/register/index.php (and see all files in /frontend/php/register/ ).
- After form submission, The php
confirmation.php
file inregister/
:- updates the database record in the
groups
table, withSTATUS='P'
. - sends a notification email to
savannah-register-public@gnu.org
. - Creates a new task in the task tracker (FIXME: how?)
- FIXME: the source code mentions something about
cookbook
andrecipes
database tables?
- updates the database record in the
- The group is in
pending
state until approved by Savannah administrators.
Group approval, creation (frontend)
Savannah admins approve and create groups after careful and manual review. Group creation is the same for GNU groups.
- Public URL: https://savannah.nongnu.org/siteadmin/groupedit.php?group_id=N (only available to Savannah admins in superuser mode).
- The URL is display as 'group administration' link when viewing a pending group ticket.
- Source code: /frontend/php/siteadmin/groupedit.php.
- In this page the following changes can be made:
- system name (i.e. 'short name') - the name will be used in URLs, as a Unix group name for access control, and as directory names in various locations. Must be unique.
- status:
pending
,active
,deleted
,maintenance
,incomplete
. - license
- visibility (public/private)
These changes are written to the
groups
table. - Two special commands are available in this page as well:
- The green "V" icon: calls
groupedit.php
again with cgi parametersupdatefast=1
andstatus=A
, thus marking the group asactive
in thegroups
table, and in Savannah. - The configure (screwdriver and wrench) icon: calls /frontend/php/siteadmin/triggercreation.php, which calls the necessary one-time group creation scripts.
- The green "V" icon: calls
- The
triggercreation.php
script does the following:- Sets group defaults (e.g., having a homepage, having 'downloads',
using cvs repository, using task, support, bug trackers, using news,
etc.). This are fields such as
use_homepage=1
in thegroups
table.
The items set by default are hard-coded intriggercreation.php
. (this is one reason why by default, all new groups on Savannah start with a cvs repository). These settings can later be changed by the group administrators. - Sends an email to the group administrator (based on the Savannah user who registered the group).
- Sets group defaults (e.g., having a homepage, having 'downloads',
using cvs repository, using task, support, bug trackers, using news,
etc.). This are fields such as
- FIXME:
triggercreation.php
mentions"site-specific triggers executed"
- which ones are these and where are they executed?
Group administration - general information (frontend)
Group admins can modify various items for their groups using the Savannah web interface.
- Name, Short/Long descriptions
- public URL: https://savannah.nongnu.org/project/admin/editgroupinfo.php?group=N
- source code: /frontend/php/project/admin/editgroupinfo.php.
- The script modifies the
group
table.
- Group members: additional Savannah users with write access
- public URL: https://savannah.nongnu.org/project/admin/useradmin.php?group=N
- source code: /frontend/php/project/admin/useradmin.php
- modifications are stored in the
user_group
table (a many-to-many relation table betweenuser
andgroups
tables). - uses code from /frontend/php/include/member.php.
- Group squads: per-group lists of Savannah users
- public URL: https://savannah.nongnu.org/project/admin/squadadmin.php?group=N
- Source code: /frontend/php/project/admin/squadadmin.php.
- Permissions
- per-member permissions for website features (e.g., tracker management)
- Public URL: https://savannah.nongnu.org/project/admin/userperms.php?group=N
- Source code: /frontend/php/project/admin/userperms.php.
- Jobs
- "jobs" are postings which appear in the Contributors Wanted page.
- Public URL: https://savannah.nongnu.org/people/createjob.php?group=N
- Source code: /frontend/php/people/createjob.php.
- Select Features
- See "feature selection" section below.
- Configure Mailing lists
- See "mailing lists" section below.
- Configure Cookbook
- FIXME: document/explain cookbooks (or remove them).
- Set notifications:
- Select Savannah users which will be notified upon tracker activity (e.g., new task, new support ticket, new bug report, etc.).
- Public URL: https://savannah.nongnu.org/project/admin/editgroupnotifications.php?group=N
- Source code: /frontend/php/project/admin/editgroupnotification.php.
- FIXME: document trackers
Group administration - feature selection (frontend)
Group admins can enable and disable features for their groups using the Savannah web interface.
features in this context are the facilities used by the group, such as git, cvs, homepage, downloads, news, bugs/support/patches/tasks trackers, mailing lists, etc.
Each feature has a corresponding field in thegroups
table (e.g.,use_git
,use_homepage
,use_downloads
) which is set to1
or0
.Some features are associated with a URL. The URLs for these features are initialized to the Savannah defaults at group creation, but can be later changed by the group administrators. Examples:
- If
use_homepage=1
, theurl_homepage
field defaults tohttp://www.gnu.org/software/GROUP
(for GNU groups) orhttp://www.nongnu.org/GROUP
(for non-GNU groups). Group administrators can change this, although GNU packages should not do so. - If
use_git=1
, theurl_git
field defaults togit/?group=GROUP
(which resolves tohttps://savannah.gnu.org/git/?group=GROUP
, a page containing instructions about accessing git on Savannah for this group). Group administrators can change this to any other URL, although they should not do so, especially not GNU packages. (The purpose of Savannah is to host source code.)
- If
Public URL: https://savannah.gnu.org/project/admin/editgroupfeatures.php?group=GROUP (only available to group admins).
Source code: /frontend/php/project/admin/editgroupfeatures.php.
When updating features (selecting or deselecting features), the changes are saved to the database, in the
groups
table. No other changes are performed.These database changes will be picked up by the cron jobs running on other VMs (see below). This is the reason why some features take time to propagate (e.g., when a group administrator turns on
git
, the git repository is not created immediately). It would be better to do things synchronously, or at least very quickly.
Group administration - mailing lists (frontend)
Group admins can add, configure and delete mailing lists for their groups using the Savannah web interface.
- Mailing lists require special handling: the mailing list server (lists.gnu.org, using GNU Mailman) is administered by the FSF, not Savannah.
- Special configuration on
lists.gnu.org
allows remote execution of shell scripts fromfrontend
to automate list management. More info: ListServer. - Public URL: https://savannah.gnu.org/mail/admin/?group=GROUP (only available to group admins).
- The PHP code updates the
mail_group_list
table and runs the scripts to update the mailing lists onlists.gnu.org
.
MySQL Database
See SavannahDatabaseSchema and SavannahDatabaseExamples.
Cron job on vcs
Some cron jobs may still be running on the old vcs VM still in use and
accessible as vcs
. The intent is to have everything moved off of
there eventually.
Stored in vcs0:/etc/cron.d/sv
:
# remake user list for outgoing mail.
*/10 * * * * root nice -n 11 sv_aliases --cron && sed -e '/# Savannah include start/,/# Savannah include end/s/\([^:]\+\): .*/\1: INVALID.NOREPLY@gnu.org/' /etc/email-addresses -e 's,This is /etc/email-addresses,DO NOT EDIT - GENERATED FROM email-addresses.,' > /etc/email-addresses_SENDER
# remake list of git repositories in each group.
*/15 * * * * root sv_cgit.pl
# remake list of groups for the vcs.
35,05 * * * * root nice -n 11 sv_groups --cron --only-cvs --only-homepage --only-svn --only-git --only-hg --only-bzr
/backend/mail/sv_aliases - This script prepares an
alias
-type file for for exim4 mail server, used when sending commit updates to mailing lists.- The script queries the MySQL database, extracting user names and
emails for all Savannah users. Additionally, emails for 'squads'
(per-group mailing groups) are queried. The results are saved in
vcs0:/etc/email-addresses
. vcs0:/etc/email-addresses
is symlinked to the standardvcs0:/etc/exim4/email-addresses
file. Example:agn: assafgordon@gmail.com karl: karl@gnu.org
The
sed
command in the cronjob file replaces each user's email withINVALID.NOREPLY@gnu.org
, and saves the results invcs0:/etc/email-addresses_SENDER
. Example:agn: INVALID.NOREPLY@gnu.org karl: INVALID.NOREPLY@gnu.org
FIXME: where is
/etc/email-addresses_SENDER
mentioned/used? in an exim4 config file?
- The script queries the MySQL database, extracting user names and
emails for all Savannah users. Additionally, emails for 'squads'
(per-group mailing groups) are queried. The results are saved in
sv_cgit.pl
- this script updates thevcs0:/srv/git/cgitrepos
file which is used by the cgit CGI application.- cgit configuration file is
vcs0:/etc/cgitrc
.
- cgit configuration file is
sv_groups
- This script creates new repositories for groups in the Savannah database- reminder: when a new group is approved on
Savannah, or when a group administrator selects a new repository
feature the
frontend
PHP code only updates the database. this script picks up the changes and executes them. - The script queries the
groups
table, and creates the needed repositories.
Example: For groupXXX
, ifgroups.use_git=1
, it look forvcs0:/srv/git/XXX.git
. If it doesn't exist, create it withgit init
and additional Savannah-specific configurations (e.g. permissions, hooks, xattrs). - Repository initialization and configuration is delegated to the relevant perl module. See Git.pm, Cvs.pm, Bzr.pm, Svn.pm, Hg.pm, Download.pm.
- Two types of CVS repositories can be created:
cvs
(UsingCvsMakeArea
inCvs.pm
) - source code repository;webcvs
(UsingWebCvMakeAreaSavannahGNU
inCvs.pm
) - webcvs repository (files will be available on www.gnu.org/www.nongnu.org). The same routines also update existing CVS hooks. - The script takes parameteres determining which items to create (e.g.
--only-git
). - On
vcs
host, the git/hg/bzr/cvs/cvsweb repositories are created. - On
download
host, the download are created.
- reminder: when a new group is approved on
Savannah, or when a group administrator selects a new repository
feature the
Cron jobs on download
Some cron jobs may still be running on the old download VM still in
use but now accessible as olddownload
. The intent is to have
everything moved off of there eventually.
stored in download0:/etc/cron.d/sv
:
*/30 * * * * root sv_groups --cron --only-download
sv_groups
- This script creates new repositories for groups listed in the Savannah database. See description forsv_groups
in the above section.
Cron jobs on frontend
Basically, none. Wiki refresh is run once an hour, but this isn't really needed.
Cron jobs on mgt1
Stored in mgt1:/etc/cron.d/savannah
:
# Assign uidNumber and gidNumber in the database (and rebuild cache
# for libnss-mysql-bg). 77211 was the latest group created by the old
# sv_groups cron - maybe one day we'll move everything to the 70000 range.
*/5 * * * * root sv_assign_uid_gid --min-gidNumber=77212
# Frontend-related:
#
# This script does not need root access, access to the database is enough.
*/25 * * * * root sv_cleaner
48 12 2 * * root sv_cleaner --big-cleanup
4 4,18 * * * root sv_reminder
sv_assign_uid_gid
- creates unique user ids and group ids for users and groups in the Savannah system.- reminder: across all Savannah hosts, Unix user/group ids are managed with nsswitch/libnss-mysql (see UserAuthentication for details).
- When a new user (or group) is created on Savannah, the PHP code
on
frontend
does not assign uid/gid. - This script picks up new users (SQL:
user.uidNumber is NULL
) and new groups (SQL:groups.gidNumber is NULL
) and assigns them ids.
sv_cleaner
- Removes parts of the database that belong to removed entities.sv_reminder
- sends email reminders to users.