MoodleBox: Skillnad mellan sidversioner
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 |
Ingen redigeringssammanfattning |
(Update postinstall instructions) |
||
Rad 25: | Rad 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 === |
Versionen från 23 april 2022 kl. 16.28
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)
- 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 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
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, 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.