A webpage to manage your Raspberry Pi. Purely written in PHP without any dependencies.
-
Clone the repository in your webroot:
git clone https://github.com/fussel178/raspberry-manager /var/www/raspberry-manager
-
Check out the latest release tag:
git checkout v0.1.0
-
Copy the sudo configuration to the sudoers configuration directory:
sudo cp meta/20-http-raspberry-manager /etc/sudoers.d/
Note: This configuration allows passwordless usage of some system critical commands.
-
Copy the sample configuration and adapt it to your needs:
cp config.sample.php config.php
-
Finished!
- System Controller (Reboot, Poweroff)
- Services Controller (manage systemd via the UI)
- Network Controller (displays some information about network interfaces on the machine)
- Remote Access Controller (renders information on how to connect to the machine)
Raspberry is a really simple PHP project and therefore easy to extend. Every card on the webpage is handled by a "controller". The controller must handle incoming requests and render a webpage after handling the requests.
Raspberry Manager uses mini.css as "of-the-shelf" styling method. (with some tweaks and fixes) You can use a different style set based on mini.css generated with their style generator.
If you created your style set, copy it in the styles
folder and register it in the index.php
in the head section. (see examples there)
Some predefined styles are already included. You can try them out by commenting in and out the right styles in the index.php
head section.
A controller must extend the Controller.php
model.
This inherits the override of the getId
, getTitle
, getKeys
, handle
and render
method.
Returns the unique id of the controller in the project.
Returns the human-readable title of the controller.
Returns an array that holds the elements the controller wants to receive in his handle
method.
Receives the predefined arguments in an array. The handler gets called before the render
method.
Here the controller can handle the incoming request, make system calls, register something, etc.
Must return a valid HTML string. This method gets called, when all requests have been handled and the webpage is built.
Every controller receives it's own space in a card component.
Made with mini.css.