github.com/drud/ddev@v1.21.5-alpha1.0.20230226034409-94fcc4b94453/pkg/ddevapp/drupal/backdrop/settings.php (about)

     1  <?php
     2  /**
     3   * @file
     4   * Main Backdrop CMS configuration file.
     5   */
     6  
     7  /**
     8   * Database configuration:
     9   *
    10   * Most sites can configure their database by entering the connection string
    11   * below. If using master/slave databases or multiple connections, see the
    12   * advanced database documentation at
    13   * https://api.backdropcms.org/database-configuration
    14   */
    15  $database = 'mysql://user:pass@localhost/database_name';
    16  $database_prefix = '';
    17  
    18  /**
    19   * Site configuration files location.
    20   *
    21   * By default these directories are stored within the files directory with a
    22   * hashed path. For the best security, these directories should be in a location
    23   * that is not publicly accessible through a web browser.
    24   *
    25   * Example using directories one parent level up:
    26   * @code
    27   * $config_directories['active'] = '../config/active';
    28   * $config_directories['staging'] = '../config/staging';
    29   * @endcode
    30   *
    31   * Example using absolute paths:
    32   * @code
    33   * $config_directories['active'] = '/home/myusername/config/active';
    34   * $config_directories['staging'] = '/home/myusername/config/staging';
    35   * @endcode
    36   */
    37  $config_directories['active'] = 'files/config_' . md5($database) . '/active';
    38  $config_directories['staging'] = 'files/config_' . md5($database) . '/staging';
    39  
    40  /**
    41   * Access control for update.php script.
    42   *
    43   * If you are updating your Backdrop installation using the update.php script
    44   * but are not logged in using either an account with the "Administer software
    45   * updates" permission or the site maintenance account (the account that was
    46   * created during installation), you will need to modify the access check
    47   * statement below. Change the FALSE to a TRUE to disable the access check.
    48   * After finishing the upgrade, be sure to open this file again and change the
    49   * TRUE back to a FALSE!
    50   */
    51  $settings['update_free_access'] = FALSE;
    52  
    53  /**
    54   * Salt for one-time login links and cancel links, form tokens, etc.
    55   *
    56   * This variable will be set to a random value by the installer. All one-time
    57   * login links will be invalidated if the value is changed. Note that if your
    58   * site is deployed on a cluster of web servers, you must ensure that this
    59   * variable has the same value on each server. If this variable is empty, a hash
    60   * of the serialized database credentials will be used as a fallback salt.
    61   *
    62   * For enhanced security, you may set this variable to a value using the
    63   * contents of a file outside your docroot that is never saved together
    64   * with any backups of your Backdrop files and database.
    65   *
    66   * Example:
    67   * @code
    68   * $settings['hash_salt'] = file_get_contents('/home/example/salt.txt');
    69   * @endcode
    70   *
    71   */
    72  $settings['hash_salt'] = '';
    73  
    74  /**
    75   * Trusted host configuration (optional but highly recommended).
    76   *
    77   * Since the HTTP Host header can be set by the user making the request, it
    78   * is possible for malicious users to override it and create an attack vector.
    79   * To protect against these sort of attacks, Backdrop supports checking a list
    80   * of trusted hosts.
    81   *
    82   * To enable the trusted host protection, specify the allowable hosts below.
    83   * This should be an array of regular expression patterns representing the hosts
    84   * you would like to allow.
    85   *
    86   * For example, this will allow the site to only run from www.example.com:
    87   * @code
    88   * $settings['trusted_host_patterns'] = array(
    89   *   '^www\.example\.com$',
    90   * );
    91   * @endcode
    92   *
    93   * If you are running a site on multiple domain names, you should specify all of
    94   * the host patterns that are allowed by your site. For example, this will allow
    95   * the site to run off of all variants of example.com and example.org, with all
    96   * subdomains included:
    97   * @code
    98   * $settings['trusted_host_patterns'] = array(
    99   *   '^example\.com$',
   100   *   '^.+\.example\.com$',
   101   *   '^example\.org',
   102   *   '^.+\.example\.org',
   103   * );
   104   * @endcode
   105   *
   106   * If you do not need this functionality (such as in development environments or
   107   * if protection is at another layer), you can suppress the status report
   108   * warning by setting this value to FALSE:
   109   * @code
   110   * $settings['trusted_host_patterns'] = FALSE;
   111   * @endcode
   112   *
   113   * For more information about trusted host patterns, see the documentation at
   114   * https://api.backdropcms.org/documentation/trusted-host-settings
   115   *
   116   * @see backdrop_valid_http_host()
   117   * @see backdrop_check_trusted_hosts()
   118   * @see system_requirements()
   119   */
   120  // $settings['trusted_host_patterns'] = array('^www\.example\.com$');
   121  
   122  /**
   123   * Base URL (optional).
   124   *
   125   * If Backdrop is generating incorrect URLs on your site, which could be in HTML
   126   * headers (links to CSS and JS files) or visible links on pages (such as in
   127   * menus), uncomment the Base URL statement below and fill in the absolute URL
   128   * to your Backdrop installation.
   129   *
   130   * You might also want to force users to use a given domain.
   131   * See the .htaccess file for more information.
   132   *
   133   * Examples:
   134   *   $base_url = 'http://www.example.com';
   135   *   $base_url = 'http://www.example.com:8888';
   136   *   $base_url = 'http://www.example.com/backdrop';
   137   *   $base_url = 'https://www.example.com:8888/backdrop';
   138   *
   139   * It is not allowed to have a trailing slash; Backdrop will add it for you.
   140   */
   141  // $base_url = 'http://www.example.com'; // NO trailing slash!
   142  
   143  /**
   144   * PHP settings:
   145   *
   146   * To see what PHP settings are possible, including whether they can be set at
   147   * runtime (by using ini_set()), read the PHP documentation:
   148   * http://www.php.net/manual/ini.list.php
   149   * See backdrop_environment_initialize() in includes/bootstrap.inc for required
   150   * runtime settings and the .htaccess file for non-runtime settings. Settings
   151   * defined there should not be duplicated here so as to avoid conflict issues.
   152   */
   153  
   154  /**
   155   * Some distributions of Linux (most notably Debian) ship their PHP
   156   * installations with garbage collection (gc) disabled. Since Backdrop depends
   157   * on PHP's garbage collection for clearing sessions, ensure that garbage
   158   * collection occurs by using the most common settings.
   159   */
   160  ini_set('session.gc_probability', 1);
   161  ini_set('session.gc_divisor', 100);
   162  
   163  /**
   164   * Set session lifetime (in seconds), i.e. the time from the user's last visit
   165   * to the active session may be deleted by the session garbage collector. When
   166   * a session is deleted, authenticated users are logged out, and the contents
   167   * of the user's $_SESSION variable is discarded.
   168   */
   169  ini_set('session.gc_maxlifetime', 200000);
   170  
   171  /**
   172   * Set session cookie lifetime (in seconds), i.e. the time from the session is
   173   * created to the cookie expires, i.e. when the browser is expected to discard
   174   * the cookie. The value 0 means "until the browser is closed".
   175   */
   176  ini_set('session.cookie_lifetime', 2000000);
   177  
   178  /**
   179   * If you encounter a situation where users post a large amount of text, and
   180   * the result is stripped out upon viewing but can still be edited, Backdrop's
   181   * output filter may not have sufficient memory to process it.  If you
   182   * experience this issue, you may wish to uncomment the following two lines
   183   * and increase the limits of these variables.  For more information, see
   184   * http://php.net/manual/en/pcre.configuration.php.
   185   */
   186  // ini_set('pcre.backtrack_limit', 200000);
   187  // ini_set('pcre.recursion_limit', 200000);
   188  
   189  /**
   190   * Backdrop automatically generates a unique session cookie name for each site
   191   * based on its full domain name. If you have multiple domains pointing at the
   192   * same Backdrop site, you can either redirect them all to a single domain (see
   193   * comment in .htaccess), or uncomment the line below and specify their shared
   194   * base domain. Doing so assures that users remain logged in as they cross
   195   * between your various domains. Make sure to always start the $cookie_domain
   196   * with a leading dot, as per RFC 2109.
   197   */
   198  // $cookie_domain = '.example.com';
   199  
   200  /**
   201   * A custom theme can be set for the offline page. This applies when the site
   202   * is explicitly set to maintenance mode through the administration page or when
   203   * the database is inactive due to an error. It can be set through the
   204   * 'maintenance_theme' key. The template file should also be copied into the
   205   * theme. It is located inside
   206   * 'core/modules/system/templates/maintenance-page.tpl.php'.
   207   * Note: This setting does not apply to installation and update pages.
   208   */
   209  // $settings['maintenance_theme'] = 'bartik';
   210  
   211  /**
   212   * Reverse Proxy Configuration:
   213   *
   214   * Reverse proxy servers are often used to enhance the performance
   215   * of heavily visited sites and may also provide other site caching,
   216   * security, or encryption benefits. In an environment where Backdrop
   217   * is behind a reverse proxy, the real IP address of the client should
   218   * be determined such that the correct client IP address is available
   219   * to Backdrop's logging and access management systems. In
   220   * the most simple scenario, the proxy server will add an
   221   * X-Forwarded-For header to the request that contains the client IP
   222   * address. However, HTTP headers are vulnerable to spoofing, where a
   223   * malicious client could bypass restrictions by setting the
   224   * X-Forwarded-For header directly. Therefore, Backdrop's proxy
   225   * configuration requires the IP addresses of all remote proxies to be
   226   * specified in $settings['reverse_proxy_addresses'] to work correctly.
   227   *
   228   * Enable this setting to get Backdrop to determine the client IP from
   229   * the X-Forwarded-For header (or $settings['reverse_proxy_header'] if set).
   230   * If you are unsure about this setting, do not have a reverse proxy,
   231   * or Backdrop operates in a shared hosting environment, this setting
   232   * should remain commented out.
   233   *
   234   * In order for this setting to be used you must specify every possible
   235   * reverse proxy IP address in $settings['reverse_proxy_addresses'].
   236   * If a complete list of reverse proxies is not available in your
   237   * environment (for example, if you use a CDN) you may set the
   238   * $_SERVER['REMOTE_ADDR'] variable directly in settings.php.
   239   * Be aware, however, that it is likely that this would allow IP
   240   * address spoofing unless more advanced precautions are taken.
   241   */
   242  // $settings['reverse_proxy'] = TRUE;
   243  
   244  /**
   245   * Specify every reverse proxy IP address in your environment.
   246   * This setting is required if $settings['reverse_proxy'] is TRUE.
   247   */
   248  // $settings['reverse_proxy_addresses'] = array('a.b.c.d', ...);
   249  
   250  /**
   251   * Set this value if your proxy server sends the client IP in a header
   252   * other than X-Forwarded-For.
   253   */
   254  // $settings['reverse_proxy_header'] = 'HTTP_X_CLUSTER_CLIENT_IP';
   255  
   256  /**
   257   * Page caching:
   258   *
   259   * By default, Backdrop sends a "Vary: Cookie" HTTP header for anonymous page
   260   * views. This tells a HTTP proxy that it may return a page from its local
   261   * cache without contacting the web server, if the user sends the same Cookie
   262   * header as the user who originally requested the cached page. Without "Vary:
   263   * Cookie", authenticated users would also be served the anonymous page from
   264   * the cache. If the site has mostly anonymous users except a few known
   265   * editors/administrators, the Vary header can be omitted. This allows for
   266   * better caching in HTTP proxies (including reverse proxies), i.e. even if
   267   * clients send different cookies, they still get content served from the cache.
   268   * However, authenticated users should access the site directly (i.e. not use an
   269   * HTTP proxy, and bypass the reverse proxy if one is used) in order to avoid
   270   * getting cached pages from the proxy.
   271   */
   272  // $settings['omit_vary_cookie'] = TRUE;
   273  
   274  /**
   275   * Expiration of cache_form entries:
   276   *
   277   * Backdrop's Form API stores details of forms in cache_form and these entries
   278   * are kept for at least 6 hours by default. Expired entries are cleared by
   279   * cron. Busy sites can encounter problems with the cache_form table becoming
   280   * very large. It's possible to mitigate this by setting a shorter expiration
   281   * for cached forms. In some cases it may be desirable to set a longer cache
   282   * expiration. For example to prolong cache_form entries for Ajax forms in
   283   * cached HTML.
   284   *
   285   * @see form_set_cache()
   286   * @see system_cron()
   287   * @see ajax_get_form()
   288   */
   289  // $settings['form_cache_expiration'] = 21600;
   290  
   291  /**
   292   * String overrides:
   293   *
   294   * To override specific strings on your site with or without enabling locale
   295   * module, add an entry to this list. This functionality allows you to change
   296   * a small number of your site's default English language interface strings.
   297   *
   298   * Uncomment the lines below to enable.
   299   */
   300  /*
   301  $settings['locale_custom_strings_en'][''] = array(
   302    'forum'      => 'Discussion board',
   303    '@count min' => '@count minutes',
   304  );
   305  */
   306  
   307  /**
   308   * Fast 404 pages:
   309   *
   310   * Backdrop can generate fully themed 404 pages. However, some of these
   311   * responses are for images or other resource files that are not displayed to
   312   * the user. This can waste bandwidth, and also generate server load.
   313   *
   314   * The options below return a simple, fast 404 page for URLs matching a
   315   * specific pattern:
   316   * - 404_fast_paths_exclude: A regular expression to match paths to exclude,
   317   *   such as images generated by image styles, or dynamically-resized images.
   318   *   The default pattern provided below also excludes the private file system.
   319   *   If you need to add more paths, you can add '|path' to the expression.
   320   * - 404_fast_paths: A regular expression to match paths that should return a
   321   *   simple 404 page, rather than the fully themed 404 page. If you don't have
   322   *   any aliases ending in htm or html you can add '|s?html?' to the expression.
   323   * - 404_fast_html: The html to return for simple 404 pages.
   324   *
   325   * Comment out this code if you would like to disable this functionality.
   326   */
   327  $settings['404_fast_paths_exclude'] = '/\/(?:styles)|(?:system\/files)\//';
   328  $settings['404_fast_paths'] = '/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i';
   329  $settings['404_fast_html'] = '<!DOCTYPE html><html><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL "@path" was not found on this server.</p></body></html>';
   330  
   331  /**
   332   * By default, fast 404s are returned as part of the normal page request
   333   * process, which will properly serve valid pages that happen to match and will
   334   * also log actual 404s to the Backdrop log. Alternatively you can choose to
   335   * return a 404 now by uncommenting the following line. This will reduce server
   336   * load, but will cause even valid pages that happen to match the pattern to
   337   * return 404s, rather than the actual page. It will also prevent the Backdrop
   338   * system log entry. Ensure you understand the effects of this before enabling.
   339   *
   340   * To enable this functionality, uncomment the line below.
   341   */
   342  // fast_404();
   343  
   344  /**
   345   * External access proxy settings:
   346   *
   347   * If your site must access the Internet via a web proxy then you can enter
   348   * the proxy settings here. Currently only basic authentication is supported
   349   * by using the username and password variables. The proxy_user_agent variable
   350   * can be set to NULL for proxies that require no User-Agent header or to a
   351   * non-empty string for proxies that limit requests to a specific agent. The
   352   * proxy_exceptions variable is an array of host names to be accessed directly,
   353   * not via proxy.
   354   */
   355  // $settings['proxy_server'] = '';
   356  // $settings['proxy_port'] = 8080;
   357  // $settings['proxy_username'] = '';
   358  // $settings['proxy_password'] = '';
   359  // $settings['proxy_user_agent'] = '';
   360  // $settings['proxy_exceptions'] = array('127.0.0.1', 'localhost');
   361  
   362  /**
   363   * Authorized file system operations:
   364   *
   365   * The Update Manager module included with Backdrop provides a mechanism for
   366   * site administrators to securely install missing updates for the site
   367   * directly through the web user interface. On securely-configured servers,
   368   * the Update manager will require the administrator to provide SSH or FTP
   369   * credentials before allowing the installation to proceed; this allows the
   370   * site to update the new files as the user who owns all the Backdrop files,
   371   * instead of as the user the webserver is running as. On servers where the
   372   * webserver user is itself the owner of the Backdrop files, the administrator
   373   * will not be prompted for SSH or FTP credentials (note that these server
   374   * setups are common on shared hosting, but are inherently insecure).
   375   *
   376   * Some sites might wish to disable the above functionality, and only update
   377   * the code directly via SSH or FTP themselves. This setting completely
   378   * disables all functionality related to these authorized file operations.
   379   *
   380   * Uncomment the line below to disable authorize operations.
   381   */
   382  // $settings['allow_authorize_operations'] = FALSE;
   383  
   384  /**
   385   * Mixed-mode sessions:
   386   *
   387   * Set to TRUE to create both secure and insecure sessions when using HTTPS.
   388   * Defaults to FALSE.
   389   */
   390  // $settings['https'] = TRUE;
   391  
   392  /**
   393   * Drupal backwards compatibility.
   394   *
   395   * By default, Backdrop 1.0 includes a compatibility layer to keep it compatible
   396   * with Drupal 7 APIs. Backdrop core itself does not use this compatibility
   397   * layer however. You may disable it if all the modules you're running were
   398   * built for Backdrop.
   399   */
   400  $settings['backdrop_drupal_compatibility'] = TRUE;
   401  
   402  /**
   403   * Configuration overrides.
   404   *
   405   * These settings allow you to specify values for anything stored in config
   406   * within the files stored in the $config_directories variable above.
   407   * This can be useful to store per-environment values or sensitive data that
   408   * is undesirable to store in the config storage.
   409   *
   410   * There are particular configuration values that are risky to override. For
   411   * example overriding field storage will create errors because associated
   412   * database changes are necessary. Modifying values within complicated objects
   413   * such as views, content types, vocabularies, etc. may not work as expected.
   414   * Use any available API functions for complex systems instead.
   415   */
   416  //$config['system.core']['site_name'] = 'My Backdrop site';
   417  //$config['system.core']['file_temporary_path'] = '/tmp';
   418  
   419  /**
   420   * Include a local settings file, if available.
   421   *
   422   * To make local development easier, you can add a settings.local.php file that
   423   * contains settings specific to your local installation, or to any secondary
   424   * environment (staging, development, etc).
   425   *
   426   * Typically used to specify a different database connection information, to
   427   * disable caching, JavaScript/CSS compression, re-routing of outgoing e-mails,
   428   * Google Analytics, and other things that should not happen on development and
   429   * testing sites.
   430   *
   431   * This local settings file can be ignored in your Git repository, so that any
   432   * updates to settings.php can be pulled in without overwriting your local
   433   * changes.
   434   *
   435   * Keep this code block at the end of this file to take full effect.
   436   */
   437  
   438  // Automatically generated include for settings managed by ddev.
   439  if (file_exists(__DIR__ . '/settings.ddev.php') && getenv('IS_DDEV_PROJECT') == 'true') {
   440    include __DIR__ . '/settings.ddev.php';
   441  }
   442  
   443  if (file_exists(__DIR__ . '/settings.local.php')) {
   444    include __DIR__ . '/settings.local.php';
   445  }