
/**
 * Local database settings.
 */
$databases['default']['default'] = [
  'database' => '{DB_NAME}',
  'username' => '{DB_USER}',
  'password' => '{DB_PASS}',
  'prefix' => '',
  'host' => '{DB_HOST}',
  'port' => '{DB_PORT}',
  'namespace' => 'Drupal\\Core\\Database\\Driver\\{DB_PROTOCOL}',
  'driver' => '{DB_PROTOCOL}',
];

/*
 * Local Drupal command-line application.
 *
 * If executing local Drupal CLI commands on the host machine, you'll need to
 * change the database host so the connection resolves. It's also possible to
 * configure Drupal CLI tools to use SSH to connect to the Docker container
 * to execute their command(s) within the environment.
 */
if (php_sapi_name() === 'cli'
  && isset($_SERVER['USER'])
  && $_SERVER['USER'] !== 'www-data') {

  $databases['default']['default']['host'] = '127.0.0.1';
}

/**
 * Trusted host configuration.
 *
 * Drupal core can use the Symfony trusted host mechanism to prevent HTTP Host
 * header spoofing.
 *
 * To enable the trusted host mechanism, you enable your allowable hosts
 * in $settings['trusted_host_patterns']. This should be an array of regular
 * expression patterns, without delimiters, representing the hosts you would
 * like to allow.
 *
 * For example:
 * @code
 * $settings['trusted_host_patterns'] = array(
 *   '^www\.example\.com$',
 * );
 * @endcode
 * will allow the site to only run from www.example.com.
 *
 * If you are running multisite, or if you are running your site from
 * different domain names (eg, you don't redirect http://www.example.com to
 * http://example.com), you should specify all of the host patterns that are
 * allowed by your site.
 *
 * For example:
 * @code
 * $settings['trusted_host_patterns'] = array(
 *   '^example\.com$',
 *   '^.+\.example\.com$',
 *   '^example\.org$',
 *   '^.+\.example\.org$',
 * );
 * @endcode
 * will allow the site to run off of all variants of example.com and
 * example.org, with all subdomains included.
 */
$settings['trusted_host_patterns'] = [
  '^localhost$',
  '^127\.0\.0\.1$',
  '^local\..+\.\w+$',
  '^.+\.probo.build$',
];
