Skip to content

Commit

Permalink
Update config.php
Browse files Browse the repository at this point in the history
  • Loading branch information
lbailey-ucsf authored Jul 15, 2024
1 parent d1b52d0 commit daed857
Showing 1 changed file with 2 additions and 90 deletions.
92 changes: 2 additions & 90 deletions .tugboat/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,48 +11,17 @@
$CFG->dbuser = 'moodle';
$CFG->dbpass = 'm@0dl3ing';
$CFG->prefix = 'm_';
$CFG->dboptions = ['dbcollation' => getenv('MOODLE_DOCKER_DBCOLLATION')];
$CFG->dboptions = ['dbcollation' => 'utf8mb4_unicode_ci'];

//echo "dbtype...";
//print_r($CFG->dbtype);
phpinfo();

if (getenv('MOODLE_DOCKER_DBTYPE') === 'sqlsrv') {
$CFG->dboptions['extrainfo'] = [
// Disable Encryption for now on sqlsrv.
// It is on by default from msodbcsql18.
'Encrypt' => false,
];
}

if (empty($_SERVER['HTTP_HOST'])) {
$_SERVER['HTTP_HOST'] = 'localhost';
}
if (strpos($_SERVER['HTTP_HOST'], '.gitpod.io') !== false) {
// Gitpod.io deployment.
$CFG->wwwroot = 'https://' . $_SERVER['HTTP_HOST'];
$CFG->sslproxy = true;
// To avoid registration form.
$CFG->site_is_public = false;
} else {
// Docker deployment.
$host = 'localhost';
if (!empty(getenv('MOODLE_DOCKER_WEB_HOST'))) {
$host = getenv('MOODLE_DOCKER_WEB_HOST');
}
$CFG->wwwroot = "http://{$host}";
$port = getenv('MOODLE_DOCKER_WEB_PORT');
if (!empty($port)) {
// Extract port in case the format is bind_ip:port.
$parts = explode(':', $port);
$port = end($parts);
if ((string)(int)$port === (string)$port) { // Only if it's int value.
$CFG->wwwroot .= ":{$port}";
}
}
}


$CFG->wwwroot = getenv('TUGBOAT_SERVICE_URL');
$CFG->dataroot = '/var/www/moodledata';
$CFG->admin = 'admin';
$CFG->directorypermissions = 0777;
Expand All @@ -72,8 +41,6 @@

$CFG->phpunit_dataroot = '/var/www/phpunitdata';
$CFG->phpunit_prefix = 't_';
define('TEST_EXTERNAL_FILES_HTTP_URL', 'http://exttests:9000');
define('TEST_EXTERNAL_FILES_HTTPS_URL', 'http://exttests:9000');

$CFG->behat_wwwroot = 'http://webserver';
$CFG->behat_dataroot = '/var/www/behatdata';
Expand All @@ -87,60 +54,5 @@
$CFG->behat_faildump_path = '/var/www/behatfaildumps';

define('PHPUNIT_LONGTEST', true);
/*
if (getenv('MOODLE_DOCKER_APP')) {
$appport = getenv('MOODLE_DOCKER_APP_PORT') ?: 8100;
$protocol = getenv('MOODLE_DOCKER_APP_PROTOCOL') ?: 'https';
$CFG->behat_ionic_wwwroot = "$protocol://moodleapp:$appport";
$CFG->behat_profiles['default']['capabilities'] = [
'extra_capabilities' => [
'chromeOptions' => ['args' => ['--ignore-certificate-errors', '--allow-running-insecure-content']],
],
];
}
if (getenv('MOODLE_DOCKER_PHPUNIT_EXTRAS')) {
define('TEST_SEARCH_SOLR_HOSTNAME', 'solr');
define('TEST_SEARCH_SOLR_INDEXNAME', 'test');
define('TEST_SEARCH_SOLR_PORT', 8983);
define('TEST_SESSION_REDIS_HOST', 'redis');
define('TEST_CACHESTORE_REDIS_TESTSERVERS', 'redis');
define('TEST_CACHESTORE_MONGODB_TESTSERVER', 'mongodb://mongo:27017');
define('TEST_CACHESTORE_MEMCACHED_TESTSERVERS', "memcached0:11211\nmemcached1:11211");
define('TEST_CACHESTORE_MEMCACHE_TESTSERVERS', "memcached0:11211\nmemcached1:11211");

define('TEST_LDAPLIB_HOST_URL', 'ldap://ldap');
define('TEST_LDAPLIB_BIND_DN', 'cn=admin,dc=openstack,dc=org');
define('TEST_LDAPLIB_BIND_PW', 'password');
define('TEST_LDAPLIB_DOMAIN', 'ou=Users,dc=openstack,dc=org');
define('TEST_AUTH_LDAP_HOST_URL', 'ldap://ldap');
define('TEST_AUTH_LDAP_BIND_DN', 'cn=admin,dc=openstack,dc=org');
define('TEST_AUTH_LDAP_BIND_PW', 'password');
define('TEST_AUTH_LDAP_DOMAIN', 'ou=Users,dc=openstack,dc=org');
define('TEST_ENROL_LDAP_HOST_URL', 'ldap://ldap');
define('TEST_ENROL_LDAP_BIND_DN', 'cn=admin,dc=openstack,dc=org');
define('TEST_ENROL_LDAP_BIND_PW', 'password');
define('TEST_ENROL_LDAP_DOMAIN', 'ou=Users,dc=openstack,dc=org');
}
if (property_exists($CFG, 'behat_wwwroot')) {
$mockhash = sha1($CFG->behat_wwwroot);
} else {
$mockhash = sha1($CFG->wwwroot);
}
if (getenv('MOODLE_DOCKER_BBB_MOCK')) {
define('TEST_MOD_BIGBLUEBUTTONBN_MOCK_SERVER', "http://bbbmock/{$mockhash}");
}
if (getenv('MOODLE_DOCKER_MATRIX_MOCK')) {
define('TEST_COMMUNICATION_MATRIX_MOCK_SERVER', "http://matrixmock/{$mockhash}");
}
*/
require_once(__DIR__ . '/lib/setup.php');

0 comments on commit daed857

Please sign in to comment.