MoodleBox: Difference between revisions
MoodleBox | |
---|---|
Type | Admin Tool |
Set | N/A |
Downloads | https://moodle.org/plugins/view.php?plugin=tool_moodlebox |
Issues | https://github.com/moodlebox/moodle-tool_moodlebox/issues |
Discussion | https://discuss.moodlebox.net |
Maintainer(s) | Nicolas Martignoni |
(Update RPi models) |
(→See also: Link added) |
||
(11 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
|type = Admin Tool | |type = Admin Tool | ||
|entry = https://moodle.org/plugins/view.php?plugin=tool_moodlebox | |entry = https://moodle.org/plugins/view.php?plugin=tool_moodlebox | ||
|tracker = https:// | |tracker = https://github.com/moodlebox/moodle-tool_moodlebox/issues | ||
|discussion = | |discussion = https://discuss.moodlebox.net | ||
|maintainer = [[User:Nicolas Martignoni|Nicolas Martignoni]] | |maintainer = [[User:Nicolas Martignoni|Nicolas Martignoni]] | ||
|float = right | |float = right | ||
}} | }} | ||
{{Note|You can find the most up-to-date documentation for this plugin in the MoodleBox webpage at https://moodlebox.net. This page is intended for users that click on the 'Moodle Docs for this page' link.}} | |||
The [https://moodle.org/plugins/view.php?plugin=tool_moodlebox MoodleBox plugin for Moodle] is an administration tool providing a GUI to some settings and management of a [https://moodlebox.net MoodleBox], a Moodle server installed on a [https://en.wikipedia.org/wiki/Raspberry_Pi Raspberry Pi]. | The [https://moodle.org/plugins/view.php?plugin=tool_moodlebox MoodleBox plugin for Moodle] is an administration tool providing a GUI to some settings and management of a [https://moodlebox.net MoodleBox], a Moodle server installed on a [https://en.wikipedia.org/wiki/Raspberry_Pi Raspberry Pi]. | ||
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. | The plugin is compatible with Moodle 3.6 or later. A Raspberry Pi model 3A+, 3B, 3B+ or 4B is recommended. | ||
== Requirements == | == Requirements == | ||
* A [https://en.wikipedia.org/wiki/Raspberry_Pi Raspberry Pi] (Model 3B | * A [https://en.wikipedia.org/wiki/Raspberry_Pi Raspberry Pi] (Model 3A+, 3B, 3B+ or 4B recommended) | ||
* [https://en.wikipedia.org/wiki/ | * [https://en.wikipedia.org/wiki/Raspberry_Pi_OS Raspberry Pi OS] installed (or another Linux based distribution) | ||
* | * Direvent service installed | ||
* Moodle installed (obviously) | * Moodle installed (obviously) | ||
Line 24: | Line 25: | ||
The MoodleBox plugin must be installed in the Moodle tree of the [https://moodlebox.net MoodleBox], in the tool folder. Once installed, an new option MoodleBox will be available in Moodle, under ''Site administration > Server'' in the Administration block. | The MoodleBox plugin must be installed in the Moodle tree of the [https://moodlebox.net 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 | To complete the installation, you have to configure some `direvent` jobs on the MoodleBox. | ||
1. Install `direvent` package: | |||
```bash | |||
sudo apt-get install direvent | |||
``` | |||
1. Add following lines to file `/etc/direvent.conf`: | |||
```bash | |||
# This is the configuration file for direvent. Read | |||
# direvent.conf(5) for more information about how to | |||
# fill this file. | |||
debug 0; | |||
watcher { | |||
path /var/www/moodle/admin/tool/moodlebox/; | |||
file .reboot-server; | |||
event CLOSE_WRITE; | |||
command "/sbin/shutdown -r now"; | |||
} | |||
watcher { | |||
path /var/www/moodle/admin/tool/moodlebox/; | |||
/var/www/moodle/admin/tool/moodlebox/. | file .shutdown-server; | ||
event CLOSE_WRITE; | |||
/var/www/moodle/admin/tool/moodlebox/. | command "/sbin/shutdown -h now"; | ||
/var/www/moodle/admin/tool/moodlebox/. | } | ||
watcher { | |||
path /var/www/moodle/admin/tool/moodlebox/; | |||
file .set-server-datetime; | |||
event CLOSE_WRITE; | |||
command "/bin/bash /var/www/moodle/admin/tool/moodlebox/.set-server-datetime"; | |||
} | |||
watcher { | |||
path /var/www/moodle/admin/tool/moodlebox/; | |||
file .newpassword; | |||
event CLOSE_WRITE; | |||
command "/bin/bash /var/www/moodle/admin/tool/moodlebox/bin/changepassword.sh"; | |||
} | |||
watcher { | |||
path /var/www/moodle/admin/tool/moodlebox/; | |||
file .wifisettings; | |||
event CLOSE_WRITE; | |||
command "/usr/bin/python3 /var/www/moodle/admin/tool/moodlebox/bin/changewifisettings.py"; | |||
} | |||
watcher { | |||
path /var/www/moodle/admin/tool/moodlebox/; | |||
file .resize-partition; | |||
event CLOSE_WRITE; | |||
command "/bin/bash /var/www/moodle/admin/tool/moodlebox/bin/resizepartition.sh"; | |||
} | |||
``` | |||
=== Copy the following line at the end of file /etc/sudoers === | === Copy the following line at the end of file /etc/sudoers === | ||
www-data ALL=(ALL) NOPASSWD:/sbin/parted /dev/mmcblk0 unit MB print free | www-data ALL=(ALL) NOPASSWD:/sbin/parted /dev/mmcblk0 unit MB print free | ||
www-data ALL=(ALL) NOPASSWD:/usr/bin/vcgencmd | |||
=== If you use PiJuice, install the related packages === | |||
sudo apt-get install pijuice-base | |||
sudo adduser www-data i2c | |||
and reboot | |||
=== [[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]] === | ||
This is not needed in normal MoodleBox use, i.e. if you don't expose your MoodleBox on the Internet. | |||
== Features == | == Features == | ||
* Info about the MoodleBox (kernel version, | * Info about the MoodleBox (kernel version, Raspberry Pi OS version, free space on SD card, CPU load, CPU temperature, CPU frequency, uptime, DHCP clients and more). | ||
* Warning when under voltage detected. | |||
* GUI to set the MoodleBox date and time. | * GUI to set the MoodleBox date and time. | ||
* GUI to set the MoodleBox password. | * GUI to set the MoodleBox password. | ||
* GUI to set the MoodleBox Wi-Fi | * GUI to set the MoodleBox Wi-Fi settings: SSID and its visibility, regulatory country, channel, password (or remove password) and fixed IP address. | ||
* GUI to resize the partition of the SD card of the MoodleBox, when needed. | |||
* GUI to restart and shutdown the MoodleBox. | * GUI to restart and shutdown the MoodleBox. | ||
Line 68: | Line 118: | ||
[[es:MoodleBox]] | [[es:MoodleBox]] | ||
[[de:MoodleBox]] |
Latest revision as of 07:00, 25 August 2023
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.6 or later. A Raspberry Pi model 3A+, 3B, 3B+ or 4B is recommended.
Requirements
- A Raspberry Pi (Model 3A+, 3B, 3B+ or 4B recommended)
- Raspberry Pi OS installed (or another Linux based distribution)
- Direvent service 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 configure some `direvent` jobs on the MoodleBox.
1. Install `direvent` package:
```bash sudo apt-get install direvent ```
1. Add following lines to file `/etc/direvent.conf`:
```bash # This is the configuration file for direvent. Read # direvent.conf(5) for more information about how to # fill this file.
debug 0;
watcher { path /var/www/moodle/admin/tool/moodlebox/; file .reboot-server; event CLOSE_WRITE; command "/sbin/shutdown -r now"; }
watcher { path /var/www/moodle/admin/tool/moodlebox/; file .shutdown-server; event CLOSE_WRITE; command "/sbin/shutdown -h now"; }
watcher { path /var/www/moodle/admin/tool/moodlebox/; file .set-server-datetime; event CLOSE_WRITE; command "/bin/bash /var/www/moodle/admin/tool/moodlebox/.set-server-datetime"; }
watcher { path /var/www/moodle/admin/tool/moodlebox/; file .newpassword; event CLOSE_WRITE; command "/bin/bash /var/www/moodle/admin/tool/moodlebox/bin/changepassword.sh"; }
watcher { path /var/www/moodle/admin/tool/moodlebox/; file .wifisettings; event CLOSE_WRITE; command "/usr/bin/python3 /var/www/moodle/admin/tool/moodlebox/bin/changewifisettings.py"; }
watcher { path /var/www/moodle/admin/tool/moodlebox/; file .resize-partition; event CLOSE_WRITE; command "/bin/bash /var/www/moodle/admin/tool/moodlebox/bin/resizepartition.sh"; } ```
Copy the following line at the end of file /etc/sudoers
www-data ALL=(ALL) NOPASSWD:/sbin/parted /dev/mmcblk0 unit MB print free www-data ALL=(ALL) NOPASSWD:/usr/bin/vcgencmd
sudo apt-get install pijuice-base sudo adduser www-data i2c
and reboot
Secure your Moodlebox
This is not needed in normal MoodleBox use, i.e. if you don't expose your MoodleBox on the Internet.
Features
- Info about the MoodleBox (kernel version, Raspberry Pi OS version, free space on SD card, CPU load, CPU temperature, CPU frequency, uptime, DHCP clients and more).
- Warning when under voltage detected.
- GUI to set the MoodleBox date and time.
- GUI to set the MoodleBox password.
- GUI to set the MoodleBox Wi-Fi settings: SSID and its visibility, regulatory country, channel, password (or remove password) and fixed IP address.
- GUI to resize the partition of the SD card of the MoodleBox, when needed.
- GUI to restart and shutdown the MoodleBox.
Availability
The code is available at https://github.com/moodlebox/moodle-tool_moodlebox.