<?php

/**
 * @file
 * Drupal site-specific configuration file.

/**
 * Database settings:
 *
 * The $databases array specifies the database connection or
 * connections that Drupal may use.  Drupal is able to connect
 * to multiple databases, including multiple types of databases,
 * during the same request.
 *
 * Each database connection is specified as an array of settings,
 * similar to the following:
 * @code
 * array(
 *   'driver' => 'mysql',
 *   'database' => 'databasename',
 *   'username' => 'username',
 *   'password' => 'password',
 *   'host' => 'localhost',
 *   'port' => 3306,
 *   'prefix' => 'myprefix_',
 *   'collation' => 'utf8_general_ci',
 * );
 * @endcode
 *
 * The "driver" property indicates what Drupal database driver the
 * connection should use.  This is usually the same as the name of the
 * database type, such as mysql or sqlite, but not always.  The other
 * properties will vary depending on the driver.  For SQLite, you must
 * specify a database file name in a directory that is writable by the
 * webserver.  For most other drivers, you must specify a
 * username, password, host, and database name.
 *
 * Transaction support is enabled by default for all drivers that support it,
 * including MySQL. To explicitly disable it, set the 'transactions' key to
 * FALSE.
 * Note that some configurations of MySQL, such as the MyISAM engine, don't
 * support it and will proceed silently even if enabled. If you experience
 * transaction related crashes with such configuration, set the 'transactions'
 * key to FALSE.
 *
 * For each database, you may optionally specify multiple "target" databases.
 * A target database allows Drupal to try to send certain queries to a
 * different database if it can but fall back to the default connection if not.
 * That is useful for master/slave replication, as Drupal may try to connect
 * to a slave server when appropriate and if one is not available will simply
 * fall back to the single master server.
 *
 * The general format for the $databases array is as follows:
 * @code
 * $databases['default']['default'] = $info_array;
 * $databases['default']['slave'][] = $info_array;
 * $databases['default']['slave'][] = $info_array;
 * $databases['extra']['default'] = $info_array;
 * @endcode
 *
 * In the above example, $info_array is an array of settings described above.
 * The first line sets a "default" database that has one master database
 * (the second level default).  The second and third lines create an array
 * of potential slave databases.  Drupal will select one at random for a given
 * request as needed.  The fourth line creates a new database with a name of
 * "extra".
 *
 * For a single database configuration, the following is sufficient:
 * @code
 * $databases['default']['default'] = array(
 *   'driver' => 'mysql',
 *   'database' => 'databasename',
 *   'username' => 'username',
 *   'password' => 'password',
 *   'host' => 'localhost',
 *   'prefix' => 'main_',
 *   'collation' => 'utf8_general_ci',
 * );
 * @endcode
 *
 * You can optionally set prefixes for some or all database table names
 * by using the 'prefix' setting. If a prefix is specified, the table
 * name will be prepended with its value. Be sure to use valid database
 * characters only, usually alphanumeric and underscore. If no prefixes
 * are desired, leave it as an empty string ''.
 *
 * To have all database names prefixed, set 'prefix' as a string:
 * @code
 *   'prefix' => 'main_',
 * @endcode
 * To provide prefixes for specific tables, set 'prefix' as an array.
 * The array's keys are the table names and the values are the prefixes.
 * The 'default' element is mandatory and holds the prefix for any tables
 * not specified elsewhere in the array. Example:
 * @code
 *   'prefix' => array(
 *    'default'   => 'main_',
 *    'users'    => 'shared_',
 *    'sessions'  => 'shared_',
 *    'role'     => 'shared_',
 *    'authmap'   => 'shared_',
 *   ),
 * @endcode
 * You can also use a reference to a schema/database as a prefix. This may be
 * useful if your Drupal installation exists in a schema that is not the default
 * or you want to access several databases from the same code base at the same
 * time.
 * Example:
 * @code
 *   'prefix' => array(
 *    'default'   => 'main.',
 *    'users'    => 'shared.',
 *    'sessions'  => 'shared.',
 *    'role'     => 'shared.',
 *    'authmap'   => 'shared.',
 *   );
 * @endcode
 * NOTE: MySQL and SQLite's definition of a schema is a database.
 *
 * Advanced users can add or override initial commands to execute when
 * connecting to the database server, as well as PDO connection settings. For
 * example, to enable MySQL SELECT queries to exceed the max_join_size system
 * variable, and to reduce the database connection timeout to 5 seconds:
 *
 * @code
 * $databases['default']['default'] = array(
 *   'init_commands' => array(
 *    'big_selects' => 'SET SQL_BIG_SELECTS=1',
 *   ),
 *   'pdo' => array(
 *    PDO::ATTR_TIMEOUT => 5,
 *   ),
 * );
 * @endcode
 *
 * WARNING: These defaults are designed for database portability. Changing them
 * may cause unexpected behavior, including potential data loss.
 *
 * @see     DatabaseConnection_mysql::__construct
 * @see     DatabaseConnection_pgsql::__construct
 * @see     DatabaseConnection_sqlite::__construct
 *
 * Database configuration format:
 * @code
 *   $databases['default']['default'] = array(
 *    'driver' => 'mysql',
 *    'database' => 'databasename',
 *    'username' => 'username',
 *    'password' => 'password',
 *    'host' => 'localhost',
 *    'prefix' => '',
 *   );
 *   $databases['default']['default'] = array(
 *    'driver' => 'pgsql',
 *    'database' => 'databasename',
 *    'username' => 'username',
 *    'password' => 'password',
 *    'host' => 'localhost',
 *    'prefix' => '',
 *   );
 *   $databases['default']['default'] = array(
 *    'driver' => 'sqlite',
 *    'database' => '/path/to/databasefilename',
 *   );
 * @endcode
 */

$databases['eclipse_api']['default'] = array(
  'driver' => 'mysql',
  'database' => 'dev_drupal7_eclipse_api',
  'username' => getenv('MYSQL_USER'),
  'password' => getenv('MYSQL_PASSWORD'),
  'host' => 'mariadb',
  'prefix' => array(
    'default'   => 'api_',
    'authmap' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'file_managed' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'file_usage' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_scopes' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_scopes' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'oauth2_server' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'oauth2_server_authorization_code' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'oauth2_server_client' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'oauth2_server_jti' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'oauth2_server_scope' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'oauth2_server_token' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'users' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_bio' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_first' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_gender' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_github_id' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_interests' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_job_title' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_last' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_last_updated' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_legal_address' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_org' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_taxonomy_interests' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_twitter_handle' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_website' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_working_groups' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_bio' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_first' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_gender' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_github_id' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_interests' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_job_title' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_last' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_last_updated' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_legal_address' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_org' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_taxonomy_interests' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_twitter_handle' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_website' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_working_groups' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'taxonomy_index' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'taxonomy_term_data' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'taxonomy_term_hierarchy' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'taxonomy_vocabulary' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_limits_user' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_limits_whitelist' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_limits_hostname' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_deleted_revision_10' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_deleted_data_10' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_privacy_control' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_privacy_control' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_hellosign_event' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_hellosign_request' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_hellosign_signer' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_hellosign_template' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_github_delivery' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_github_eclipse_project_repo' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_github_installation' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_github_pull_request' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_github_validation' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_github_validation_author' => 'dev_drupal7_eclipse_accounts_shared.shared_',
  ),
);

$databases['eclipse_accounts_shared']['default'] = array(
  'driver' => 'mysql',
  'database' => 'dev_drupal7_eclipse_accounts_shared',
  'username' => getenv('MYSQL_USER'),
  'password' => getenv('MYSQL_PASSWORD'),
  'host' => 'mariadb',
  'prefix' => 'shared_'
);

$databases['eclipse_accounts']['default'] = array(
  'driver' => 'mysql',
  'database' => 'dev_drupal7_eclipse_accounts',
  'username' => getenv('MYSQL_USER'),
  'password' => getenv('MYSQL_PASSWORD'),
  'host' => 'mariadb',
  'prefix' => array(
    'default'   => 'accounts_',
    'authmap' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'file_managed' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'file_usage' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_scopes' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_scopes' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'oauth2_server' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'oauth2_server_authorization_code' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'oauth2_server_client' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'oauth2_server_jti' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'oauth2_server_scope' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'oauth2_server_token' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'users' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_bio' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_first' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_gender' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_github_id' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_interests' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_job_title' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_last' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_last_updated' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_legal_address' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_org' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_taxonomy_interests' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_twitter_handle' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_website' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_working_groups' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_bio' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_first' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_gender' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_github_id' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_interests' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_job_title' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_last' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_last_updated' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_legal_address' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_org' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_taxonomy_interests' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_twitter_handle' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_website' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_working_groups' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'taxonomy_index' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'taxonomy_term_data' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'taxonomy_term_hierarchy' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'taxonomy_vocabulary' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_limits_user' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_limits_whitelist' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_limits_hostname' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_deleted_revision_10' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_deleted_data_10' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_revision_field_profile_privacy_control' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'field_data_field_profile_privacy_control' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_hellosign_event' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_hellosign_request' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_hellosign_signer' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_hellosign_template' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_github_delivery' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_github_eclipse_project_repo' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_github_installation' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_github_pull_request' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_github_validation' => 'dev_drupal7_eclipse_accounts_shared.shared_',
    'eclipse_api_github_validation_author' => 'dev_drupal7_eclipse_accounts_shared.shared_',
  ),
);

$databases['dev_drupal7_eclipsecon']['default'] = array(
  'driver' => 'mysql',
  'database' => 'dev_drupal7_eclipsecon',
  'username' => getenv('MYSQL_USER'),
  'password' => getenv('MYSQL_PASSWORD'),
  'host' => 'mariadb',
  'prefix' => array(
    'default'   => 'eclipsecon_',
  ),
);

$databases['marketplace']['default'] = array(
  'driver' => 'mysql',
  'database' => 'dev_drupal7_marketplace',
  'username' => getenv('MYSQL_USER'),
  'password' => getenv('MYSQL_PASSWORD'),
  'host' => 'mariadb',
  'prefix' => '',
);

$databases['packages']['default'] = array(
  'database' => 'dev_drupal7_packages',
  'username' => getenv('MYSQL_USER'),
  'password' => getenv('MYSQL_PASSWORD'),
  'host' => 'mariadb',
  'port' => '',
  'driver' => 'mysql',
  'prefix' => 'packages7',
);

$databases['projects']['default'] = array(
  'driver' => 'mysql',
  'database' => 'dev_drupal7_projects',
  'username' => getenv('MYSQL_USER'),
  'password' => getenv('MYSQL_PASSWORD'),
  'host' => 'mariadb',
  'prefix' => '',
);

$databases['eclipse_blogs']['default'] = array(
  'driver' => 'mysql',
  'database' => 'dev_drupal7_eclipse_blogs',
  'username' => getenv('MYSQL_USER'),
  'password' => getenv('MYSQL_PASSWORD'),
  'host' => 'mariadb',
  'prefix' => '',
  'charset' => 'utf8mb4',
  'collation' => 'utf8mb4_general_ci',
);

$databases['eclipse_newsroom']['default'] = array(
  'driver' => 'mysql',
  'database' => 'dev_drupal7_newsroom',
  'username' => getenv('MYSQL_USER'),
  'password' => getenv('MYSQL_PASSWORD'),
  'host' => 'mariadb',
  'prefix' => '',
  'charset' => 'utf8mb4',
  'collation' => 'utf8mb4_general_ci',
);

// None-drupal sites
$databases['eclipsefoundation']['default'] = array(
  'driver' => 'mysql',
  'database' => 'eclipsefoundation',
  'username' => getenv('MYSQL_USER'),
  'password' => getenv('MYSQL_PASSWORD'),
  'host' => 'mariadb',
  'prefix' => '',
);

$databases['foundation'] = $databases['eclipsefoundation'];

$databases['eclipsefoundation_ro']['default'] = array(
  'driver' => 'mysql',
  'database' => 'eclipsefoundation',
  'username' => getenv('MYSQL_USER'),
  'password' => getenv('MYSQL_PASSWORD'),
  'host' => 'mariadb',
  'prefix' => '',
);

$databases['eclipse']['default'] = array(
  'driver' => 'mysql',
  'database' => 'eclipse',
  'username' => getenv('MYSQL_USER'),
  'password' => getenv('MYSQL_PASSWORD'),
  'host' => 'mariadb',
  'prefix' => '',
);

$databases['dash']['default'] = array(
  'driver' => 'mysql',
  'database' => 'dashboard',
  'username' => getenv('MYSQL_USER'),
  'password' => getenv('MYSQL_PASSWORD'),
  'host' => 'mariadb',
  'prefix' => '',
);

$databases['bugzilla']['default'] = array (
  'database' => 'bugs',
  'username' => getenv('MYSQL_USER'),
  'password' => getenv('MYSQL_PASSWORD'),
  'host' => 'mariadb',
  'port' => '',
  'driver' => 'mysql',
  'prefix' => '',
);

$databases['fud_eclipse']['default'] = array (
  'database' => 'dev_fud_eclipse',
  'username' => getenv('MYSQL_USER'),
  'password' => getenv('MYSQL_PASSWORD'),
  'host' => 'mariadb',
  'port' => '',
  'driver' => 'mysql',
  'prefix' => 'fud_',
);

$databases['ipzilla']['default'] = array (
  'database' => 'ipzilla',
  'username' => getenv('MYSQL_USER'),
  'password' => getenv('MYSQL_PASSWORD'),
  'host' => 'mariadb',
  'port' => '',
  'driver' => 'mysql',
  'prefix' => '',
);

$databases['infrazilla']['default'] = array (
  'database' => 'ipzilla',
  'username' => getenv('MYSQL_USER'),
  'password' => getenv('MYSQL_PASSWORD'),
  'host' => 'mariadb',
  'port' => '',
  'driver' => 'mysql',
  'prefix' => '',
);

$databases['bugs']['default'] = $databases['bugzilla']['default'];

/**
 * oAuth2 configurations
 */

// Eclipse Marketplace Favorites
$conf['solstice_support']['oauth2_client']['marketplace'] = array(
  'auth_flow' => 'server-side',
  'client_id' => 'account-does-not-exist-on-production',
  'client_secret' => 'change_me_123',
  'authorization_endpoint' => 'https://accounts.eclipse.dev.docker/oauth2/authorize',
  'token_endpoint' => 'https://accounts.eclipse.dev.docker/oauth2/token',
  'redirect_uri' => $base_url . '/oauth2/authorized',
  'scope' => 'uss_retrieve uss_update',
);

// Eclipse USS
$conf['solstice_support']['oauth2_client']['accounts_eclipse_org'] = array(
  'auth_flow' => 'server-side',
  'client_id' => 'account-does-not-exist-on-production',
  'client_secret' => 'change_me_123',
  'authorization_endpoint' => 'https://accounts.eclipse.dev.docker/oauth2/authorize',
  'token_endpoint' => 'https://accounts.eclipse.dev.docker/oauth2/token',
  'redirect_uri' => $base_url . '/oauth2/authorized',
  'scope' => 'uss_retrieve uss_update profile',
);

// Committer paperwork
$conf['solstice_support']['oauth2_client']['accounts_eclipse_org_private'] = array(
  'auth_flow' => 'client-credentials',
  'client_id' => 'account-does-not-exist-on-production',
  'client_secret' => 'change_me_123',
  'authorization_endpoint' => 'https://accounts.eclipse.dev.docker/oauth2/authorize',
  'token_endpoint' => 'https://accounts.eclipse.dev.docker/oauth2/token',
  'redirect_uri' => $base_url . '/oauth2/authorized',
  'scope' => 'committer_paperwork_retrieve committer_paperwork_update committer_paperwork_delete',
);

$conf['solstice_support']['oauth2_client']['eclipsefdn_service_account'] = array(
  'auth_flow' => 'client-credentials',
  'client_id' => 'account-does-not-exist-on-production',
  'client_secret' => 'change_me_123',
  'authorization_endpoint' => 'https://accounts.eclipse.dev.docker/oauth2/authorize',
  'token_endpoint' => 'https://accounts.eclipse.dev.docker/oauth2/token',
  'redirect_uri' => $base_url . '/oauth2/authorized',
  'scope' => 'eclipsefdn_view_all_profiles',
);

$conf['solstice_support']['oauth2_client']['projects_eclipse_org_private'] = array(
  'auth_flow' => 'client-credentials',
  'client_id' => 'account-does-not-exist-on-production',
  'client_secret' => 'change_me_123',
  'authorization_endpoint' => 'https://accounts.eclipse.dev.docker/oauth2/authorize',
  'token_endpoint' => 'https://accounts.eclipse.dev.docker/oauth2/token',
  'redirect_uri' => $base_url . '/oauth2/authorized',
  'scope' => 'committer_paperwork_retrieve committer_paperwork_update committer_paperwork_delete',
);

$conf['site_login']['eclipse_newsletter'] = array(
  'api_key' => '',
  'list_id' => '',
);

$conf['site_login']['mailchimp']['eclipse'] = array(
  'api_key' => '',
  'list_id' => '',
);

$conf['site_login']['mailchimp']['iot'] = array(
  'api_key' => '',
  'list_id' => '',
);

$conf['site_login']['mailchimp']['jakarta'] = array(
  'api_key' => '',
  'list_id' => '',
);

$conf['github_eca_private_key'] = '';
$conf['github_eca_secret'] = "";


$conf['site_login']['github']['api_key']['eclipsewebdev'] = '';

/**
 * Load EclipseFdn-PHP-SDK
 */
require_once __DIR__ . '/../all/libraries/eclipsefdn-php-sdk/vendor/autoload.php';
$foundation_db['eclipsefoundation'] = array(
  'default' => array(
    'driver' => 'Pdo_Mysql',
    'database' => 'eclipsefoundation',
    'hostname' => 'mariadb',
    'username' => getenv('MYSQL_USER'),
    'password' => getenv('MYSQL_PASSWORD'),
    'charset' => 'utf8'
  ),
  'slave' => array(
    'driver' => 'Pdo_Mysql',
    'database' => 'eclipsefoundation',
    'hostname' => 'mariadb',
    'username' => getenv('MYSQL_USER'),
    'password' => getenv('MYSQL_PASSWORD'),
    'charset' => 'utf8'
  )
);
\eclipsefdn\phpsdk\Database::addDatabase($foundation_db);

/**
 * Reverse Proxy Configuration:
 *
 * Reverse proxy servers are often used to enhance the performance
 * of heavily visited sites and may also provide other site caching,
 * security, or encryption benefits. In an environment where Drupal
 * is behind a reverse proxy, the real IP address of the client should
 * be determined such that the correct client IP address is available
 * to Drupal's logging, statistics, and access management systems. In
 * the most simple scenario, the proxy server will add an
 * X-Forwarded-For header to the request that contains the client IP
 * address. However, HTTP headers are vulnerable to spoofing, where a
 * malicious client could bypass restrictions by setting the
 * X-Forwarded-For header directly. Therefore, Drupal's proxy
 * configuration requires the IP addresses of all remote proxies to be
 * specified in $conf['reverse_proxy_addresses'] to work correctly.
 *
 * Enable this setting to get Drupal to determine the client IP from
 * the X-Forwarded-For header (or $conf['reverse_proxy_header'] if set).
 * If you are unsure about this setting, do not have a reverse proxy,
 * or Drupal operates in a shared hosting environment, this setting
 * should remain commented out.
 *
 * In order for this setting to be used you must specify every possible
 * reverse proxy IP address in $conf['reverse_proxy_addresses'].
 * If a complete list of reverse proxies is not available in your
 * environment (for example, if you use a CDN) you may set the
 * $_SERVER['REMOTE_ADDR'] variable directly in settings.php.
 * Be aware, however, that it is likely that this would allow IP
 * address spoofing unless more advanced precautions are taken.
 */
$conf['reverse_proxy'] = TRUE;

/**
 * Specify every reverse proxy IP address in your environment.
 * This setting is required if $conf['reverse_proxy'] is TRUE.
 */
$conf['reverse_proxy_addresses'] = array($_SERVER['REMOTE_ADDR']);

/**
 * Set this value if your proxy server sends the client IP in a header
 * other than X-Forwarded-For.
 */
$conf['reverse_proxy_header'] = 'HTTP_X_FORWARDED_FOR';

/**
 * Using a reverse proxy with the securelogin module for dev

 * https://www.drupal.org/node/425990#comment-13681864
 */
if (php_sapi_name() != 'cli' && isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
  if (isset($_SERVER['SITE_SUBDIR']) && isset($_SERVER['RAW_HOST'])) {
    // Handle subdirectory mode (e.g. example.com/site1).
    $base_url = $_SERVER['HTTP_X_FORWARDED_PROTO'] . '://' . $_SERVER['RAW_HOST'] . '/' . $_SERVER['SITE_SUBDIR'];
  }
  else {
    $base_url = $_SERVER['HTTP_X_FORWARDED_PROTO'] . '://' . $_SERVER['SERVER_NAME'];
  }
  if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
    $_SERVER['HTTPS'] = 'on';
  }
}