Helix Swarm Guide (2018.3)

Configuration overview

This section provides an overview of all the possible configuration blocks in the SWARM_ROOT/data/config.php file. Click on any link in the configuration overview below to see a detailed description of that configurable.

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}',
),
'comments' => array(
'notification_delay_time' => 1800, //Default to 30 minutes 1800 seconds
'threading' => array(
'max_depth' => 4, // default depth 4, to disable comment threading set to 0
),
),
'depot_storage' => array(
'base_path' => '//depot_name',
),
'diffs' => array(
'max_diffs' => 1500,
),
'environment' => array(
'mode' => 'production',
'hostname' => 'myswarm.hostname',
'external_url' => null,
'base_url' => null,
'logout_url' => null, // defaults to null
'vendor' => array(
'emoji_path' => 'vendor/gemoji/images',
),
),
'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' => '',
'link_to_jobs' => false, // set to true to enable Perforce job links in JIRA, P4DTG and job_field required
'delay_job_links' => 60, // delay in seconds, defaults to 60 seconds
),
'log' => array(
'priority' => 5,
),
'mail' => array(
// 'recipients' => array('[email protected]'),
'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-core-server:1666',
'user' => 'admin_userid',
'password' => 'admin user ticket or password',
'sso_enabled' => false, // defaults to false
'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',
'fetch' => array('maximum' => 0), // defaults to 0 (disabled)
),
'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(
'octothorpe' => array( // #review or #review-1234 with surrounding whitespace/eol
'regex' => '/(?P<pre>(?:\s|^)\(?)\#(?P<keyword>review|append|replace)(?:-(?P<id>[0-9]+))?(?P<post>[.,!?:;)]*(?=\s|$))/i',
'spec' => '%pre%#%keyword%-%id%%post%',
'insert' => "%description%\n\n#review-%id%",
'strip' => '/^\s*\#(review|append|replace)(-[0-9]+)?(\s+|$)|(\s+|^)\#(review|append|replace)(-[0-9]+)?\s*$/i',
),

'leading-square' => array( // [review] or [review-1234] at start
'regex' => '/^(?P<pre>\s*)\[(?P<keyword>review|append|replace)(?:-(?P<id>[0-9]+))?\](?P<post>\s*)/i',
'spec' => '%pre%[%keyword%-%id%]%post%',
),
'trailing-square' => array( // [review] or [review-1234] at end
'regex' => '/(?P<pre>\s*)\[(?P<keyword>review|append|replace)(?:-(?P<id>[0-9]+))?\](?P<post>\s*)?$/i',
'spec' => '%pre%[%keyword%-%id%]%post%',
),

'filters' =>array(
'result_sorting' => true,
'date_field' => 'updated', // 'created' displays and sorts by created date, 'updated' displays and sorts by last updated
),
),
'commit_timeout' => 1800, // 30 minutes
'disable_commit' => true,
'moderator_approval' => 'any', // 'any|each'
'disable_self_approve' => false,
'end_states' => array('archived', 'rejected', 'approved:commit'),
'disable_approve_when_tasks_open' => false,
'process_shelf_delete_when' => array(),
'commit_credit_author' => true,
'ignored_users' => array(),
'unapprove_modified' => true,
'allow_author_change' => true,
'allow_author_obliterate' => false,
'sync_descriptions' => true,
'expand_all_file_limit' => 10,
'expand_group_reviewers' => false,
'disable_tests_on_approve_commit' => false,
'more_context_lines' =>10, // defaults to 10 lines
),
'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
'remembered_cookie_lifetime' => 60*60*24*30, // 30 days
'gc_maxlifetime' => 60*60*24*30, // 30 days
'gc_divisor' => 100, // 100 user requests
),
'short_links' => array(
'hostname' => 'myho.st',
'external_url' => 'https://myho.st:port/sub-folder',
),
'upgrade' => array(
'status_refresh_interval' => 10, //Refresh page every 10 seconds
'batch_size' => 1000, //Fetch 1000 reviews to lower memory usage
),
'users' => array(
'dashboard_refresh_interval' => 300000, //Default 300000 milliseconds
'display_fullname' => false,
'settings' => array(
'review_preferences' => array(
'show_comments_in_files' => true,
'view_diffs_side_by_side' => true,
'show_space_and_new_line_characters' => false,
'ignore_whitespace' => false,
),
'time_preferences' => array(
'display' => 'Timeago', // Default to 'Timeago' but can be set to 'Timestamp'
),
),
),
'workflow' => array(
'enabled' => false, // Switches the workflow feature on. Workflow is a technology preview feature, it is currently unsupported and not suitable for production. Default is false
),
'workflow_rules' => array(
'on_submit' => array(
'with_review' => array(
'rule' => 'no_checking', // 'no_checking|strict'
'mode' => 'default' // 'policy|default'
),
'without_review' => array(
'rule' => 'no_checking', // 'no_checking|auto_create|reject'
'mode' => 'default' // 'policy|default'
),
),
'end_rules' => array(
'update' => array(
'rule' => 'no_checking', // 'no_checking|no_revision'
'mode' => 'default' // 'policy|default'
),
),
'counted_votes' => array(
'rule' => 'anyone', // 'anyone|members'
'mode' => 'default' // 'policy|default'
),
'auto_approve' => array(
'rule' => 'never', // 'never|votes'
'mode' => 'default' // 'policy|default'
),
),
'xhprof' => array(
'slow_time' => 3,
'ignored_routes' => array('download', 'imagick', 'libreoffice', 'worker'),
),
'saml' => array(...),
);
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.