Configuration overview
This section provides an overview of all the possible configuration blocks
in the
file. Click on any underlined item to see a detailed
description.
SWARM_ROOT
/data/config.php
Warning
While the syntax of this example is correct, it includes configuration values that cannot work. Ensure that you adjust the configuration appropriately for your Swarm installation before using this example in testing or production.
<?php
return array(
'activity' => array(
'ignored_users' => array(
'git-fusion-user',
'p4dtguser',
'system',
),
),
'archives' => array(
'max_input_size' => 512 * 1024 * 1024, // 512M (in bytes)
'archive_timeout' => 1800, // 30 minutes
'compression_level' => 1, // 0-9
'cache_lifetime' => 60 * 60 * 24, // 1 day
),
'attachments' => array(
'max_file_size' => 0
, // the maximum file size to accept in bytes
),
'avatars' => array(
'http_url' => 'http://www.gravatar.com/avatar/{hash}?s={size}&d={default}',
'https_url' => 'https://secure.gravatar.com/avatar/{hash}?s={size}&d={default}',
),
'depot_storage' => array(
'base_path' => '//depot_name
',
),
'diffs' => array(
'ignore_whitespace_default' => false,
'max_diffs' => 1500,
),
'environment' => array(
'mode' => 'production',
'hostname' => 'myswarm.hostname',
'external_url' => null,
'base_url' => null,
),
'files' => array(
'max_size' => 1048576,
'download_timeout' => 1800,
),
'groups' => array(
'super_only' => true,
),
'http_client_options' => array(
'timeout' => 5,
'hosts' => array(),
),
'jira' => array(
'host' => '',
'user' => '',
'password' => '',
'job_field' => '',
),
'log' => array(
'priority' => 5,
),
'mail' => array(
// 'recipients' => array('user@my.domain'),
'notify_self' => false,
'transport' => array(
'host' => 'my.mx.host',
),
),
'mentions' => array(
'mode' => 'global',
'usersBlacklist' => array('super', 'swarm-admin'),
),
'notifications' => array(
'honor_p4_reviews' => false,
'opt_in_review_path' => '//depot/swarm',
'disable_change_emails' => false,
),
'p4' => array(
'port' => 'my-helix-versioning-engine:1666',
'user' => 'admin_userid',
'password' => 'admin user ticket or password',
'slow_command_logging' => array(
3,
10 => array('print', 'shelve', 'submit', 'sync', 'unshelve'),
),
'max_changelist_files' => 1000,
'auto_register_url' => true,
),
'projects' => array(
'mainlines' => array(
'main', 'mainline', 'master', 'trunk',
),
'add_admin_only' => false,
'add_groups_only' => array(),
'edit_name_admin_only' => false,
'edit_branches_admin_only' => false,
'readme_mode' => 'restricted',
'sidebar_sort_field' => 'name',
),
'queue' => array(
'workers' => 3, // defaults to 3
'worker_lifetime' => 595, // defaults to 10 minutes (less 5 seconds)
'worker_task_timeout' => 1800, // defaults to 30 minutes
'worker_memory_limit' => '1G', // defaults to 1 gigabyte
),
'reviews' => array(
'patterns' => array(
// #review or #review-1234 with surrounding whitespace/eol
'octothorpe' => array(
'regex' => '/(?P<pre>\s+|^)'
. '\#(?P<keyword>review)(?:-(?P<id>[0-9]+))?'
. '(?P<post>\s+|$)/i',
'spec' => '%pre%#%keyword%-%id%%post%',
'insert' => "%description%\n\n#review-%id%",
'strip' => '/^\s*\#review(-[0-9]+)?(\s+|$)'
. '|(\s+|^)\#review(-[0-9]+)?\s*$/i',
),
// [review] or [review-1234] at start
'leading-square' => array(
'regex' => '/^(?P<pre>\s*)'
. '\[(?P<keyword>review)(?:-(?P<id>[0-9]+))?\]'
. '(?P<post>\s*)/i',
'spec' => '%pre%[%keyword%-%id%]%post%',
),
// [review] or [review-1234] at end
'trailing-square' => array(
'regex' => '/(?P<pre>\s*)'
. '\[(?P<keyword>review)(?:-(?P<id>[0-9]+))?\]'
. '(?P<post>\s*)?$/i',
'spec' => '%pre%[%keyword%-%id%]%post%',
),
),
'commit_timeout' => 1800, // 30 minutes
'disable_commit' => true,
'disable_self_approve' => false,
'commit_credit_author' => true,
'ignored_users' => array(),
'unapprove_modified' => true,
'allow_author_change' => true,
'sync_descriptions' => true,
),
'search' => array(
'maxlocktime' => 5000, // 5 seconds, in milliseconds
'p4_search_host' => '', // optional URL to Helix Search Tool
),
'security' => array(
'disable_system_info' => false,
'email_restricted_changes' => false,
'emulate_ip_protections' => true,
'https_port' => null,
'https_strict' => false,
'https_strict_redirect' => true,
'prevent_login' => array(),
'require_login' => true,
),
'session' => array(
'cookie_lifetime' => 0, // 0=expire when browser closed
'gc_maxlifetime' => 60*60*24*30, // 30 days
'remembered_cookie_lifetime' => 60*60*24*30, // 30 days
),
'short_links' => array(
'hostname' => 'myho.st
',
'external_url' => 'https://myho.st
:port
/sub-folder
',
),
'xhprof' => array(
'slow_time' => 3,
'ignored_routes' => array('download', 'imagick', 'libreoffice', 'worker'),
),
);
Note
The Swarm configuration file does not include PHP's standard closing tag
(?>
). This is intentional as it prevents
unintentional whitespace from being introduced into Swarm's output, which
would interfere with Swarm's ability to control HTTP headers. Debugging
problems that result from unintentional whitespace can be challenging,
since the resulting behavior and error messages often appear to be
misleading.