How we turned a NAS control panel into an extension platform, why Log Manager was needed, and what the Plugin Template is for.
Instead of an introduction
In the previous article (Mini Bucket 3.6.2: from beta to release), I showed how the panel matured to a stable state: we patched holes, separated databases, and added HTTPS.
But it’s still just a panel. SMB, FTP, and the rest are standard features found in almost any admin panel. It’s time to expand the functionality.
The best solution turned out to be:
-
Not piling module upon module;
-
Not guessing who might need what;
-
Not forcing unnecessary features;
-
Not taking away the enthusiasm and desire of people like me to build something of their own.
Therefore, as previously decided, the way out of this situation was plugins.
A plugin, by definition, is an extension that allows an application to supplement its core functionality (in case anyone didn’t know).
So, plugins
In the new version 3.6.4, I added the ability to install plugins. Before implementation, many questions arose. Our key feature is multi-network (allows switching the frontend to another server’s backend for monitoring and management). So the plugin module must also be able to switch.
No problem: the mechanism is already battle-tested. In one evening, I implemented the plugin module.

But here’s another question:
What if the plugin is installed on the main server but not on the Slave?
To avoid this, I implemented a plugin verification mechanism on the server. If the plugin is missing on the Slave server and we try to manage it, we’ll see a message indicating the plugin is absent with a suggestion to install it.
This is exactly where repository storage comes in handy. If you accept this tempting offer, with one click the plugin will be downloaded to the target server and installed. The page will reload — and now you can manage the plugin.
Later I’ll add version difference control.
What does this give us?
All downloaded plugins can be stored in the Root Master Server repository and distributed to nodes, and from them to their subordinate Slave servers. You won’t have to visit each server and manually install the plugin. Isn’t that lovely?
Now let me tell you about the plugins in detail
Log Manager
This plugin was the first one. In fact, it was working while helping me write this entire endeavor, so that I could then write others.
What can Log Manager do?
-
Select logs that will always be at your fingertips. You can select a log file in the system or specify a path to it and save it to the list. No more memorizing anything or, even worse, turning to Google to find the right log.

-
Display the contents of a log file.
-
Search in real-time and work in live update mode (convenient when you’re hunting for a problem).
-
Clear the log (selectively or completely delete the file contents).
-
Export the log file.
Maybe later I’ll implement some kind of log broker, but I think this is enough for now.
It’s especially convenient to view the necessary logs on specific servers: switch to the desired server and see its list of logs with their contents.
Plugin Template

As the name suggests, this is a plugin template for development. I tried to separate all the standard logic into files.
The template already includes:
-
Standard security checks;
-
Host detection mode for switching;
-
Plugin presence verification mode on the server.
I think those who want to join in expanding the functionality will appreciate it.
I hope there will be those who can master the template and join in expanding the functionality. That’s all for me) Thanks for your attention!
P.S. I’ll leave some useful links related to the article:
Project website: https://mini-bucket.ru/
Plugins: https://mini-bucket.ru/plugins/
Plugin section on the forum: https://mini-bucket.ru/community/community/plugins/
WiKi for Developers: https://mini-bucket.ru/wiki/knowledge-base/dev-pugins/plugin-development/
Installation: https://mini-bucket.ru/install/
For those who already have Mini Bucket installed, an update is ready in the interface under the Update section.
ссылка на оригинал статьи https://habr.com/ru/articles/1046580/