Install a VM with Ubuntu 20.04.3 LTS (Focal Fossa). The Desktop and Server Version are available at https://releases.ubuntu.com/20.04/. I used the Desktop Version to have a GUI. HyperV and VMware were both tested and work for this purpose. Choose Hardware according to your needs. 4 vCPU-cores and 4GB RAM should be the minimum of the VM. Also install the ubuntu on a BTRFS Filesystem (You can choose the filesystem during the ubuntu install). That way you won't have to create a loopmount later on.
Install the required dependencies:
sudo apt install make gcc nodejs git btrfs-progs libcap-dev build-essential lxc lxc-dev git curl python2.7
The sourcebox needs node module version 51 which can be found in 7.* node releases. I recommend the latest one 7.10.1. In order to easily install the old node version the node version manager nvm is used. It can be found on github https://github.com/nvm-sh/nvm.
- Run this command NOT AS SUDO to install nvm on your system.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
- Close the terminal and open a new terminal in order for nvm to work
- install node 7.10.1
nvm install 7.10.1
- check the installed node version
node --version
you should get a reply 7.10.1
Sourcebox will need to be run as sudo. You need to create a link to npm and node.
sudo ln -s /home/<username>/.nvm/versions/node/v7.10.1/bin/node /usr/local/bin/node
sudo ln -s /home/<username>/.nvm/versions/node/v7.10.1/bin/npm /usr/local/bin/npm
Python also needs a link.sudo ln -s /usr/bin/python2.7 /usr/bin/python
Clone the git repository in a folder of your choice for example in the home folder.
cd ~
git clone https://github.com/manumts/sourcebox-sandbox.git
- Go in the cloned github directory
cd ~/sourcebox-sandbox
- Compile the sourcebox with the command
npm install -g
- After Compilation link the sourcebox aswell
sudo ln -s /home/<username>/.nvm/versions/node/v7.10.1/bin/sourcebox /usr/local/bin/sourcebox
- One of the dependancies of the old mongoDB version the sourcebox_lti-bridge uses is a package called libssl.so.1.0.0. In order to install this package you will need to add a source to your ubuntu sources list. Open the sources list with a text editor
sudo nano /etc/apt/sources.list
then add this linedeb http://security.ubuntu.com/ubuntu xenial-security main
to the sources list. Runsudo apt update
and then install the libssl-packagesudo apt install libssl1.0.0
. - Install MongoDB Dependencies:
sudo apt-get install libcurl4 openssl liblzma5
- Cd to your home directory
cd ~
and download MongoDB v3.4.6 Archive from the mongoDB Websitewget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-3.4.6.tgz
. If somehow the link changed in the future here is a link to the mongoDB archive: [https://www.mongodb.com/download-center/community/releases/archive] - Unpack the archive
tar -zxvf mongodb-linux-*-3.4.6.tgz
and then place it in a folder of your preference. For examplemkdir mongodb-3.4.6
- Link the mongoDB binaries to the PATH
sudo ln -s /home/<username>/mongodb-3.4.6/bin/* /usr/local/bin/
- Create Folders for MongoDB and own them: Data:
sudo mkdir -p /var/lib/mongo
Logs:sudo mkdir -p /var/log/mongodb
sudo chown <username> /var/lib/mongo
sudo chown <user> /var/log/mongodb
- Run MongoDB:
mongod --dbpath /var/lib/mongo --logpath /var/log/mongodb/mongod.log --fork
- Check that MongoDB started successfully:
cat /var/log/mongodb/mongod.log
it should output [initandlisten] waiting for connections on port 27017 at the end. If something went wrong try deleting the folders you created for mongoDB Logs and Data and repeat the process beginning from step 5 on.
The Node Version 7.* used for compilation of the sourcebox can't be used for the soucebox_lti-bridge.
- Install the latest 8.* Node version via nvm
nvm install 8.17.0
and activate itnvm use 8.17.0
. - Remove the links for Node 7.* in the /usr/local/bin folder
sudo rm /usr/local/bin/node
sudo rm /usr/local/bin/npm
. - Create links for the 8.* Node version
sudo ln -s /home/<username>/.nvm/versions/node/8.17.0/bin/node /usr/local/bin/
/home/<username>/.nvm/versions/node/8.17.0/bin/npm /usr/local/bin/
- Check your Node version with the command
node --version
andsudo node --version
you should get 8.17.0 in both cases.
You will need a Moodle instance to test the sourcebox_lti-bridge (Well if you wouldn't have one you wouldn't be doing all of this anyways...) In the Moodle you will have to configure the tool as a lti plugin. There are some good tutorials online on doing that i recommend these two from the official Moodle documentation: [https://docs.moodle.org/311/de/Als_LTI-Tool_bereitstellen] [https://docs.moodle.org/311/de/Externes_Tool_konfigurieren]. If the link might be dead in the future just google for a tutorial. If you got a Moodle Instance ready and running you can configure the LTI-Plugin just like in the guide and put in a key and password of your liking.
- Clone the sourcebox_lti-bridge files from github:
git clone https://github.com/manumts/sourcebox_lti-bridge.git
- Cd in the sourcebox_lti-bridge directory
cd ~/sourcebox_lti-bridge
- Compile the sourcebox_lti-bridge
npm install -g
This will take some time. - Alter the config file of the sourcebox_lti-bridge
nano ~/sourcebox_lti-bridge/config/default.json
and put the following content in there:{ "serverUrl": "url / ip of your machine", "sourcebox": { "loopMount": "/home/<username>/sourceboxContent", "options": { "diskspace": "30MB", "memory": "30MB", "cpu": 9, "processes": 20 } }, "sourceboxServer": { "authTimeout": 10000, "sessionTimeout": 300000 }, "lti": { "consumer_key": "<key>", "consumer_secret": "<secret>" }, "database": { "url": "mongodb://localhost:27017/sourcebox-lti_bridge", "fileLimitKB": "10", "maxNumberOfFiles": "5" }, "debug": false }
- create the folder sourceboxContent in your home folder
mkdir ~/sourceboxContent
Now that the sourcebox_lti-bridge is compiled and configured it can be run. First cd in the folder of the sourcebox_lti-bridgecd ~/sourcebox_lti-bridge
the run the sourcebox_lti-bridge with this command:sudo DEBUG=sourcebox:* node src/server/server.js
. The tool won't output any feedback in the terminal. The only feedback you get is the blinking cursor. Now try to connect to the tool via moodle. When you got it all right the console should give you an output as soon as you connect to the tool in moodle. Occasionally the terminal window will output some error messages looking like thisat handleAuth (/home/mueller/sourcebox_lti-bridge/src/server/server.js:129:13) at tryCatcher (/home/<username>/sourcebox_lti-bridge/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/home/<username>/sourcebox_lti-bridge/node_modules/bluebird/js/release/promise.js:512:31) at Promise._settlePromise (/home/<username>/sourcebox_lti-bridge/node_modules/bluebird/js/release/promise.js:569:18) at Promise._settlePromise0 (/home/<username>/sourcebox_lti-bridge/node_modules/bluebird/js/release/promise.js:614:10) at Promise._settlePromises (/home/<username>/sourcebox_lti-bridge/node_modules/bluebird/js/release/promise.js:693:18) at Async._drainQueue (/home/<username>/sourcebox_lti-bridge/node_modules/bluebird/js/release/async.js:133:16) at Async._drainQueues (/home/<username>/sourcebox_lti-bridge/node_modules/bluebird/js/release/async.js:143:10) at Immediate.Async.drainQueues (/home/<username>/sourcebox_lti-bridge/node_modules/bluebird/js/release/async.js:17:14) at runCallback (timers.js:810:20) at tryOnImmediate (timers.js:768:5) at processImmediate [as _immediateCallback] (timers.js:745:5) +15ms
. The original server from the creator of the sourcebox_lti-bridge did that as well so you will have to bear with it for now.