forked from ucsf-education/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added moodle php config to tugboat directory; updated config.yml with…
… an update command and change to DOCROOT sym link.
- Loading branch information
1 parent
7693c09
commit 321a073
Showing
2 changed files
with
148 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
<?php // Moodle configuration file | ||
|
||
unset($CFG); | ||
global $CFG; | ||
$CFG = new stdClass(); | ||
|
||
$CFG->dbtype = getenv('MOODLE_DOCKER_DBTYPE'); | ||
$CFG->dblibrary = 'native'; | ||
$CFG->dbhost = 'db'; | ||
$CFG->dbname = getenv('MOODLE_DOCKER_DBNAME'); | ||
$CFG->dbuser = getenv('MOODLE_DOCKER_DBUSER'); | ||
$CFG->dbpass = getenv('MOODLE_DOCKER_DBPASS'); | ||
$CFG->prefix = 'm_'; | ||
$CFG->dboptions = ['dbcollation' => getenv('MOODLE_DOCKER_DBCOLLATION')]; | ||
|
||
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->dataroot = '/var/www/moodledata'; | ||
$CFG->admin = 'admin'; | ||
$CFG->directorypermissions = 0777; | ||
$CFG->smtphosts = 'mailpit:1025'; | ||
$CFG->noreplyaddress = '[email protected]'; | ||
|
||
// Debug options - possible to be controlled by flag in future.. | ||
$CFG->debug = (E_ALL | E_STRICT); // DEBUG_DEVELOPER | ||
$CFG->debugdisplay = 1; | ||
$CFG->debugstringids = 1; // Add strings=1 to url to get string ids. | ||
$CFG->perfdebug = 15; | ||
$CFG->debugpageinfo = 1; | ||
$CFG->allowthemechangeonurl = 1; | ||
$CFG->passwordpolicy = 0; | ||
$CFG->cronclionly = 0; | ||
$CFG->pathtophp = '/usr/local/bin/php'; | ||
|
||
$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'; | ||
$CFG->behat_prefix = 'b_'; | ||
$CFG->behat_profiles = array( | ||
'default' => array( | ||
'browser' => getenv('MOODLE_DOCKER_BROWSER'), | ||
'wd_host' => 'http://selenium:4444/wd/hub', | ||
), | ||
); | ||
$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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters