Build with Docker or run a full environment with Docker Compose using the Iron Bank images.
⭐ Note: This repository requires that the user have access to a Registry1 access key. If you do not have one, then you will need to swap the Iron Bank images for publicly available ones.
All together, this project will deploy the following:
- Moodle
- Moodle's Postgres DB
- Nginx
- CATAPULT cmi5 Player
- CATAPULT cmi5 Player's DB
To stand this up, we will populate the required values for the given environment, then use the Docker Compose library to build + start the containers.
If using the Iron Bank images, you must first log into Registry1 with your provided credentials.
docker login registry1.dso.mil
Once that's done, you should be able to pull the required images.
git clone https://github.com/adlnet/adl-moodle
cd adl-moodle
bash ./setup.sh
bash ./init-ssl.sh <Your Hostname>
cp .env.example .env
- Populate the
.env
file docker-compose build --no-cache && docker-compose up -d
The default instructions will create a self-signed certificate , but an actual certificate can be generated by Certbot.
bash ./certbot/generate.sh <Your Domain>
❗ Note: This command will clear out the temporary cert created during the initial setup, so be sure that your instance is actually reach-able before attempting this.
To add an automated renewal script, see our Auto SSL repo for this setup.
Open a browser to Moodle, for example, https://localhost
Use the admin credentials you set in .env to login, then finish setting up your Moodle site.
Download the cmi5 plugin repo as a zip file, then upload this as a Moodle plugin.
- Backup the database (scripts/backup.sh)
- Rebuild docker images (docker-compose up --build -d)
- Run the upgrade script (scripts/upgrade-moodle-version.sh)
- Log into Moodle, confirm the upgrade process
Backups are in ~/backup
$ scripts/backup.sh
A script uses the latest database and file backup from backup.sh, destroys the current data, then restores it all.
$ scripts/restore.sh
The following plug-ins are manually installed using the web-based Moodle Admin Plug-Ins interface:
- Course Certificate
- Certificate Manager
- Logstore xAPI [releases]
- User Bulk Enrolment [source]
- Sharing Cart [source]
The following plug-ins are included in Moodle:
- Big Blue Button
- Open Badges
BigBlueButton requires Ubuntu 18.04.6 LTS
Web conferencing requires a separate server for the BBB Moodle Plug-In to handle the demanding requirements of web conferencing.
BBB Installation on Ubuntu 18, as root user is simply:
wget -qO- https://ubuntu.bigbluebutton.org/bbb-install.sh | bash -s -- -w -a -v bionic-24 -s example.com -e [email protected]
Do not install Greenlight (it's a completely separate web application), and remove the API Demos as instructed.
Then, BBB provides a single command to verify, control, and upgrade the application.
As root user, the command to view the options is:
$ bbb-conf
Install the Plug-in.
Configure the Plug-in
- Set the “endpoint” to the LRS endpoint
- Set the “username” to the LRS basic auth key/username
- Set the “password” to the LRS basic auth secret/password
- Click “Save changes”
Enable the Plug-in
- Navigate to the list of Moodle Server Plug-Ins
- Now in the Plug-Ins list, find the section “Log store manager / Log stores”
- In the list of logging components, click the Eyeball to enable the Logstore xAPI feature
Test the Plug-in
- View some courses
- Wait some time (statements are batched periodically)
- Login to the LRS and verify the information is there
NOTE: This plug-in uses libcurl and Moodle has a separate allowed/blocked IP lists for curl in Admin.
- Review the instructions: Navigate to Admin -> Server -> Web Services Overview
- Enable Web Services: Navigate to Administration > Site administration > Advanced features
- Enable REST: Administration > Site administration > Server > Web services > Manage protocols
- Navigate to Admin -> Users -> You must have a new user like "castle-portal" to grant API access
- Manage Tokens: Administration > Site administration > Server > Web services > Manage tokens
- Grant functions for the portal user
Available functions: https://docs.moodle.org/dev/Web_service_API_functions
- core_enrol_get_enrolled_users
- core_enrol_get_users_courses
- core_user_get_users_by_field
Themes are copied into the image as part of the docker build. (uncomment to work on the theme in dev)
The portal
theme is the currently recommended plug-in which displays the site logo.
You can change your moodle theme to a custom theme easily via Moodle.
- Step 1- Log into Moodle
- Step 2- Click on Administration
- Step 3- Click on Appearance
- Step 4- Click on Themes
- Step 5- Click on Theme Selectors
- Step 6- Click on CustomMoodleTheme and click APPLY.
You should now see your moodle theme applied globally throughout the application for you.
Any custom theme is seen as a plugin on Moodle. So, the following instructions apply.
- Login to your Moodle site as an admin and go to Administration > Site administration > Plugins > Install plugins.
- Upload the ZIP file. You should only be prompted to add extra details (in the Show more section) if your plugin is not automatically detected.
- If your target directory is not writeable, you will see a warning message.
- Check the plugin validation report
[ ] Turn off guest access, in Admin [ ] Turn off showing content before the user logs in, in Admin [ ] Install the en_us language pack (can be done in Admin) [ ] Configure the default language pack setting for all users (update your own manually) [ ] Set the site image and compact image (will show in login page and header) [ ] Optionally Upload the portal.zip theme plug-in [ ] Upload and activate plug-ins: Logstore xAPI, Certificate, Bulk Enrol [ ] Configure OAuth/OIDC with Keycloak configuration
For development only, turn on debugging by editing the config.php file:
$CFG->debug = 32767;
$CFG->debugdisplay = true;