- Docker Engine
- Docker Compose (
https://docs.docker.com/compose/install/#install-compose
) - PHP + Composer (
https://getcomposer.org/doc/00-intro.md
)
Run the setup.sh bash script ./setup.sh
.
From repo root directory: docker-compose up
Wait for this output before attempting to connect to moodle via browser (be aware that this can take several minutes to complete):
moodle_1 | mysql-c INFO Found MySQL server listening at mariadb:3306
moodle_1 | mysql-c INFO MySQL server listening and working at mariadb:3306
moodle_1 | moodle INFO Configuring Cron Jobs...
moodle_1 | moodle INFO
moodle_1 | moodle INFO ########################################################################
moodle_1 | moodle INFO Installation parameters for moodle:
moodle_1 | moodle INFO Username: user
moodle_1 | moodle INFO Password: **********
moodle_1 | moodle INFO Email: [email protected]
moodle_1 | moodle INFO (Passwords are not shown for security reasons)
moodle_1 | moodle INFO ########################################################################
moodle_1 | moodle INFO
moodle_1 | nami INFO moodle successfully initialized
moodle_1 | INFO ==> Starting moodle...
Standard Docker Moodle Admin: user = 'user', password = 'bitnami'
- Login to site using Moodle Admin credentials
user, bitnami
- Site administration > Plugins > Authentication > Manage authentication
- enable HTTP Basic Authentication Proxy
- Settings: URL = http://auth/response.php (docker auth service)
- Save changes
- Site administration > Development > Debugging > Developer mode
There are 100 users setup in the .htpasswd file for authentication:
- Username: u0 ... u99
- Password: password
docker-compose exec moodle bash
tail -f /tmp/php_errors.log
docker-compose exec moodle bash
mysql -h mariadb -u root
(You'll need to have either run setup.sh or manually run composer against src/basicauthproxy/composer.lock)
cd src/basicauthproxy
./vendor/bin/phpunit
- copy the 'basicauthproxy' directory and its contents to the Moodle server's directory:
/path/to/moodle/auth
. It should sit at the same level as the other auth plugins, e.g. /email, /nologin, /oauth2, etc. - cd into the basicauthproxy directory and run
composer install
- restart Moodle - plugin should be visible in admin panel
- The plugin uses the PHP global $_SERVER['SERVER_NAME']. Please be aware of the advice given in the PHP Manual (http://php.net/manual/en/reserved.variables.server.php) "Note: Under Apache 2, you must set UseCanonicalName = On and ServerName. Otherwise, this value reflects the hostname supplied by the client, which can be spoofed. It is not safe to rely on this value in security-dependent contexts."