-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.docker-template.php
101 lines (83 loc) · 3.42 KB
/
config.docker-template.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?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')];
$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 = 'mailhog: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');
$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';
$CFG->sessioncookie = 'cookies_prefix';
define('PHPUNIT_LONGTEST', true);
if (getenv('MOODLE_DOCKER_APP')) {
$appport = getenv('MOODLE_DOCKER_APP_PORT') ?: 8100;
$CFG->behat_ionic_wwwroot = "http://moodleapp:$appport";
}
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');
}
require_once(__DIR__ . '/lib/setup.php');