Skip to content

Basic containerized Moodle deployment using the Iron Bank images.

License

Notifications You must be signed in to change notification settings

adlnet/adl-moodle

Repository files navigation

ADL Moodle

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

Setup

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.

  1. git clone https://github.com/adlnet/adl-moodle
  2. cd adl-moodle
  3. bash ./setup.sh
  4. bash ./init-ssl.sh <Your Hostname>
  5. cp .env.example .env
  6. Populate the .env file
  7. docker-compose build --no-cache && docker-compose up -d

Setting up HTTPS

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.

Login to Moodle

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.

Installing the cmi5 Plugin

Download the cmi5 plugin repo as a zip file, then upload this as a Moodle plugin.

Upgrading

  1. Backup the database (scripts/backup.sh)
  2. Rebuild docker images (docker-compose up --build -d)
  3. Run the upgrade script (scripts/upgrade-moodle-version.sh)
  4. Log into Moodle, confirm the upgrade process

Backups

Backups are in ~/backup

$ scripts/backup.sh

Restore

A script uses the latest database and file backup from backup.sh, destroys the current data, then restores it all.

$ scripts/restore.sh

Moodle Plug-Ins

The following plug-ins are manually installed using the web-based Moodle Admin Plug-Ins interface:

The following plug-ins are included in Moodle:

  • Big Blue Button
  • Open Badges

BigBlueButton Server

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

Logstore xAPI Plug-In Setup

Install the Plug-in.

Configure the Plug-in

  1. Set the “endpoint” to the LRS endpoint
  2. Set the “username” to the LRS basic auth key/username
  3. Set the “password” to the LRS basic auth secret/password
  4. Click “Save changes”

Enable the Plug-in

  1. Navigate to the list of Moodle Server Plug-Ins
  2. Now in the Plug-Ins list, find the section “Log store manager / Log stores”
  3. In the list of logging components, click the Eyeball to enable the Logstore xAPI feature

Test the Plug-in

  1. View some courses
  2. Wait some time (statements are batched periodically)
  3. 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.

Steps for System Integration

  1. Review the instructions: Navigate to Admin -> Server -> Web Services Overview
  2. Enable Web Services: Navigate to Administration > Site administration > Advanced features
  3. Enable REST: Administration > Site administration > Server > Web services > Manage protocols
  4. Navigate to Admin -> Users -> You must have a new user like "castle-portal" to grant API access
  5. Manage Tokens: Administration > Site administration > Server > Web services > Manage tokens
  6. Grant functions for the portal user

Web Service Functions

Available functions: https://docs.moodle.org/dev/Web_service_API_functions

User and Course Enrollments

  • core_enrol_get_enrolled_users
  • core_enrol_get_users_courses
  • core_user_get_users_by_field

Themes

How To Install Moodle Theme (From Drop Down Selection) for development

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.

How To Install Moodle Theme via ZIP (Directly From Moodle)

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

Production Moodle Checklist

[ ] 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

Debugging

For development only, turn on debugging by editing the config.php file:

$CFG->debug = 32767;
$CFG->debugdisplay = true;

About

Basic containerized Moodle deployment using the Iron Bank images.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published