Skip to content
This repository has been archived by the owner on Apr 27, 2021. It is now read-only.

Latest commit

 

History

History
63 lines (58 loc) · 2.98 KB

README.md

File metadata and controls

63 lines (58 loc) · 2.98 KB

mattermost-lti

A dockerized Mattermost instance that can be embedded in a LTI platform, such as Moodle.

⚠️ Still work in progress! Use with caution! ⚠️

If you are thinking of deploying this yourself, maybe just contact me first 😅

Getting Started

Add Moodle Activity

  1. Head to your course and Add an activity or resource
  2. Choose External tool
  3. Set the name of your activity (e.g., Mattermost)
  4. Press the + icon next to Preconfigured tool, to configure the external tool
  5. Configure the tool as follows:
  • Tool name: Mattermost
  • Tool URL: https://mattermost-lti.example.com/app
  • LTI version: LTI 1.3
  • Initiate login URL: https://mattermost-lti.example.com/login
  • Redirection URI(s): https://mattermost-lti.example.com/app
  • Privacy -> Share launcher's name with tool: Always
  • Privacy -> Share launcher's email with tool: Always
  • Privacy -> Accept grades from the tool: Never
  • Privacy -> [x] Force SSL
  1. Save changes
  2. Press the cogs icon next to Preconfigured tool, to retrieve the Client ID of your external tool
  3. Cancel the external tool configuration dialog and save and display your activity
  4. Retrieve the activity ID from the navigation bar of your browser (e.g., https://moodle.example.com/mod/lti/view.php?id=ACTIVITY_ID&forceview=1)

Configure Mattermost-LTI Bridge

  1. Adjust the PLATFORMS variable in .env to match your tool's Client ID and your activity ID: PLATFORMS=ACTIVITY_ID|CLIENT_ID (multiple activities can be separated by colons)
  2. Adjust OAUTH_ID and OAUTH_TOKEN in .env and volumes/app/mattermost/config/config.json (values must match)
  3. Create mandatory directories for Mattermost
    mkdir -p ./volumes/app/mattermost/{data,logs,config}
    cp mattermost-config.json volumes/app/mattermost/config/config.json
    chown -R 2000:2000 ./volumes/app/mattermost/
  4. Start docker-compose stack
    docker-compose up -d
  5. Create a Mattermost system administrator and generate access token
    docker exec -e USER=root -e [email protected] -e PASS=CHANGEME mattermost-lti_app_1 /create-access-token.sh
  6. Set MATTERMOST_TOKEN in .env to the token created in the last step 1 Completely restart the docker-compose stack
    docker-compose down
    docker-compose up -d
  7. Retrieve LTI public key
    docker logs mattermost-lti_mattermost-lti_1

Finish Moodle External Tool Configuration

  1. Head back to your activity and press the cogs icon to open the external tool configuration dialog
  2. Add the public key of the LTI bridge
  3. Optionally set a proper tool icon, by clicking "Show more..." and setting both Icon URL and Secure icon URL to https://mattermost-lti.example.com/static/images/favicon/apple-touch-icon-60x60.png
  4. Save changes
  5. Save and display