Copyright (C) 1999, 2000 The SourceForge Crew
Copyright (C) 2000-2006 Mathieu Roy
Copyright (C) 2014, 2016, 2017 Assaf Gordon
Copyright (C) 2001-2011, 2013, 2017 Sylvain Beucler
Copyright (C) 2013, 2014, 2017-2025 Ineiev

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.  This file is offered as-is,
without any warranty.

This file is part of Savane.

"Backend" scripts
=================

This directory contains Perl scripts supporting Savane.  Unless noted
otherwise, they depend on the Perl library of Savane (Savane.pm,
Savane/*.pm).

This document shortly describes these scripts and Savannah hosts
they are installed on.

accounts/sv_assign_uid_gid
==========================

Assigns Unix uid and gid numbers to Savane users and groups.  Numbers
for the newly approved groups and the users joining active groups are assigned
synchronously in Web UI; this script may be needed to generate those numbers
in the fresh installation, for example, from ../db/initial.sql.

accounts/sv_crypt
=================

Invokes crypt(3) with the parameters read from stdin and passes the result
to stdout.  This script is used to handle hashed passwords since the set
of algorithms supported by PHP as of 2025-05 lags behind GNU libc;
in particular, we'd like to use yescrypt by default.

accounts/sv_gen_passwd_group
============================

Generates the passwd and group files that may be used with libnss-extrausers.
After the initial generation, the updates in those files may be handled
synchronously in Web UI, see variables $sys_group_file...$sys_passwd_user_shell
in ../doc/savane.conf.php.

accounts/sv_groups
==================

Creates VCS repositories and download areas when the features are
enabled in Savane Web UI.  Updates CVS commit hooks.
Runs twice an hour on download0 (download areas), vcs1 (CVS repositories),
vcs0 (all other repositories).

accounts/sv_get_authorized_keys
===============================

Invoked by SSH daemon to fetch user's authorized keys from the database.
Used on download0, vcs0, vcs1, vcs2.

accounts/sv_membersh
====================

Restricted shell provided to Savane users who connect through SSH.
Used on download0.

external/commit_prep.pl
=======================

Prepares data for external/log_accum.pl.  Used on vcs1.

external/log_accum.pl
=====================

Processes CVS commit data and sends commit notifications.  Used on vcs1.

external/mirror-redirect
========================

A URL mirror redirector for "download" and "ftpmirror" servers.
Used on download0.

extra/git/sv_cgit_about_filter.pl
=================================

Basic "about filter" for Cgit.
Used on vcs2.

extra/git/sv_cgit.pl
====================

Updates lists of repositories for Cgit.
Runs twice an hour on vcs2.

mail/sv_aliases
===============

Maintains the list of Savane users in Unix email aliases tables.
Runs every 10 minutes on vcs0, vcs1, vcs2.

mail/sv_mailman-wrapper.pl
==========================

Stub mailman wrapper, it's only used for testing purposes.

misc/sv_city-filter
===================

Reduces amount of data from GeoNames city list.  The result is used
in misc/sv_mirmon-to-geoip.

misc/sv_cleaner
===============

Removes parts of the database that belong to removed entities.
Runs twice an hour on mgt1.

misc/sv_collect-mirror-stats
============================

Collects logs of external/mirror-redirect.
Runs from dl:/etc/cron.d/sv-ftpmirror-stats.

misc/sv_gnu-mirmon
==================

Extracts mirror lists from www.gnu.org/prep/FTP.
Runs from dl:/etc/cron.d/sv-mirmon.

misc/sv_mirmon-to-geoip
=======================

Updates active mirror lists for mirror multiplexer.
Runs indirectly from dl:/etc/cron.d/sv-mirmon.

misc/sv_regen-stat-index
========================

Generates index.html files for external/mirror-redirect statistics.
Used in misc/sv_collect-mirror-stats.

misc/sv_regen-stats
===================

Generates a single HTML file for external/mirror-redirect statistics.
Used in misc/sv_collect-mirror-stats.

misc/sv_summarize-latest-stats
==============================

Generates a HTML file for external/mirror-redirect statistics
of latest requests.  Used in misc/sv_collect-mirror-stats.

misc/sv_reminder
================

Sends scheduled notifications for users.
Runs twice a day on mgt1.

sbin/sv_frontendctl.pl
======================

Runs Apache and a local web server on top it.

sbin/sv_kill_db.pl
==================

Kills database server launched with sbin/sv_launch_db.pl.

sbin/sv_launch_db.pl
====================

Runs an instance of database server specifically for its Savane
installation.

sbin/sv_php_server.pl
=====================

Runs the PHP built-in server specifically for its Savane installation.
This script has an option to specify the PHP binary to use, so
it can be used to test various PHP versions without the need to
re-install Savane; however, the PHP built-in server is only suitable
for testing.
