Note: You are currently viewing documentation for Moodle 3.4. Up-to-date documentation for the latest stable version of Moodle is likely available here: MoodleBox.

MoodleBox: Difference between revisions

From MoodleDocs
(Links fixed, see also added.)
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 11: Line 11:
It enables a Moodle administrator to monitor some hardware settings, to set the date of the [https://moodlebox.net MoodleBox], to allow restart and shutdown of the [https://moodlebox.net MoodleBox] and changing Raspberry Pi passwords using a GUI. After the installation in Moodle, some steps are required to complete on the Raspberry Pi (see below).
It enables a Moodle administrator to monitor some hardware settings, to set the date of the [https://moodlebox.net MoodleBox], to allow restart and shutdown of the [https://moodlebox.net MoodleBox] and changing Raspberry Pi passwords using a GUI. After the installation in Moodle, some steps are required to complete on the Raspberry Pi (see below).


The plugin is compatible with Moodle 3.1 or later.
The plugin is compatible with Moodle 3.1 or later. A Raspberry Pi model 3B or 3B+ is recommended.


== Requirements ==
== Requirements ==


* A [https://en.wikipedia.org/wiki/Raspberry_Pi Raspberry Pi] (ideally Model 3 B)
* A [https://en.wikipedia.org/wiki/Raspberry_Pi Raspberry Pi] (Model 3B or 3B+ recommended)
* [https://en.wikipedia.org/wiki/Raspbian Raspbian] installed (or another Linux based distribution)
* [https://en.wikipedia.org/wiki/Raspbian Raspbian] installed (or another Linux based distribution)
* Package Incron installed
* Package Incron installed
Line 26: Line 26:
To complete the installation, you have to create some files in the plugin folder and configure some incron jobs on the MoodleBox.
To complete the installation, you have to create some files in the plugin folder and configure some incron jobs on the MoodleBox.


1 Create necessary files
=== Create necessary files ===
 
'''This step is not needed anymore for versions 1.10 or later'''
 
     touch .reboot-server; touch .shutdown-server; touch .set-server-datetime; touch .newpassword; touch .wifisettings
     touch .reboot-server; touch .shutdown-server; touch .set-server-datetime; touch .newpassword; touch .wifisettings
     chown -R www-data:www-data /var/www/moodle/admin/tool/moodlebox
     chown -R www-data:www-data /var/www/moodle/admin/tool/moodlebox
2 Install incron package and allow root to run it
 
=== Install incron package and allow root to run it ===
     sudo apt-get install incron
     sudo apt-get install incron
     echo root | sudo tee -a /etc/incron.allow
     echo root | sudo tee -a /etc/incron.allow
3 Add following lines to incrontab
 
=== Add following lines to incrontab ===
     /var/www/moodle/admin/tool/moodlebox/.reboot-server IN_CLOSE_WRITE /sbin/shutdown -r now
     /var/www/moodle/admin/tool/moodlebox/.reboot-server IN_CLOSE_WRITE /sbin/shutdown -r now
     /var/www/moodle/admin/tool/moodlebox/.shutdown-server IN_CLOSE_WRITE /sbin/shutdown -h now
     /var/www/moodle/admin/tool/moodlebox/.shutdown-server IN_CLOSE_WRITE /sbin/shutdown -h now
     /var/www/moodle/admin/tool/moodlebox/.set-server-datetime IN_CLOSE_WRITE /bin/bash /var/www/moodle/admin/tool/moodlebox/.set-server-datetime
     /var/www/moodle/admin/tool/moodlebox/.set-server-datetime IN_CLOSE_WRITE /bin/bash /var/www/moodle/admin/tool/moodlebox/.set-server-datetime
     /var/www/moodle/admin/tool/moodlebox/.newpassword IN_CLOSE_WRITE /bin/bash /var/www/moodle/admin/tool/moodlebox/bin/changepassword.sh
     /var/www/moodle/admin/tool/moodlebox/.newpassword IN_CLOSE_WRITE /bin/bash /var/www/moodle/admin/tool/moodlebox/bin/changepassword.sh
     /var/www/moodle/admin/tool/moodlebox/.wifipassword IN_CLOSE_WRITE /bin/bash /var/www/moodle/admin/tool/moodlebox/bin/changewifisettings.sh
     /var/www/moodle/admin/tool/moodlebox/.wifisettings IN_CLOSE_WRITE /bin/bash /var/www/moodle/admin/tool/moodlebox/bin/changewifisettings.sh


4 [[Secure Moodle on Raspberry Pi Model 2, Gentoo Linux and Nginx server|Secure your Moodlebox]]
=== [[Secure Moodle on Raspberry Pi Model 2, Gentoo Linux and Nginx server|Secure your Moodlebox]] ===


== Features ==
== Features ==
Line 51: Line 56:
== Availability ==
== Availability ==


The code is available at [https://github.com/martignoni/moodle-tool_moodlebox https://github.com/martignoni/moodle-tool_moodlebox].
The code is available at [https://github.com/moodlebox/moodle-tool_moodlebox https://github.com/moodlebox/moodle-tool_moodlebox].


== See also ==
== See also ==

Latest revision as of 08:07, 21 March 2018

The MoodleBox plugin for Moodle is an administration tool providing a GUI to some settings and management of a MoodleBox, a Moodle server installed on a Raspberry Pi.

It enables a Moodle administrator to monitor some hardware settings, to set the date of the MoodleBox, to allow restart and shutdown of the MoodleBox and changing Raspberry Pi passwords using a GUI. After the installation in Moodle, some steps are required to complete on the Raspberry Pi (see below).

The plugin is compatible with Moodle 3.1 or later. A Raspberry Pi model 3B or 3B+ is recommended.

Requirements

  • A Raspberry Pi (Model 3B or 3B+ recommended)
  • Raspbian installed (or another Linux based distribution)
  • Package Incron installed
  • Moodle installed (obviously)

Installation

The MoodleBox plugin must be installed in the Moodle tree of the MoodleBox, in the tool folder. Once installed, an new option MoodleBox will be available in Moodle, under Site administration > Server in the Administration block.

To complete the installation, you have to create some files in the plugin folder and configure some incron jobs on the MoodleBox.

Create necessary files

This step is not needed anymore for versions 1.10 or later

   touch .reboot-server; touch .shutdown-server; touch .set-server-datetime; touch .newpassword; touch .wifisettings
   chown -R www-data:www-data /var/www/moodle/admin/tool/moodlebox

Install incron package and allow root to run it

   sudo apt-get install incron
   echo root | sudo tee -a /etc/incron.allow

Add following lines to incrontab

   /var/www/moodle/admin/tool/moodlebox/.reboot-server IN_CLOSE_WRITE /sbin/shutdown -r now
   /var/www/moodle/admin/tool/moodlebox/.shutdown-server IN_CLOSE_WRITE /sbin/shutdown -h now
   /var/www/moodle/admin/tool/moodlebox/.set-server-datetime IN_CLOSE_WRITE /bin/bash /var/www/moodle/admin/tool/moodlebox/.set-server-datetime
   /var/www/moodle/admin/tool/moodlebox/.newpassword IN_CLOSE_WRITE /bin/bash /var/www/moodle/admin/tool/moodlebox/bin/changepassword.sh
   /var/www/moodle/admin/tool/moodlebox/.wifisettings IN_CLOSE_WRITE /bin/bash /var/www/moodle/admin/tool/moodlebox/bin/changewifisettings.sh

Secure your Moodlebox

Features

  • Info about the MoodleBox (kernel version, Raspbian version, free space on SD card, CPU load, CPU temperature, CPU frequency, uptime, DHCP clients).
  • GUI to set the MoodleBox date and time.
  • GUI to set the MoodleBox password.
  • GUI to set the MoodleBox Wi-Fi network password, SSID and channel.
  • GUI to restart and shutdown the MoodleBox.

Availability

The code is available at https://github.com/moodlebox/moodle-tool_moodlebox.

See also